Compute the version on the pull request instead of after the merge - #1358
Merged
mastacontrola merged 6 commits intoAug 26, 2026
Merged
Conversation
Turns on fogproject-pr-regen.yml's sync_version, so a pull request into working-1.6 arrives already carrying the version its merge commit will produce. THIS DEPENDS ON A RULESET, NOT ONLY ON THIS LINE FOG_VERSION is the commit count since master, so predicting it before the merge is sound only while working-1.6 enforces both "require branches to be up to date before merging" and merge commits as the only merge method. Squash collapses N commits into one and makes the count unrecoverable; rebase adds no merge commit at all. Either setting being turned off silently makes every version written here wrong by one, which is why the requirement is spelled out at the call site rather than left in a PR description. The workflow does not simply trust the setting: it re-checks at runtime that HEAD contains the tip of the base branch, and skips the version step rather than committing a number it cannot stand behind if base moved in between. sync-generated-files.yml is deliberately NOT deleted. It stops being the mechanism and becomes the backstop, still covering the cases the prediction cannot: a squash or rebase that slipped through, an admin bypass, a merged fork PR that never ran the PR-time job, and anything the regen guards skipped. On a well-behaved same-repo PR it now finds nothing to do -- that is the expected outcome, not a symptom, and its header now says so. Apply the ruleset before merging this; the two changes are one change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014S5HrfuMMH1jyftmZ3kJoM
…r-tests-2a3kv7-version-sync
darksidemilk
changed the base branch from
claude/psr-lang-pr-tests-2a3kv7
to
working-1.6
August 25, 2026 05:21
…g-pr-tests-2a3kv7-version-sync
…version-sync' into claude/psr-lang-pr-tests-2a3kv7-version-sync
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.
Part 2 of 2, stacked on #1357 so the diff shows only the incremental change. GitHub will retarget this to
working-1.6when #1357 merges.Turns on
sync_version, so a PR intoworking-1.6arrives already carrying the version its merge commit will produce.Why the ruleset is load-bearing, not a nice-to-have
FOG_VERSIONis the commit count sincemaster, so predicting it before the merge is only sound whileworking-1.6enforces both:Squash collapses N commits into one and makes the count unrecoverable. Rebase adds no merge commit at all. Either setting being off silently makes every version written here wrong by one. That's why the requirement is spelled out at the call site in
tests.ymlrather than living only in this description.The workflow doesn't merely trust the setting: it re-checks at runtime that HEAD contains the tip of the base, and skips the version step rather than committing a number it can't stand behind if base moved in between.
Applying the ruleset
Full JSON body is in the fog-docs PR. Four things that will bite if skipped:
bypass_actorsfor the GitHub App is mandatory. Apull_requestrule blocks direct pushes, and both the daily sweep and the merge-time sync push directly with the App token. Without a bypass, every sweep run turns red the moment the ruleset activates.<caller job name> / <called job name>— e.g.fogproject / tests (PHP 7.4). A mistyped required check blocks every PR permanently while looking like a workflow that simply never ran.regeneratea required check — it's skipped on fork PRs and on any PR its guards exclude, which would leave those unmergeable.sync-generated-files.ymlis kept, not deletedIt stops being the mechanism and becomes the backstop, still covering what the prediction cannot: a squash or rebase that slipped past the ruleset, an admin bypass, a merged fork PR that never ran the PR-time job, and anything the
regenguards skipped.On a well-behaved same-repo PR it now finds nothing to do. That is the expected outcome, not a symptom — its header now says so, because a workflow that always no-ops otherwise reads as broken.
Before extending to
dev-branchdev-branch'stests.ymlhas noname: fogprojecton itssuitejob, so it currently reportssuite / …instead. Normalise that first, or half the required checks will never appear.Generated by Claude Code