Skip to content

fix: preserve workflows and report update merge failures - #76975

Merged
pelikhan merged 3 commits into
mainfrom
pelikhan/update-command-fixes
Nov 11, 2026
Merged

pelikhan merged 3 commits into
mainfrom
pelikhan/update-command-fixes

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Running the locally built update command exposed merge conflicts that were reported as successfully updated and compiled, with a zero exit status and conflict markers written into workflow sources.

Changes

  • Preserve existing workflow sources and locks when merges conflict during normal updates. With --no-compile, retain conflict markers for manual resolution but report failure.
  • Return a nonzero exit status for partial workflow failures and include manifest-managed conflicts in the failure summary. Any non-rate-limit source update failure stops subsequent dependency/pin updates and recompilation and prevents PR creation. Successful source updates are retained; rate-limit-only failures remain exempt.
  • Treat a missing workflow scan directory as empty, while failing closed on unreadable entries or broken symlinks inside an existing directory.
  • Keep package-wide ownership unchanged when any package workflow conflicts, rather than recording conflicted content as successfully installed. Clean sibling workflows may still update.
  • Normalize CRLF release output and surface package rollback errors.
  • Apply conflict-free workflow dependency updates and regenerate their locks. Four upstream-conflicted workflows remain unchanged. The update intentionally pruned the unreferenced ghcr.io/github/gh-aw-mcpg:v0.5.4 container pin and synchronized both embedded pin files.

Validation

  • Built and exercised the local CLI; confirmed conflicts return exit status 1 without modifying the four affected workflows.
  • Added command-level conflict preservation, partial-failure/rate-limit, mixed manifest-group, missing-directory, and broken-entry regression coverage.
  • Recompiled all 365 workflows and confirmed no workflow drift in the original update pass.

ADR: ADR-76975: Preserve Workflows and Fail on Update Conflicts. Status is Proposed; maintainer acceptance and deciders remain to be recorded.

Apply conflict-free workflow dependency updates using the locally built CLI. Preserve existing sources on merge conflicts, propagate partial failures, respect the default conflict-scan directory, normalize release output, and report package rollback errors.

Co-authored-by: Copilot App <[email protected]>
@pelikhan
pelikhan marked this pull request as ready for review November 11, 2026 21:58
Copilot AI adaptive review requested due to automatic review settings November 11, 2026 21:58
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

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.

Generated from Test Quality Sentinel · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 7.2K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_no_action

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.

Generated from PR Specification Reviewer · gpt56 · ~2 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 1.6K · ◷

Generated by PR Specification Reviewer for #76975

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

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.

Generated from Ponytail Reviewer · routed: gpt61 medium · ~4 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 181 · ◷

Generated by Ponytail Reviewer for #76975

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changed update-path logic and tests. I found no actionable correctness, regression, or maintainability issues in the changed lines. The specialist pass was unavailable because its diff read was blocked, so this assessment is based on my independent static review of the pre-fetched diff and relevant source context.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (more than 100 new lines in pkg/) but does not have a linked Architecture Decision Record (ADR).

📄 Draft ADR committed: docs/adr/76975-preserve-workflows-and-fail-on-update-conflicts.md. Review and complete it before merging.

🔒 This PR cannot merge until an ADR is linked in the PR body.

📋 What to do next
  1. Review the draft ADR generated from the PR diff. Its status is Draft.

  2. Resolve the open [TODO: verify] items: the deciders list, and whether the alternatives in the ADR were actually considered.

  3. Finalize the ADR on this branch and change its status once the team accepts it.

  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-76975: Preserve Workflows and Fail on Update Conflicts (link unavailable: invalid HTTPS URL)

Once an ADR is linked in the PR body, this gate will re-run and verify that the implementation matches the decision.

🧭 Decision captured in the draft
  • Decision: merge conflicts and non-rate-limit update failures are errors. In default mode, the conflicted workflow and its lock file are left unchanged and the command exits nonzero. With --no-compile, conflict markers are still written, but the command also fails.
  • Main trade-off: gh aw update now exits nonzero in cases that previously exited 0, which can break scripts that assume success.
  • Evidence: pkg/cli/update_workflows.go (conflict error returned before the write in compile mode, and partial failures now fail the run), pkg/cli/update_manifest.go (conflicts recorded as failures), pkg/cli/update_command.go (scan errors surfaced), and docs/src/content/docs/setup/cli.md (documented semantics).
📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered complete: Context, Decision, Alternatives Considered, and Consequences. ADRs live in docs/adr/ and are named by PR number.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · routed: haiku55 xhigh · ~3 AIC · ⌖ ~2 AIC · ⊞ 8.5K · ◷
Comment /review to run again

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Later update phases can overwrite conflicted workflows and their locks despite reporting them unchanged, while an absent default workflow directory can incorrectly cause otherwise valid updates to fail.

2 open issues
What changed in this PR

This PR strengthens gh aw update conflict handling and failure reporting, aiming to preserve existing workflows during failed merges while allowing manual resolution with --no-compile.

Changes:

  • Report partial update failures, including manifest-managed conflicts, while retaining the rate-limit-only exception.
  • Improve conflict scanning, rollback diagnostics, and CRLF release parsing, with regression tests and documentation.
  • Refresh workflow dependencies and generated locks, and remove an older container pin.
File Description
pkg/​workflow/​data/​action_pins.json Remove the MCP gateway v0.5.4 pin.
pkg/​cli/​update_workflows.go Report update failures, guard conflicted writes, and normalize release output.
pkg/​cli/​update_workflows_test.go Test CRLF release parsing.
pkg/​cli/​update_manifest.go Count conflicts as failures and warn on rollback errors.
pkg/​cli/​update_manifest_test.go Test conflict reporting and rollback diagnostics.
pkg/​cli/​update_command.go Surface conflict-scan errors.
pkg/​cli/​update_command_test.go Test conflict failures and source/lock preservation.
pkg/​cli/​update_actions_workflow_files.go Resolve the default scan directory and propagate read errors.
pkg/​cli/​update_actions_workflow_files_test.go Test default-directory scanning and read failures.
pkg/​actionpins/​data/​action_pins.json Synchronize removal of the older gateway pin.
docs/​src/​content/​docs/​setup/​cli.md Document conflict handling and exit status behavior.
.github/​workflows/​ponytail-reviewer.md Update the review skill revision.
.github/​workflows/​ponytail-reviewer.lock.yml Regenerate skill references and workflow hashes.
.github/​workflows/​mattpocock-skills-reviewer.md Update five review skill revisions.
.github/​workflows/​mattpocock-skills-reviewer.lock.yml Regenerate skill references and workflow hashes.
.github/​workflows/​daily-team-status.md Record the upstream source commit.
.github/​workflows/​daily-team-status.lock.yml Refresh hashes for the source metadata change.
.github/​workflows/​daily-safeoutputs-git-simulator.md Update action references to specific release versions.
.github/​workflows/​daily-safeoutputs-git-simulator.lock.yml Refresh hashes for the action reference changes.
.github/​aw/​actions-lock.json Remove the older gateway container pin.

Review effort: Balanced (auto)

Comment thread pkg/cli/update_workflows.go Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /diagnosing-bugs, /tdd, /codebase-design, and /grill-with-docs. Requesting changes on two behavior changes that are not yet covered by tests or stated in the PR description.

📋 Key Themes & Highlights

Key Themes

  • Partial failure now blocks the PR step: any non-rate-limit failure returns from RunUpdateWorkflows before PR creation (update_workflows.go L213, update_command.go L338).
  • Manifest --no-compile conflicts skip group sync: the conflict sentinel now takes the skippedConflict early return (update_manifest.go L245).
  • Scan is now fail-closed: unreadable workflow files abort container-pin updates (update_actions_workflow_files.go L177).
  • Undocumented pin removal: ghcr.io/github/gh-aw-mcpg:v0.5.4 is removed from action_pins.json (both copies) and .github/aw/actions-lock.json. The PR description does not mention it. Please confirm it is intentional.

Positive Highlights

  • ✅ Rollback now reports failures instead of ignoring them (update_manifest.go L441), with TestRollbackPackageAssetsReportsFailuresAndContinues.
  • ✅ CRLF fix via strings.Fields in resolveLatestReleaseWithResult (update_workflows.go L676), with TestResolveLatestRelease_CRLFOutput.
  • ✅ Conflict regression test TestUpdateWorkflows_MergeConflictsFail, plus a default-directory test for the scan.
  • ✅ docs/src/content/docs/setup/cli.md now states the nonzero-exit contract for conflicts and failures.

Open Questions

  • Is blocking the PR on any partial failure intended? If so, say so in the PR description and docs.
  • The rate-limit exemption in the new fatal branch has no direct test.
  • I did not run go test or lint. Findings come from static reading of the committed diff at ceb8049.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~9 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again

Comment thread pkg/cli/update_workflows.go Resolved
Comment thread pkg/cli/update_manifest.go Resolved
Preserve conflicted sources through the entire update command, treat absent scan roots as empty, and cover partial failure and package ownership contracts. Clarify fail-closed behavior and the proposed ADR.

Co-authored-by: Copilot App <[email protected]>
@pelikhan

Copy link
Copy Markdown
Collaborator Author

In response to this comment:

No code change for this review-progress notification. The completed review's actionable comments were evaluated individually, with fixes, contract coverage, and a documented rationale where a suggestion was declined.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

In response to this comment:

No change requested by this no-action report. Added focused regression coverage for the actionable conflict-preservation and scan-directory findings from the other reviews.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

In response to this comment:

No change requested by this no-action report. The CLI docs and linked proposed ADR now explicitly describe failure handling and the PR-creation contract.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

In response to this comment:

No code change for this no-action report. Addressed the actionable update-phase safety and missing-directory findings raised by the other reviewers.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

In response to this comment:

Reviewed and revised the generated ADR, removing unverified deciders and claims of prior alternatives discussions. It remains Proposed pending maintainer acceptance and is linked in the PR body.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

In response to this comment:

No change requested by this completion report. The batch addresses the actionable correctness feedback from the other reviews and adds focused regression coverage.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

In response to this comment:

Partially accepted: completed the factual ADR corrections, documented the later-phase safety requirement, and linked the ADR in the PR body. Its status remains Proposed because maintainer acceptance and deciders have not been established; the document does not claim team approval.

@pelikhan
pelikhan merged commit 052471a into main Nov 11, 2026
96 checks passed
@pelikhan
pelikhan deleted the pelikhan/update-command-fixes branch November 11, 2026 23:39
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants