Repository navigation
fix(#9714): deliver full shim template on GitHub ref upgrade - #9717
Conversation
On GitHub, convergeRefFiles queues a pin-only rewrite of the shim and thin callers. Those paths went into refFileSet, which content drift skips, so the template at the new ref (for example the pull_request trigger that replaced pull_request_target) was never queued. A second repos install then had to repair the drift. The dry run queues no ref files, so it reported a repair the live run dropped. On GitHub, collectConvergeScaffoldFiles now leaves pin-only ref paths out of the content-drift skip set, which matches the dry run. A drift repair for such a path replaces the queued pin-only file in place via supersedePinOnlyRefFiles. A shim repair rendered at the other workflow extension (.yml vs .yaml) replaces the shim at its installed path instead of adding a second shim. GitLab ref upgrades already rewrite templates wholesale and are unchanged. When drift supersedes a pin-only file, the pin form comes from the drift render (resolveTargetRef), the same form install and unchanged-ref drift repair already write. Note: pre-commit could not fetch remote hook repositories (TLS certificate verification failed). gofmt and go vet were run directly and passed. semgrep-scan was skipped (ruleset download blocked). Secret scan passed. Closes #9714 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/fs-fix-stop |
|
Fix agent disabled for this PR. Remove the |
|
🤖 Finished Review · Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.36 This review was superseded by a newer commit. Check the current pull request HEAD's review status before merging. |
…edes The content-drift template renders a semver target as "<sha> # tag", while the ref upgrade keeps a repository's own pinning style: a plain tag stays a plain tag and a branch stays a branch. When a drift repair supersedes a queued pin-only file, re-apply the pin the ref upgrade wrote, so delivering the full template in one pass does not also change the pin style. Add a test for plain-tag, SHA-with-tag and branch pins. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 9:05 PM UTC · Completed 9:11 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.30 |
|
Risk Assessment: moderate (2/5) DetailsModest 3-file bug fix by an established bot author with no protected or security-sensitive paths, balanced by high recent churn and coupling in convergence logic, with tight issue alignment yielding moderate risk. Previous runRisk Assessment: moderate (2/5) DetailsTargeted bug fix with no protected paths or dependency changes, but high recent churn and regression history in internal/repos/converge.go elevate risk to moderate. Previous run (2)Risk Assessment: moderate (2/5) DetailsSmall bug fix with 50% test file ratio and no protected paths, but high recent churn and regression history in internal/repos/converge.go elevate risk to moderate. Previous run (3)Risk Assessment: moderate (2/5) DetailsSmall bug fix with 50% test coverage and no protected paths, but high recent churn and regression history in internal/repos/converge.go elevate the risk to moderate. |
ReviewFindingsLow
Next steps:
Previous runReviewFindingsHigh
Earlier findings
Next steps:
Previous run (2)<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImludGVybmFsL3JlcG9zL2NvbnZlcmdlLmdvIiwiaWQiOiJmXzFhNzU5ZTU5YzFkMWRkMTkiLCJsaW5lIjo0MDIzLCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9LHsic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImludGVybmFsL3JlcG9zL2NvbnZlcmdlLmdvIiwiaWQiOiJmX2I1N2NlZGVmNDMxMDFiMTUiLCJsaW5lIjo0MDI2LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9XX0= --> ReviewFindingsMedium
Next steps:
Previous run (3)<!-- fullsend:review-diff-hash:b28ae1afc48ed0fce3a5b3f22984eb753abafdb71a231eb8aa30c54ea5b4df64 --> Looks good to me Labels: PR fixes repos install convergence logic in Go. Previous run (4)<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJhcHByb3ZlIiwiZmluZGluZ3MiOltdfQ== --> Looks good to me Labels: PR fixes repos install convergence logic in Go. |
…navailable convergeContentDriftFiles falls back to the running binary's embedded templates when the GitHub fetch at the pinned ref fails. Those templates can belong to another release, so they must not replace the pin-only shim and thin callers of a ref upgrade. convergeContentDriftFiles now reports whether its templates match the target ref; when they do not, the repairs for the ref-upgrade paths are dropped (with their actions, so the dry run says the same), the pin-only rewrite is delivered, and a progress note says to run install again. A live run drops only repairs for files actually queued as pin-only, so a shim withoutLegacyOpenAIConsumer left out still gets its repair. Guard withQueuedPin against a pattern without a capture group. Tests: the end-to-end test now serves the templates at the target ref and resolves the tag to a SHA, so it exercises the plain-tag pin path for real; new subtests cover the fetch failure in live and dry runs, plus unit tests for withQueuedPin's early returns and withoutRefPathRepairs. Assisted-by: Claude (fix, review), DeepSeek (review) Signed-off-by: Wayne Sun <gsun@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 9:16 PM UTC · Completed 9:23 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.29 |
Superseded by updated review
The fetch-failure guard skipped only queued pin-only paths in a live run, but the shim repair is always rendered at fullsend.yaml, so a shim installed at fullsend.yml slipped through and still got the embedded template; the dry run (which filtered by path) reported no repair. Both runs now drop the shim (either extension) and thin-caller repairs after a failed fetch during a GitHub ref upgrade. A legacy OpenAI shim waits for a run whose fetch succeeds instead of taking another release's template. Also: - report the drift repair count after the filter, so "Repairing N files" matches what is committed or previewed; - print the fallback note only when a repair was dropped; - treat a pinned render without fetched templates (no resolver) like a failed fetch; - docs: name the pin-only fallback in the required-upgrade section. Tests: .yml variants of the fetch-failure live and dry-run subtests, a pattern without a capture group, and the end-to-end live subtest now serves a template that differs from the embedded one and asserts it lands. Assisted-by: Claude (fix, review), DeepSeek (review), Gemini (docs review) Signed-off-by: Wayne Sun <gsun@redhat.com>
|
🤖 Review · ❌ Terminated · Started 9:39 PM UTC · Ended 9:47 PM UTC Commit: |
Site previewPreview: https://2d66c297-site.fullsend-ai.workers.dev Commit: |
|
🤖 Finished Review · ✅ Success · Started 9:39 PM UTC · Completed 9:47 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.52 |
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 10:23 PM UTC · Completed 10:33 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.40 |
waynesun09
left a comment
There was a problem hiding this comment.
Verified at efd7c56: one repos install now moves a v0.56.1 shim to pull_request and the new pin in one commit (live run on a test repo, repos status clean after merge, second dry run already current). Pin style is kept, and a failed template fetch falls back to the pin-only upgrade with a note. test fails only on TestWorkflowSHAUsesAreTrusted, which is main's breakage from #9206 and is being fixed separately; I'll enqueue once that lands.
Latest review summary lists only 2 LOWs; both were answered and resolved. No MEDIUM+ findings remain.
Summary
Fixes
repos installon GitHub so afullsend_refupgrade delivers the full new shim template in one run. Before, the first run changed only theuses:pins and left thepull_request_targettrigger in place. A second run was needed to repair it. The dry run also promised a content-drift repair that the live run dropped.Related Issue
#9714
Changes
internal/repos/converge.go:convergeRefFilesqueues a pin-only rewrite (replaceShimRef) of the shim and thin callers. Those paths went intorefFileSet, andconvergeContentDriftFilesskips every path in it. So the template at the new ref was never queued. On a dry runconvergeRefFilesreturns no files, so the skip set was empty and the repair was reported.collectConvergeScaffoldFiles: on GitHub, pin-only ref paths are now left out of the content-drift skip set. The live and dry runs now use the same skip set. Missing-component repair paths stay in the skip set.supersedePinOnlyRefFiles: a drift repair for a pin-only path replaces the queued file in place, so one commit carries both the new pin and the template change. If the shim repair uses the other workflow extension (.ymlvs.yaml), it replaces the shim at its installed path instead of adding a second shim. Other repairs are appended as before.withoutLegacyOpenAIConsumerthat said a pin-only rewrite excludes the shim from drift repair, which is no longer true.Pin style (takeover commit): when a drift repair supersedes a pin-only file, the pin the ref upgrade wrote is re-applied (
withQueuedPin). The drift template renders a semver target as<sha> # tag, while the ref upgrade keeps the repository's style: a plain tag stays a plain tag and a branch stays a branch, as the repo-management docs promise. The template uses the tag only in theuses:pin, so nothing else depends on it.Template fetch failure (takeover commits): content drift falls back to the running binary's embedded templates when the fetch at the pinned ref fails (or no resolver exists). Those can belong to another release, so during a GitHub ref upgrade they no longer replace the shim (either extension) or the thin callers: the pin-only rewrite is delivered, the repair count and actions say the same in dry and live runs, and a note says
template fetch at the target ref failed: delivering the pin upgrade only; run install again to deliver template changes. A legacy OpenAI shim also waits for a run whose fetch succeeds. The required-upgrade docs name this fallback.Behaviour note: on a ref upgrade, a locally edited thin caller (
prioritize.yml) is now reset to the template in the same commit. Before, the pin-only rewrite kept the edit until the next install, which reset it.Testing
TestConverge_RefUpgradeDeliversFullShimTemplate: a shim onpull_request_targetatv1.0.0withfullsend_ref: v2.0.0.pull_requesttrigger and thev2.0.0pin. No shim content drift remains.TestSupersedePinOnlyRefFiles: covers in-place replacement, the extension-mismatch case, and append behavior.TestConverge_RefUpgradeDeliversFullShimTemplatenow serves templates atv2.0.0that differ from the embedded ones and resolves the tag to a SHA, so the live subtest proves the target ref's template lands with the plain-tag pin kept. Fetch-failure subtests (live and dry run,.yamland.yml) cover the fallback.withQueuedPinearly returns (no pin, nil pattern, pattern without a group) andwithoutRefPathRepairs.TestSupersedePinOnlyRefFiles_KeepsPinStyle: plain-tag, SHA-with-tag and branch pins survive the supersede. Reverting to the raw drift content fails all three cases.go test ./internal/repos/... ./cmd/fullsend/...passes.gofmtandgo vet ./...are clean. The secret scan passed.pre-commitcould not fetch remote hook repositories in the sandbox (TLS verification failure). Instead,gofmtandgo vetwere run directly.semgrep-scanwas skipped because its ruleset download was blocked.Live validation
On public scratch repo
nonflux/tmp-v057-upgrade-manifest: the shim was reset to the v0.56.1 install (pull_request_target, pinned27c1d6ce… # v0.56.1). Then, with a binary built from this branch,repos set github.fullsend_ref f24e7d3bb…(main with #9230;v0.57.0is not tagged yet) followed by onerepos install:PR #3 changes
pull_request_target:→pull_request:and bothuses:pins tof24e7d3bb…in one commit. After merging it:A second
repos install --dry-runreports1 already current. The same steps were re-run with a binary built at c4310b2 (PR #4 on the same repo) with the same result. Before this fix the same steps needed a second install for the trigger (the repro in #9714).Out of scope: the
repos statuswarning for an installedpull_request_targetshim mentioned under "Related" in the issue. Triage suggested it as a separate follow-up.🤖 Generated with Claude Code
Closes #9714
Post-script verification
agent/9714-full-shim-on-ref-upgrade)f24e7d3bb03c44371e58653f0fd051ed9c445b0f..HEAD)