fix(deploy): trust the artifacts, not only the diff - #25
Merged
Conversation
The changed-paths pattern classifies a diff. This adds the question the diff is only ever a proxy for: is what we built older than what we built it from? The two disagree whenever a release is skipped, and a skipped rebuild does not retry itself. The next deploy diffs against the commit that skipped it, finds nothing front-end in that range, and leaves the stale bundle in place — so one misclassified path strands the site until somebody runs FORCE=1 by hand. That is exactly what happened today, twice over. resources/data was classified as content, so corrected prices and database counts deployed green and never reached the page. Then the deploy that fixed the classifier could not undo its own backlog, because by then the data change was behind it: /compare/postico is live promising "Postgres plus 17 other databases" while its own table says 25, two commits after the fix for it merged. Comparing the manifest's timestamp against the front-end sources costs one `find`, cannot be fooled by a pattern nobody remembered to update, and heals a backlog on the next deploy instead of requiring a human on the server.
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 changed-paths pattern classifies a diff. This adds the question the diff is only ever a proxy for: is what we built older than what we built it from?
Why a classifier alone can't be right
A skipped rebuild doesn't retry itself. The next deploy diffs against the commit that skipped it, finds nothing front-end in that range, and leaves the stale bundle in place. One misclassified path strands the site until someone runs
FORCE=1by hand.That happened twice today, in sequence:
resources/data/was classified as content → fix(compare): correct four stale counts and four wrong prices #21's corrected prices and counts deployed green and never reached the page./compare/posticois live right now promising "Postgres plus 17 other databases" on a page whose own table says 25.The second failure is the interesting one: the fix was correct and still left the site wrong. Any classifier will have this property, because the thing it's approximating is the artifact's freshness, and only the artifact knows that.
What it costs
One
find, already written for #22's skip branch and reused here. It cannot be fooled by a pattern nobody remembered to update, and it heals a backlog on the next deploy rather than requiring a human on the server.bundles_are_staleis defined once and consulted in both places; the test asserts the definition precedes both uses, since a function referenced before definition is an empty command in shell.Verification
This deploy should print
the built bundles are older than the sources — rebuilding regardless of the diffand finally ship #21's corrections.