Repository navigation
Regenerate translations and PSR2 on the PR; leave the merge sync the version - #1357
Merged
Merged
Conversation
…version tests.yml gains a `regen` job that calls fog-workflows' fogproject-pr-regen.yml once the suite has gone green, which formats the PHP files this PR touches and refreshes the gettext catalogue, then pushes one commit to the PR head. `needs: suite` is the whole gate: a caller job that uses: a reusable workflow succeeds only if every job inside it did. The logic stays in fog-workflows; what lives here is the policy of which PRs are eligible, alongside the identical allowlist sync-generated-files.yml already keeps. Same-repo only, because pull_request withholds secrets from a fork and a fork head is not ours to push to -- those keep being picked up by the daily sweep after they merge. working-1.6 only for now; dev-branch follows once this is proven there. The head denylist is not decoration. Workflows for a pull_request are read from the merge of head into base, so a PR whose HEAD is a long-lived branch runs this file too -- and stable-releases.yml opens exactly one of those (stable -> dev-branch) to sync a release back. It is unreachable while the base allowlist names only working-1.6, and it is there so that stays true when the allowlist grows rather than being discovered by pushing commits onto stable. sync-generated-files.yml now asks for version_only. By the time a same-repo PR merges its formatting and catalogue are already correct, so redoing them costs a fog-plugins download and a full gettext regeneration for a guaranteed no-op. The version cannot move to PR time this way -- it is derived from the commit count since master, and the merge commit itself changes that count -- so correcting it stays a post-merge job. Needs FOGProject/fog-workflows to land fogproject-pr-regen.yml first; the uses: line points at @main. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014S5HrfuMMH1jyftmZ3kJoM
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 1 of 2. Formatting and the translation catalogue are corrected on the pull request, before review, instead of by a bot commit landing on
working-1.6afterwards. Part 2 (claude/psr-lang-pr-tests-2a3kv7-version-sync) moves the version too.working-1.6only for now —dev-branchfollows once this is proven here, and it is a one-line change to the base-ref guard.masterandstableare untouched.What changes
.github/workflows/tests.ymlgains aregenjob calling fog-workflows'fogproject-pr-regen.yml.needs: suiteis the whole gate: a caller job thatuses:a reusable workflow succeeds only if every job inside it did, so that already means "all current tests passed".The logic stays in fog-workflows; what lives here is the policy of which PRs are eligible — branch-local information, and exactly where
sync-generated-files.ymlalready keeps the identical allowlist..github/workflows/sync-generated-files.ymlpassesversion_only: true. By the time a same-repo PR merges its formatting and catalogue are already right, so redoing them costs afog-pluginsdownload and a full gettext regeneration for a guaranteed no-op.The version can't move to PR time this way — it's the commit count since
master, and the merge commit itself changes that count — so correcting it stays a post-merge job here. Part 2 handles it.Two guards worth reviewing closely
Same-repo.
pull_requestwithholds secrets from a fork, so there's no App token to mint; the App isn't installed on the contributor's account anyway; and pushing to a fork head needsmaintainer_can_modify, which is theirs to set. Fork PRs keep being picked up by the daily sweep after merge, exactly as today. Same guard, same reason, as the one already insync-generated-files.yml.Head denylist — not decoration. Workflows for a
pull_requestare read from the merge of head into base, so a PR whose head is a long-lived branch runs this file too.stable-releases.ymlopens exactly one of those (stable→dev-branch) to sync a release back. It's unreachable while the base allowlist names onlyworking-1.6; it's there so that stays true when the allowlist grows, rather than being discovered by pushing commits ontostable.The loop question
The
regenjob pushes, and that push raisessynchronize, so this file runs again. Bounded, not open-ended: both operations are idempotent, so the second run finds nothing and pushes nothing — one extra run and one bot commit per contributor push. The full argument, plus the runtime assertion and the hard bot-commit bound that hold even if that argument stops being true, are in the fog-workflows PR and in that workflow's header. The header here is updated too, since the old text said this file only reads.What to expect after merging
A PR that needed no corrections sees
regenrun and do nothing. A PR that did gets one bot commit and one extra suite run. The merge-time sync then reports only a version change, or no change at all.