Repository navigation
[avenger] Fix update handling of conflicted workflows - #74552
Conversation
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ 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.
|
|
✅ 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.
|
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: 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.
|
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.
Found one medium-severity correctness issue: conflict detection can falsely classify valid Markdown examples as unresolved merge conflicts and silently skip all workflow updates.
Highlights
- Require a complete conflict block or ignore fenced code examples.
- Add a negative regression test for legitimate marker text.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
| func containsMergeConflictMarkers(content string) bool { | ||
| for _, line := range strings.Split(content, "\n") { | ||
| trimmed := strings.TrimSpace(line) | ||
| if strings.HasPrefix(trimmed, "<<<<<<<") || |
There was a problem hiding this comment.
The bare prefix check treats legitimate Markdown content (including fenced examples or blockquote/table syntax) beginning with <<<<<<<, |||||||, or >>>>>>> as an unresolved merge, causing the command to skip every workflow update in the directory.
💡 Detect an actual conflict block
Require a complete conflict shape (<<<<<<< followed by ======= and >>>>>>>) and/or ignore fenced code blocks before aborting the whole update. Add a negative test for a fenced conflict-marker example so valid workflow documentation does not silently suppress updates.
There was a problem hiding this comment.
🟡 Changes recommended
The conflict guard only skips the helper, leaving container-pin updates and recompilation able to modify actions-lock.json and then fail on conflicted Markdown.
1 open issue
What changed in this PR
This PR adds a merge-conflict precheck to the workflow reference-update phase of gh aw update, preventing updates when workflow Markdown contains unresolved conflict markers.
Changes:
- Scan workflow Markdown before updating action, skill, and plugin references.
- Skip reference updates when conflict markers are found, with a warning in verbose mode.
- Add a regression test confirming conflicted workflow content remains unchanged.
| File | Description |
|---|---|
pkg/cli/update_actions_workflow_files.go |
Adds conflict-marker detection and an early return before reference updates. |
pkg/cli/update_actions_workflow_files_test.go |
Tests that a conflicted workflow remains unchanged. |
Review effort: Balanced (auto)
| if opts.verbose { | ||
| fmt.Fprintln(os.Stderr, console.FormatWarningMessage(message)) | ||
| } | ||
| return nil |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs, /codebase-design, and /tdd. Requesting changes because the fix may not cover the failure path it targets.
📋 Key Themes & Highlights
Key Themes
- Incomplete guard (unverified): The check runs only in the action-ref phase.
RunUpdateWorkflowslater callsrecompileAllWorkflowswith a nil file list when new container pins are added. From reading the code, that appears to compile the whole directory, including the conflicted file. I have not run that path end to end. - Silent skip: The skip message prints only with
--verbose, and the command exits 0. - Matching is too loose:
TrimSpacelets indented marker lines match. - Test coverage: One happy-path test. The directory-wide skip, non-
.mdfiles, and line-level matching are untested.
Positive Highlights
- ✅ The regression test fails when the guard is removed. I checked this by temporarily disabling the guard.
- ✅ The new code is gofmt-clean, and the targeted
TestUpdateActionsInWorkflowFilestests pass. - ✅ The conflict scan runs before any writes, so partial updates are avoided.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~4 AIC · ⌖ ~1 AIC · ⊞ 5.4K
Comment /matt to run again
| // Per-invocation cooldown cache: key = "repo@tag", avoids redundant date API calls | ||
| coolDownCache := make(map[string]coolDownCheckResult) | ||
|
|
||
| if conflictedWorkflow, err := findWorkflowWithMergeConflictMarkers(opts.workflowsDir); err != nil { |
There was a problem hiding this comment.
[/diagnosing-bugs] The guard covers only the action-ref phase, so a conflicted workflow can still break the update. RunUpdateWorkflows later calls recompileAllWorkflows with a nil file list when new container pins are added. That appears to compile every workflow in the directory, so the conflicted .md would hit the same parse failure this PR is meant to prevent.
💡 Suggested fix
Check for conflict markers once in RunUpdateWorkflows and skip or fail the container-pin recompile with a clear message that names the file. Add a test that covers the container-pin path with a conflicted workflow present. I have not run this path end to end, so confirm the compile behavior first.
@copilot please address this.
| message := fmt.Sprintf("Skipping action, skill, and plugin updates because merge conflict markers are present in %s", conflictedWorkflow) | ||
| updateLog.Print(message) | ||
| if opts.verbose { | ||
| fmt.Fprintln(os.Stderr, console.FormatWarningMessage(message)) |
There was a problem hiding this comment.
[/diagnosing-bugs] The skip message only prints with --verbose, and the command still exits successfully. A user with a conflicted file gets no signal that action, skill, and plugin refs were not updated.
💡 Suggested fix
Print this warning to stderr without the verbose check. It is the one state where the user must act, so it should not depend on a flag.
@copilot please address this.
|
|
||
| func containsMergeConflictMarkers(content string) bool { | ||
| for _, line := range strings.Split(content, "\n") { | ||
| trimmed := strings.TrimSpace(line) |
There was a problem hiding this comment.
[/codebase-design] TrimSpace widens matching to any indented line, so an indented marker in docs would block every update. Git writes conflict markers at column 0, so match on the raw line.
💡 Suggested change
Use strings.HasPrefix(line, marker) without trimming. Add a table-driven test for containsMergeConflictMarkers that includes an indented marker and a bare ======= Markdown underline, which must not match.
@copilot please address this.
| } | ||
| } | ||
|
|
||
| func TestUpdateActionsInWorkflowFiles_SkipsMergeConflicts(t *testing.T) { |
There was a problem hiding this comment.
[/tdd] The test covers one happy path. Add cases that pin down what the guard depends on:
- A clean sibling workflow in the same directory stays unmodified. The skip is directory-wide, which the PR intends, so the test should say so.
- A conflict marker in a non-
.mdfile is ignored. - An indented marker or a bare
=======line does not trigger the skip.
💡 Suggested structure
Use a table-driven test for containsMergeConflictMarkers for the line-level cases, and keep this integration test for the directory-wide skip.
@copilot please address this.
|
Commit pushed:
|
PR finisher summarySubmitted for publication (not confirmed pushed): the conflict-marker guard now also skips container-pin updates and recompilation in Validation: PR finisher dispatch requested for the following outstanding work (see dispatch). Sous-chef head: e0dbd05
|
|
Note The pull request was not created — a fallback review issue was created instead due to protected file changes: #74568 PR finisher
PR finisher dispatch requested for the following outstanding work (summary above). Sous-chef head: 24f898a
|
|
Note The pull request was not created — a fallback review issue was created instead due to protected file changes: #74572 PR finisher: merged Sous-chef head: 24f898a
|
|
Note The pull request was not created — a fallback review issue was created instead due to protected file changes: #74581 PR finisher pass: merged PR finisher dispatch requested for the following outstanding work:
Sous-chef head: 24f898a
|
|
🎉 This pull request is included in a new release. Release: |

Summary
gh aw updatefrom running action, skill, and plugin reference updates when unresolved workflow merge markers are present.CI failure
The
updatejob failed during its dry-run compile because a source-managed workflow had unresolved merge markers. The subsequent action-reference compilation traversed dependent workflows and failed while parsing that conflicted worker. The update phase now detects this state and exits without applying partial updates or compiling unresolved content.Validation
make fmtgo test ./pkg/cli -run Test(MergeWorkflowContent|UpdateActionsInWorkflowFiles) -count=1git diff --check