Skip to content

[avenger] Fix update handling of conflicted workflows - #74552

Merged
pelikhan merged 2 commits into
mainfrom
avenger/skip-conflicted-workflow-update-6889002d9988e513
Nov 3, 2026
Merged

pelikhan merged 2 commits into
mainfrom
avenger/skip-conflicted-workflow-update-6889002d9988e513

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Prevent gh aw update from running action, skill, and plugin reference updates when unresolved workflow merge markers are present.
  • Add a regression test confirming conflicted workflow files remain unchanged.

CI failure

The update job 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 fmt
  • go test ./pkg/cli -run Test(MergeWorkflowContent|UpdateActionsInWorkflowFiles) -count=1
  • git diff --check

Generated by 🦸 Avenger · copilot · routed: gpt56 max · ~12 AIC · ⌖ ~2 AIC · ⊞ 3.9K · ◷

  • expires on Nov 5, 2026, 7:44 AM UTC-08:00

@pelikhan
pelikhan marked this pull request as ready for review November 3, 2026 15:50
Copilot AI adaptive review requested due to automatic review settings November 3, 2026 15:50
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

🧠 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 3, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ 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 · sonnet50 · ~16 AIC · ⌖ ~21 AIC · ⊞ 12.9K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ 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: gpt56 max · ~2 AIC · ⌖ ~1 AIC · ⊞ 118 · ◷

Generated by Ponytail Reviewer for #74552

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

⚠️ PR Code Quality Reviewer failed to deliver outputs during code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ 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: 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 Design Decision Gate 🏗️ · routed: gpt56 max · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-03T15:54:47Z
review_event: COMMENT
top_themes: [false-positive merge-marker detection]
files_reviewed: [pkg/cli/update_actions_workflow_files.go, pkg/cli/update_actions_workflow_files_test.go]
comment_count: 1

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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, "<<<<<<<") ||

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

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

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

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, /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. RunUpdateWorkflows later calls recompileAllWorkflows with 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: TrimSpace lets indented marker lines match.
  • Test coverage: One happy-path test. The directory-wide skip, non-.md files, 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 TestUpdateActionsInWorkflowFiles tests 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 {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[/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))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[/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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[/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) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[/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-.md file 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.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Commit pushed: 24f898a

Generated by PR Finisher · copilot · auto · ~31 AIC · ⌖ ~1 AIC · ⊞ 10.7K

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

PR finisher summary

Submitted for publication (not confirmed pushed): the conflict-marker guard now also skips container-pin updates and recompilation in RunUpdateWorkflows, and updateActionsInWorkflowFiles was split into a helper to satisfy the custom function-length linter.

Validation: go test ./pkg/cli -run Update|Conflict passes; make agent-report-progress custom linters and impacted tests pass, but golangci-lint isn't installed here, so the lint-go-golangci and safe_outputs failures were not verified locally. The make merge-main step failed (fetch of a promisor object needs network credentials), so the branch was not updated with main. Review reply and resolution are deferred until the fix is published. CI needs a maintainer re-trigger.

PR finisher dispatch requested for the following outstanding work (see dispatch).

Sous-chef head: e0dbd05
Sous-chef work: 20c5fb9e2e37672daf5b7271dae9c95ff59f03cf41d0cde5ac7e2acc9456d2d1 3e5724674b07756317a9f9ef86f8750bd15ba3f901dc0f5ebc3a2ff84f015b1f 42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac c7cf93e497befdd5e698d00101b0703e4101fe4133d86d433f7c170d07402b7e
Sous-chef state: 650f8dbe91925cfd9e8e49f3387464c1e8d2e01bcf8ff188970be452966a59b1

Generated by 🏁 PR Finisher · copilot · auto · ~31 AIC · ⌖ ~1 AIC · ⊞ 10.7K · ◷

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Note

The pull request was not created — a fallback review issue was created instead due to protected file changes: #74568

PR finisher

  • Merged origin/main into the branch (no conflicts); submitted for publication, not confirmed pushed.
  • Review #4457223480 (container pins/recompile with conflicts): the guard is already in the PR head at update_command.go:293, so those stages are skipped. Reply/resolve is deferred until the merge is published.
  • Local validation: targeted pkg/cli tests pass; make agent-report-progress impacted tests, custom linters and schema check pass. golangci-lint is not installed here, so Go lint did not run.
  • Remaining: CI needs a maintainer re-trigger after publication.

PR finisher dispatch requested for the following outstanding work (summary above).

Sous-chef head: 24f898a
Sous-chef work: 3e5724674b07756317a9f9ef86f8750bd15ba3f901dc0f5ebc3a2ff84f015b1f
Sous-chef state: 5faa0971e6f9b92789cdc3799a4d2eb79f864ea66166381fe07df96ad9a26f45

Generated by 🏁 PR Finisher · copilot · auto · ~24 AIC · ⌖ ~2 AIC · ⊞ 10.7K · ◷

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Note

The pull request was not created — a fallback review issue was created instead due to protected file changes: #74572

PR finisher: merged origin/main locally (clean, no conflicts); build and targeted pkg/cli tests pass. Submitted for publication (staged, not confirmed pushed). The review thread on update_actions_workflow_files.go is already addressed in the head: update_command.go has its own conflict-marker guard that skips container-pin updates and recompilation. Reply/resolve deferred until the merge publishes. CI is stale after the push and needs a maintainer re-trigger.

Sous-chef head: 24f898a
Sous-chef work: 3e5724674b07756317a9f9ef86f8750bd15ba3f901dc0f5ebc3a2ff84f015b1f
Sous-chef state: 5faa0971e6f9b92789cdc3799a4d2eb79f864ea66166381fe07df96ad9a26f45

Generated by 🏁 PR Finisher · copilot · auto · ~19 AIC · ⌖ ~2 AIC · ⊞ 10.7K · ◷

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Note

The pull request was not created — a fallback review issue was created instead due to protected file changes: #74581

PR finisher pass: merged main into the branch (merge commit submitted for publication, not yet confirmed pushed). The container-pin/recompile guard for conflicted workflows (review at update_actions_workflow_files.go:110) is already in the PR head (update_command.go); review reply/resolution is deferred to a later pass pending publication. Local validation: go test ./pkg/cli -run Update passed; make agent-report-progress impacted tests and custom linters passed, but golangci-lint is not installed locally so Go lint did not run. CI is stale after the push and needs a maintainer re-trigger.

PR finisher dispatch requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (pkg/cli/update_actions_workflow_files.go:110): Returning nil only skips this helper (container pins/recompile).

Sous-chef head: 24f898a
Sous-chef work: 3e5724674b07756317a9f9ef86f8750bd15ba3f901dc0f5ebc3a2ff84f015b1f
Sous-chef state: 5faa0971e6f9b92789cdc3799a4d2eb79f864ea66166381fe07df96ad9a26f45

Generated by 🏁 PR Finisher · copilot · auto · ~24 AIC · ⌖ ~2 AIC · ⊞ 10.7K · ◷

@pelikhan
pelikhan merged commit b1fe1b4 into main Nov 3, 2026
5 checks passed
@pelikhan
pelikhan deleted the avenger/skip-conflicted-workflow-update-6889002d9988e513 branch November 3, 2026 19:06
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v1.2.0

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants