Repository navigation
Preserve workflow source refs so updates follow releases - #74948
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
This comment has been minimized.
This comment has been minimized.
|
✅ PR Code Quality Reviewer completed the code quality review.
|
🏗️ Design Decision Gate — ADR RequiredThis PR adds a lot of new code to core business logic (108 new lines under 📄 Draft ADR committed: Decision found in the diff:
📋 What to do next
Once the PR body links an ADR, this gate will run again and check that the code matches the decision. ❓ Why ADRs MatterADRs give the codebase a searchable, permanent record of why it looks the way it does. This change redefines what 📋 Michael Nygard ADR Format ReferenceAn ADR needs four sections: Context, Decision, Alternatives Considered, and Consequences. ADRs live in
|
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Review verdict
Request changes: dependency installation can become internally inconsistent when the requested branch or tag moves during the add operation.
Highlights
- Pin dependency fetching to the resolved commit, matching the existing trial-install path.
- Preserve the requested ref only for the installed
source:field.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~5 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
| return fetchAllRemoteDependencies(ctx, string(sourceContent), workflowSpec, githubWorkflowsDir, opts.Verbose, opts.Force, tracker) | ||
| // Dependency fetching may fill in a default ref; preserve the requested source ref. | ||
| dependencySpec := *workflowSpec | ||
| return fetchAllRemoteDependencies(ctx, string(sourceContent), &dependencySpec, githubWorkflowsDir, opts.Verbose, opts.Force, tracker) |
There was a problem hiding this comment.
Dependency fetching still uses the mutable requested ref instead of the exact commit that was fetched for the workflow, so includes/imports/dispatch workflows can come from a different revision than the installed workflow.
💡 Pin dependency resolution to the fetched commit
The trial path already copies the spec and sets Version to fetched.CommitSHA. This add path should do the same when sourceInfo.CommitSHA is available, while leaving the original spec unchanged for writing the requested source: ref. Otherwise a moving branch or retagged release can change between the main fetch and dependency fetch, producing an inconsistent install. Add a regression test that asserts the dependency fetch receives the resolved SHA.
There was a problem hiding this comment.
Fixed in 2d50115. Dependency fetching now pins the copied specification to the fetched workflow’s commit SHA while retaining the requested source ref. Regression coverage verifies direct and transitive imports use that SHA.
There was a problem hiding this comment.
🟡 Changes recommended
Mutable refs break merge-base tracking and can bypass release cooldowns, causing silently stale updates or premature installation of potentially compromised executable content.
2 open issues
What changed in this PR
This PR addresses #73077 by preserving requested workflow source refs, allowing release-based installs to track compatible releases rather than the default branch.
Changes:
- Preserve explicit tags, branches, and SHAs; use the resolved SHA only when no ref was supplied.
- Isolate dependency-fetching mutations from the original workflow specification.
- Add regression coverage for source frontmatter and same-major release resolution.
| File | Description |
|---|---|
pkg/cli/update_workflows_test.go |
Tests compatible release selection from an installed release source. |
pkg/cli/spec.go |
Preserves requested refs in workflow and manifest sources. |
pkg/cli/spec_manifest_source_test.go |
Covers manifest source formatting across ref types. |
pkg/cli/add_workflow_content.go |
Copies the specification before dependency fetching. |
pkg/cli/add_command_test.go |
Verifies installed source fields preserve explicit refs. |
Review effort: Balanced (auto)
| ref := workflow.Version | ||
| if ref == "" { | ||
| ref = commitSHA |
There was a problem hiding this comment.
Fixed in 2d50115. Release resolution propagates CoolDownBlocked, so manifest synchronization stops before downloads or resource writes when every eligible upgrade is cooling down, including with --force. Added blocked-major-tag and eligible-fallback regressions.
| ref := workflow.Version | ||
| if ref == "" { | ||
| ref = commitSHA |
There was a problem hiding this comment.
Fixed in 2d50115. source retains the tracking ref; source-sha records the installed commit for immutable three-way merge bases. Direct and manifest install → branch advance → default update regressions cover local edits, advancing metadata, and repeat updates. Missing recorded manifest bases now fail without overwriting local edits.
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd. The changed source-ref logic preserves explicit release, branch, and SHA refs, isolates dependency default-ref mutation, and the targeted regression tests pass. I found no actionable correctness issues in the changed lines.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: gpt56 max · ~22 AIC · ⌖ ~1 AIC · ⊞ 5.4K
Comment /matt to run again
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: 627d3c7
|
|
@copilot run pr-finisher skill |
…ords-source-commit-sha Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Ran pr-finisher and pushed 2d50115, including a clean merge of main and fixes for all three review threads. Standard lint, focused/impacted tests, workflow drift checks, and secret scanning passed. Existing custom-linter findings remain; CodeQL timed out. Thread replies are posted, but resolving threads requires a maintainer because authenticated thread-mutation tooling is unavailable. CI on the new head remains unverified; no CI was triggered and the PR was not merged. |
…forks flag Document safe-output output_id/depends-on dependency gating (#74376), the managed source-sha frontmatter field (#74948), the dangerously-allow-pull-request-target-forks-all feature flag (#74884), and detection report-as-issue permission requirements (#74949). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🎉 This pull request is included in a new release. Release: |

gh aw add ...@v1.2.0replaced the requested tag with a commit SHA insource:, causing subsequent updates to track the default branch instead of compatible releases.