ci: replace the asset auto-commit with a staleness gate, drop dist orphans - #724
Merged
Conversation
The Build Assets workflow could not do its job. It checked out github.head_ref and let git-auto-commit-action push there, so a rebuilt asset landed on the merged feature branch and never reached 5.x. Deleting the branch on merge — which is what surfaced this — meant the ref was gone by the time the workflow ran and checkout failed outright. Its path filter was wrong too. bin/build.js esbuilds exactly two entry points from resources/js; it never reads blade views and emits no CSS, so the resources/views and resources/css triggers could not change any output. In four runs the workflow never once produced a commit — resources/dist has only ever been committed by hand. The concern behind it is real: resources/dist is committed and shipped, so a change to resources/js that lands without a rebuild publishes stale assets. Turn it into a gate instead. The Assets job rebuilds and fails if resources/dist differs from what is committed, catching it on the pull request rather than after a tag is cut. The build is deterministic — a fresh build of the current tree is byte-identical to the committed dist. Also corrects the CI section of CLAUDE.md, which still named a ci-filament-5.yml that #720 folded into ci.yml. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Neither is produced by bin/build.js, and a rebuild after removing them
leaves dist with only the two entry points the build actually emits.
curator.js has not been registered since before v3 shipped and was last
modified in 2023; it still fetches /curator/media and drives a
showUploadForm flag that no current view has.
curator.css was registered on 3.x as Css::make('curator', ...), but the
v4 rewrite in d104cf4 dropped that registration. No README or UPGRADE
revision has ever pointed at it — v4 and v5 tell users to import
resources/css/plugin.css, and on v3 the service provider loaded it, so
nothing was ever importing this path by hand.
3.x is untouched and keeps its own copy, which is still live there.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
Build Assetsworkflow started failing on the last two merges. Looking into it, it could never have worked — so this removes it and replaces the concern behind it with a check. It also clears out two dead files inresources/distthat the investigation turned up.Why it failed
It checks out
github.head_ref, the PR's source branch. Both merges deleted the branch, so the ref was gone by the time the workflow ran andgit fetchfailed:Why fixing the checkout wouldn't have helped
It commits to the wrong branch.
git-auto-commit-actionpushes to whatever is checked out — the just-merged feature branch, not5.x. Even on a green run the rebuilt asset never reaches the release branch.Its path filter doesn't match the build.
bin/build.jsesbuilds exactly two entry points,resources/js/curation.jsandresources/js/rich-editor-integration.js. It never reads blade views and emits no CSS, so theresources/views/**.phpandresources/css/**.csstriggers can't change any build output.The history agrees: four runs total (two failures this week, one skipped in July, one that died on
npm ciback in March), and not one produced a commit. Every commit touchingresources/disthas been by hand.What replaces it
The concern is real —
resources/distis committed and shipped, so a change toresources/jsthat lands without a rebuild silently publishes stale assets. That's better caught on the PR than after a tag is cut, so the newAssetsjob inci.ymlrebuilds and fails ifresources/distdiffers from what's committed:git status --porcelainrather thangit diff --exit-codeso a new dist file (untracked) counts as stale too, not just a modified one. Verified locally against a clean tree, a hand-edited dist file, and an untracked new one.This is a local job, not part of the shared baseline — the shared workflow's
run-buildinput is a different thing (it builds assets for suites that need them and checks nothing), and Curator correctly leaves itfalse.Actions are pinned to full commit SHAs per the repo convention, reusing the pins the deleted workflow already carried.
Dropping the dist orphans
resources/dist/curator.cssandresources/dist/curator.jsare unreachable on this line. Neither is produced bybin/build.js— a rebuild after removing them leaves dist with only the two entry points the build actually emits — and a sweep of the repo (excludingvendor/,node_modules/,dist/itself) finds zero references fromsrc/, the views, the config, or the docs.curator.jshasn't been registered since before v3 shipped, last modified 2023-09-03. It still fetches/curator/mediaand drives ashowUploadFormflag no current view has.curator.csswas registered on 3.x asCss::make('curator', ...)->loadedOnRequest(), but the v4 rewrite in d104cf4 dropped that registration. No README or UPGRADE revision has ever pointed at this path — v4 and v5 tell users to importresources/css/plugin.css, and on v3 the service provider loaded it, so nothing was importing it by hand either.3.xis untouched and keeps its own copy, which is still live there.Notes
npm ci && npm run buildon5.xproduces aresources/distbyte-identical to what's committed. Nothing stale shipped.CLAUDE.md's CI section still named aci-filament-5.ymlthat Support Filament 4 and 5 from a single branch #720 folded intoci.yml; corrected here along with the new check.composer testis green: 218 passed, PHPStan clean, no Pint or Rector drift.🤖 Generated with Claude Code