fix: root-cause + cleanup for merge-beta/fix-beta sed-scope bug#169
Merged
Conversation
merge-beta.sh and fix-beta.sh perform a blanket sed flip of @v4 ↔ @v4-beta across action.yaml and .github/workflows/*.yaml. The intent is to keep self-references (milaboratory/github-ci/...) on the right ref for each branch. The sed pattern is too greedy: it also rewrites third-party action refs that happen to be pinned to @v4 — for example actions/checkout@v4 becomes actions/checkout@v4-beta, a tag that doesn't exist in the upstream repo. Symptom on v4-beta runs: Unable to resolve action `actions/checkout@v4-beta`, unable to find version `v4-beta` This blocks the `get run metadata` and `preflight (require-latest)` jobs in node-simple-pnpm.yaml and similar workflows, cascading skips into downstream jobs (`check for changesets`, `pre-build`, etc.). Caught while canary-testing PR #168 (changeset coverage check). This commit flips back, on v4-beta only, the 107 third-party refs that were incorrectly rewritten across 36 files. Affected action repos: actions/checkout (41 lines) aws-actions/configure-aws-credentials (24) actions/cache (13) actions/download-artifact (12) actions/upload-artifact (8, incl. one /merge subpath) actions/setup-java (3) actions/setup-node (2) pnpm/action-setup (1) azure/setup-kubectl (1) azure/setup-helm (1) milaboratory/github-ci/...@v4-beta self-refs are unchanged. Follow-up: the underlying sed scope in merge-beta.sh / fix-beta.sh should be tightened so this doesn't recur on the next promotion. Tracked separately.
The previous sed in merge-beta.sh and fix-beta.sh treated @v4 / @v4-beta as bare version tags. In practice they are git refs on a specific repo (milaboratory/github-ci), so the substitution must only fire when the preceding path is `milaboratory/github-ci/...`. Without that anchor the sed rewrites third-party action pins too (actions/checkout@v4, aws-actions/configure-aws-credentials@v4, pnpm/action-setup@v4, etc.), producing references like actions/checkout@v4-beta that do not exist upstream. The previous commit cleaned up the resulting corruption on v4-beta; this commit prevents recurrence. Both scripts now wrap the version pattern with a captured prefix: \(milaboratory/github-ci[^[:space:]@]*\)@v4... The character class excludes @ so the greedy match stops at the @ sign, leaving the version token to be matched and replaced. fix-beta.sh keeps its two-pattern form (end-of-line + whitespace boundary) to avoid the @v4 → @v4-beta-beta prefix collision; that guarantee is preserved. Verified with a fixture covering self-refs, third-party refs, mixed content, and the prefix-collision case. Both directions are idempotent. Also flips six lingering milaboratory/github-ci/.../@v4 self-refs in .github/workflows/node-simple-pnpm.yaml back to @v4-beta. These were left behind by a previous manual fixup attempt (5baba62 revert) and are exactly what the new fix-beta.sh sed produces when run against the current tree. Out of scope: actions/*/test-*.yaml files referenced by `act`-based unit tests. Those deliberately pin @v4 and are outside the find globs in both scripts.
dbolotin
approved these changes
May 28, 2026
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.
Why
merge-beta.shandfix-beta.shblanket-sed@v4↔@v4-betaacross all workflow / action files to keep self-refs aligned with the branch. The pattern is too broad and also rewrites third-party action refs that happen to be pinned at@v4(e.g.actions/checkout@v4→actions/checkout@v4-beta, a tag that doesn't exist upstream).Symptom on v4-beta runs:
This blocks
get run metadataandpreflight (require-latest)innode-simple-pnpm.yamland similar workflows, cascading skips intocheck for changesets,pre-build, etc. — meaning no v4-beta canary can fully exercise downstream jobs today.Caught while canary-testing #168 (the changeset coverage check) against platforma-open/antibody-sequence-liabilities#63.
What this PR does
Commit 1 — restore third-party action refs on v4-beta
Flips back, on
v4-betaonly, the 107 third-party refs across 36 files that were incorrectly rewritten. Affected action repos:actions/checkoutaws-actions/configure-aws-credentialsactions/cacheactions/download-artifactactions/upload-artifact(incl./merge)actions/setup-javaactions/setup-nodepnpm/action-setupazure/setup-kubectlazure/setup-helmVerified by diffing each flipped line against the same line on
v4— every changed line was@v4on the stable branch.milaboratory/github-ci/...@v4-betaself-refs are untouched.Commit 2 — anchor the sed in both scripts so this can't recur
Replaces the bare
@v4/@v4-betasubstitution patterns with a path-anchored form:The character class excludes
@so the greedy*stops at the@sign.fix-beta.shkeeps its two-pattern form (end-of-line and whitespace boundary) — necessary to avoid the original@v4⊂@v4-betaprefix collision — and just adds the path anchor inside each pattern.Also flips six lingering
milaboratory/github-ci/.../@v4self-refs innode-simple-pnpm.yamlback to@v4-beta. These were left behind by a previous manual fixup attempt (the 5baba62 revert) and are exactly what the newfix-beta.shsed produces when run against the current tree.Verification
Two definitive tests apply the new sed expressions (extracted verbatim from the scripts) to the actual
v4andv4-betatrees, then diff before/after:@v4-beta-betaartefactsfix-beta.sh(@v4 → @v4-beta)origin/v4merge-beta.sh(@v4-beta → @v4)HEAD(post-fix v4-beta)Every changed line is a
milaboratory/github-ci/...self-ref. Zero third-party refs are touched and no prefix-collision artefacts (@v4-beta-beta) are produced. Idempotency verified by re-running each sed on its own output.For comparison, applying the old sed expressions to the same trees corrupts third-party refs exactly as observed in production (
actions/checkout@v4→actions/checkout@v4-beta, etc.).Adversarial fixture — known theoretical edge cases
A fixture covering quoted refs, prefix-collision paths (
not-milaboratory/github-ci/...), SHA-pinned refs, and non-@v4versions confirms:@v4(e.g.actions/checkout@v4) — not touched@v5,@v6, full SHA) — not touchedmilaboratory/github-ci/blocks/notify/...@v4) — flipped correctly@v4that aren't refs (e.g.channel: x@v4) — not touchedTwo theoretical edge cases remain, neither exercised in the actual codebase (verified by
grepover all tracked.yaml/action.yaml):milaboratory/github-ci, so a token likenot-milaboratory/github-ci/foo@v4would also flip. Zero occurrences of any character precedingmilaboratory/github-ciexist in the repo today.fix-beta.sh's EOL/whitespace boundary doesn't cover"or', so a literal\"milaboratory/github-ci/foo@v4\"would not flip. Zero quoted action refs exist in the repo today. This limitation exists in the old scripts as well — not a regression.Both edge cases can be tightened later if a use-case appears (anchor at start-of-line / non-identifier char; broaden the boundary to non-ref characters). Not blocking.
Out of scope
actions/*/test-*.yaml(act-based unit-test fixtures) deliberately pin@v4and are outside the find globs in both scripts. Left as-is.Re-trigger pending canary
Once this PR merges into v4-beta, push an empty commit on platforma-open/antibody-sequence-liabilities#63 so its workflow re-resolves
@v4-betaagainst the fixed tree.Greptile Summary
This PR fixes a sed-scope bug in
fix-beta.shandmerge-beta.shwhere a too-broad substitution pattern rewrote third-party action refs (e.g.actions/checkout@v4→actions/checkout@v4-beta) in addition to the intendedmilaboratory/github-ciself-refs, causing workflow failures onv4-beta. The fix adds a path anchor\(milaboratory/github-ci[^[:space:]@]*\)so only self-refs are rewritten, and bulk-corrects the 36 files previously corrupted on this branch.fix-beta.sh/merge-beta.sh: Both substitution patterns now require the matched token to begin withmilaboratory/github-ci, preserving third-party action pins at their upstream tags.@v4-beta→@v4; six lingering milaboratory self-refs innode-simple-pnpm.yamlcorrected from@v4→@v4-beta.Confidence Score: 5/5
Safe to merge — the sed anchoring fix is correct, all 36 corrected files follow the expected pattern, and the PR includes thorough before/after verification.
The root-cause fix is well-scoped: the new milaboratory/github-ci[^[:space:]@]* anchor precisely targets self-refs without touching third-party pins, and the dual-pattern approach in fix-beta.sh correctly handles the @v4/@v4-beta prefix collision. The bulk file corrections are mechanically consistent with the fix. Known edge cases are documented and verified to have zero occurrences in the repo.
No files require special attention. fix-beta.sh and merge-beta.sh carry the logic change; all other files are straightforward bulk corrections.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["fix-beta.sh runs"] --> B["find action.yaml + .github/workflows/*.yaml"] B --> C["sed with path-anchored pattern"] C --> D{"milaboratory/github-ci...@v4?"} D -- Yes --> E["Rewrite to @v4-beta"] D -- No --> F["Leave unchanged"] H["merge-beta.sh runs"] --> I["find action.yaml + .github/workflows/*.yaml"] I --> J["sed with path-anchored pattern"] J --> K{"milaboratory/github-ci...@v4-beta?"} K -- Yes --> L["Rewrite to @v4"] K -- No --> M["Leave unchanged"]Reviews (1): Last reviewed commit: "fix: anchor merge-beta.sh / fix-beta.sh ..." | Re-trigger Greptile