Skip to content

Commit b4ad6f5

Browse files
committed
ci: regenerate example trees in the weekly bundled-update workflow
After re-blessing the golden snapshots, replay each example tree's recorded command against the refreshed bundle (`gloam regen --fresh`; locked regen would refuse pins the new bundle no longer satisfies) and include examples/ in the PR. Regenerated files embed gloam's own version/commit, so a regen at a new HEAD always produces cosmetic churn; the regen is kept only when the diff is significant under the same filter `gloam regen` prints for human review (preamble stamps, the manifest's gloam meta block, and the output BOM's file hashes). A real change always registers: generated-file content shows its own diff, and a provenance pin advance moves the unfiltered 6-space "commit" line — so a no-op bundle refresh leaves the PR without example churn, while both spec-driven and generator-driven output changes are committed alongside the bundle they came from. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
1 parent 4d0250f commit b4ad6f5

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/update-bundled.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,32 @@ jobs:
4747
- name: Run test suite against updated files
4848
run: cargo test --release --no-default-features
4949

50+
- name: Regenerate example loader trees
51+
# Replays each tree's recorded command against the refreshed bundle
52+
# (`--fresh`: locked regen would refuse pins the new bundle no longer
53+
# satisfies). Regenerated files embed gloam's own version/commit, so
54+
# a regen at a new HEAD always produces cosmetic churn; the regen is
55+
# kept only when something beyond those stamp lines changed. The
56+
# filter mirrors the one `gloam regen` prints for human review:
57+
# preamble stamps, the manifest's gloam meta block, and the output
58+
# BOM's file hashes (which track stamp changes byte-for-byte). A
59+
# real source change always stays visible — a provenance pin's blob
60+
# never moves without its unfiltered sibling "commit" line moving
61+
# too. `git add -N` makes any newly emitted file visible to the
62+
# diff before it is judged.
63+
run: |
64+
set -euo pipefail
65+
cargo run --release --no-default-features -p gloam -- regen --fresh examples
66+
git add -N examples
67+
if git diff -I'^ \* @generated by gloam ' -I'^// @generated by gloam ' \
68+
-I'^ "(version|describe|commit)": ' -I'^ "blob": ' \
69+
--quiet -- examples; then
70+
echo "Examples unchanged beyond gloam version/commit stamps; reverting."
71+
git reset -q -- examples
72+
git checkout -- examples
73+
git clean -qfd examples
74+
fi
75+
5076
# Build a human-readable provenance summary (one line per upstream repo,
5177
# with its git describe) for the PR body, straight from the manifest the
5278
# bundler just wrote.
@@ -72,6 +98,7 @@ jobs:
7298
add-paths: |
7399
bundled/
74100
tests/golden/
101+
examples/
75102
commit-message: |
76103
chore: update bundled specs, headers, and provenance
77104
@@ -97,6 +124,11 @@ jobs:
97124
moved. Any diff under `tests/golden/` shows exactly how the new
98125
specs change generated loader output; no golden diff means the
99126
update is output-neutral for the snapshot configs.
127+
128+
The example loader trees under `examples/` were regenerated
129+
against the new bundle (`gloam regen --fresh`); they appear in
130+
this PR only if the update changed them beyond gloam's own
131+
version/commit stamp lines.
100132
branch: update-bundled-xml
101133
delete-branch: true
102134
labels: dependencies

0 commit comments

Comments
 (0)