Skip to content

Commit 7945f59

Browse files
author
Callin Mullaney
committed
chore!: harden 7.x release readiness checks
Expand release checks for hooks, favicon settings, and Starterkit output. Verify generated child themes and upload smoke artifacts on failure. Refresh template parity language for the parent-theme removal.
1 parent 2becc8a commit 7945f59

6 files changed

Lines changed: 547 additions & 157 deletions

File tree

.github/scripts/generate-template-map.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ reason_for_template() {
6767
fi
6868

6969
if [ "$modified" = "No" ]; then
70-
echo "Parent parity"
70+
echo "Core baseline parity"
7171
return
7272
fi
7373

.github/scripts/release-check.cjs

Lines changed: 350 additions & 32 deletions
Large diffs are not rendered by default.

.github/scripts/starterkit-smoke.sh

Lines changed: 84 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,69 @@
33
set -euo pipefail
44

55
# Generates a child theme from the Whisk starter source and proves the result is
6-
# installable. This is intentionally a Drupal Starterkit smoke test, not a
7-
# frontend build test; it guards the PHP/theme metadata contract that release
8-
# consumers hit before Node tooling runs.
6+
# installable, renderable, and compatible with the Vite-based build workflow
7+
# powered by Emulsify Core 4.
98
if [ "$#" -lt 2 ]; then
109
echo "Usage: $0 <fixture-dir> <output-dir>" >&2
1110
exit 1
1211
fi
1312

1413
fixture_dir="$1"
1514
output_dir="$2"
16-
generated_theme="emulsify_fixture"
15+
generated_theme="${EMULSIFY_STARTERKIT_THEME:-emulsify_fixture}"
1716
generated_theme_dir="${fixture_dir}/web/themes/custom/${generated_theme}"
17+
generated_theme_info="${generated_theme_dir}/${generated_theme}.info.yml"
1818
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
19+
artifact_info="${output_dir}/generated-theme-info.yml"
20+
npm_install_log="${output_dir}/npm-install.log"
21+
npm_build_log="${output_dir}/npm-build.log"
22+
storybook_build_log="${output_dir}/storybook-build.log"
1923

2024
mkdir -p "$output_dir"
25+
printf 'npm install has not run yet.\n' >"$npm_install_log"
26+
printf 'npm run build has not run yet.\n' >"$npm_build_log"
27+
printf 'npm run storybook-build has not run.\n' >"$storybook_build_log"
28+
29+
fail() {
30+
echo "$1" >&2
31+
exit 1
32+
}
33+
34+
show_log_tail() {
35+
local log_file="$1"
36+
37+
if [ -f "$log_file" ]; then
38+
echo "--- ${log_file} tail ---" >&2
39+
tail -n 160 "$log_file" >&2 || true
40+
fi
41+
}
42+
43+
run_logged() {
44+
local log_file="$1"
45+
shift
46+
47+
if ! "$@" >"$log_file" 2>&1; then
48+
echo "Command failed: $*" >&2
49+
show_log_tail "$log_file"
50+
exit 1
51+
fi
52+
}
53+
54+
assert_missing_file() {
55+
local relative_path="$1"
56+
57+
if [ -e "${generated_theme_dir}/${relative_path}" ]; then
58+
fail "Starterkit output should not include ${relative_path}."
59+
fi
60+
}
61+
62+
assert_missing_glob() {
63+
local glob_pattern="$1"
64+
65+
if compgen -G "${generated_theme_dir}/${glob_pattern}" >/dev/null; then
66+
fail "Starterkit output should not include files matching ${glob_pattern}."
67+
fi
68+
}
2169

2270
(
2371
cd "$fixture_dir"
@@ -26,21 +74,27 @@ mkdir -p "$output_dir"
2674
php web/core/scripts/drupal generate-theme "$generated_theme" --starterkit whisk --path themes/custom -n
2775
)
2876

29-
test -f "${generated_theme_dir}/${generated_theme}.info.yml"
30-
grep -Eq "^('?base theme'?): emulsify$" "${generated_theme_dir}/${generated_theme}.info.yml"
77+
test -f "$generated_theme_info"
78+
cp "$generated_theme_info" "$artifact_info"
3179

32-
# Generated themes must be visible/installable and should not carry the source
33-
# theme's private project config marker into consumer projects.
34-
if grep -q '^hidden: true$' "${generated_theme_dir}/${generated_theme}.info.yml"; then
35-
echo "Generated theme should not remain hidden." >&2
36-
exit 1
80+
if ! grep -Eq "^('?base theme'?): emulsify$" "$generated_theme_info"; then
81+
fail "Generated theme must use emulsify as its runtime parent theme."
3782
fi
3883

39-
if [ -e "${generated_theme_dir}/project.emulsify.json" ]; then
40-
echo "Starterkit output should not include project.emulsify.json." >&2
41-
exit 1
84+
# Generated themes must be visible/installable and should not carry the source
85+
# theme's private starter metadata into consumer projects.
86+
if grep -Eq '^hidden:[[:space:]]*true[[:space:]]*$' "$generated_theme_info"; then
87+
fail "Generated theme should not remain hidden."
4288
fi
4389

90+
assert_missing_file "project.emulsify.json"
91+
assert_missing_file "whisk.starterkit.yml"
92+
assert_missing_file "whisk.info.emulsify.yml"
93+
assert_missing_file "${generated_theme}.starterkit.yml"
94+
assert_missing_file "${generated_theme}.info.emulsify.yml"
95+
assert_missing_glob "*.starterkit.yml"
96+
assert_missing_glob "*.info.emulsify.yml"
97+
4498
(
4599
cd "$fixture_dir"
46100
./vendor/bin/drush theme:enable "$generated_theme" -y
@@ -49,6 +103,21 @@ fi
49103
)
50104

51105
# Finish by rendering representative pages through the generated theme. This
52-
# catches missing libraries, broken base-theme inheritance, and template issues
106+
# catches missing libraries, broken parent-theme inheritance, and template issues
53107
# that pure file assertions cannot see.
54108
bash "${script_dir}/render-reference-pages.sh" "$fixture_dir" "$output_dir"
109+
110+
(
111+
cd "$generated_theme_dir"
112+
install_args=(install --no-audit --no-fund)
113+
if [ -f package-lock.json ]; then
114+
install_args=(ci --no-audit --no-fund)
115+
fi
116+
117+
run_logged "$npm_install_log" npm "${install_args[@]}"
118+
run_logged "$npm_build_log" npm run build
119+
120+
if [ "${EMULSIFY_STARTERKIT_STORYBOOK_BUILD:-0}" = "1" ]; then
121+
run_logged "$storybook_build_log" npm run storybook-build
122+
fi
123+
)

.github/scripts/template-parity.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -euo pipefail
44

55
# Verifies Emulsify owns the same template path surface that stable9 provides
6-
# without inheriting stable9 as a base theme. This is a path-contract check:
6+
# without inheriting stable9 as a parent theme. This is a path-contract check:
77
# templates may intentionally differ in content, but missing stable9 paths would
88
# reintroduce hidden fallback behavior in Drupal 11/12 readiness testing.
99
if [ "$#" -lt 2 ]; then
@@ -39,7 +39,7 @@ if [ ! -d "$repo_templates_dir" ]; then
3939
fi
4040

4141
if grep -Eq "^base theme: stable9$" "${repo_root}/emulsify.info.yml"; then
42-
echo "emulsify.info.yml should not declare stable9 as a base theme." >&2
42+
echo "emulsify.info.yml should not declare stable9 as its parent theme." >&2
4343
exit 1
4444
fi
4545

.github/workflows/theme-readiness.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ jobs:
4545
tools: composer:v2
4646
extensions: gd, imagick
4747

48+
- { name: Setup Node, uses: actions/setup-node@v4, with: { node-version: 24 } }
49+
50+
- { name: Run static release check, run: 'npm run release:check -- --skip-smoke' }
51+
4852
- name: Build fixture site
4953
id: build_fixture
5054
continue-on-error: ${{ matrix.experimental }}
@@ -64,7 +68,7 @@ jobs:
6468
name: stable9-template-parity-${{ matrix.artifact-suffix }}
6569
path: ${{ runner.temp }}/emulsify-template-parity.md
6670

67-
- name: Smoke test base theme page rendering
71+
- name: Smoke test parent theme page rendering
6872
if: ${{ !cancelled() && steps.build_fixture.outcome == 'success' }}
6973
continue-on-error: ${{ matrix.experimental }}
7074
run: bash .github/scripts/render-reference-pages.sh /tmp/emulsify-fixture /tmp/emulsify-base-theme
@@ -79,7 +83,6 @@ jobs:
7983
continue-on-error: ${{ matrix.experimental }}
8084
run: bash .github/scripts/favicon-portability-smoke.sh /tmp/emulsify-fixture emulsify
8185

82-
- name: Generate and enable a Whisk-derived theme
83-
if: ${{ !cancelled() && steps.build_fixture.outcome == 'success' }}
84-
continue-on-error: ${{ matrix.experimental }}
85-
run: bash .github/scripts/starterkit-smoke.sh /tmp/emulsify-fixture /tmp/emulsify-generated-theme
86+
- { name: Generate and enable a Whisk-derived theme, id: starterkit_smoke, if: "${{ !cancelled() && steps.build_fixture.outcome == 'success' }}", continue-on-error: "${{ matrix.experimental }}", run: 'bash .github/scripts/starterkit-smoke.sh /tmp/emulsify-fixture "${{ runner.temp }}/emulsify-generated-theme"' }
87+
88+
- { name: Upload generated theme smoke artifacts, if: "${{ !cancelled() && steps.build_fixture.outcome == 'success' && steps.starterkit_smoke.outcome == 'failure' }}", uses: actions/upload-artifact@v4, with: { name: "generated-theme-smoke-${{ matrix.artifact-suffix }}", if-no-files-found: warn, path: "${{ runner.temp }}/emulsify-generated-theme" } }

0 commit comments

Comments
 (0)