Skip to content

Merge main into PR branch, resolve workflow lock conflict, and regenerate compiled workflow artifacts#33295

Merged
pelikhan merged 14 commits into
mainfrom
copilot/create-pull-request-retry
May 19, 2026
Merged

Merge main into PR branch, resolve workflow lock conflict, and regenerate compiled workflow artifacts#33295
pelikhan merged 14 commits into
mainfrom
copilot/create-pull-request-retry

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

This updates the branch to the latest main, resolves merge conflicts in generated workflow output, and re-runs repository compilation so lock/generated files are consistent with current sources. The result is a clean merge state with regenerated workflow artifacts aligned to upstream.

  • Branch synchronization

    • Merged latest origin/main into copilot/create-pull-request-retry.
    • Integrated concurrent remote updates on the PR branch to restore a fast-forwardable head.
  • Conflict resolution in generated workflow output

    • Resolved conflict in .github/workflows/duplicate-code-detector.lock.yml by taking the upstream-generated variant and preserving deterministic heredoc token consistency from compiled output.
  • Artifact recompilation

    • Ran repository recompile target to regenerate lock/compiled workflow files after merge.
    • Captured and committed the regenerated workflow/doc/runtime artifacts produced by the current compiler and templates.
# Makefile
recompile: build
	./$(BINARY_NAME) init --codespaces ""
	./$(BINARY_NAME) compile --validate --verbose --purge --stats

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

Hey @Copilot 👋 — thanks for working on the create_pull_request retry mechanism! I can see this is marked as WIP, which is great. However, there are a few alignment issues with the project's contribution guidelines that need attention:

Process concern: This project uses an agentic development model where non-core team members should create detailed agentic plans in issues first, then have a core team member implement the PR. The CONTRIBUTING.md explicitly states: "Traditional Pull Requests Are Not Enabled for non-Core team members." If you're not part of the core team, the recommended flow is to open an issue with a detailed plan instead of creating the PR directly.

Focus mismatch: The PR title and description talk about fixing "create_pull_request fallback retry mechanism" and mention adding retry logic and tests, but the actual diff only updates safe-output configuration in two workflow lock files (changing max issue counts, adding labels, expiration times). There's a disconnect between what's described and what's changed. Consider either:

  • Updating the description to match the actual changes (if this PR is just about safe-output config), or
  • Splitting the safe-output config changes from the retry mechanism work

Missing tests: The PR body mentions "Add focused tests covering new retry path and non-cancellation behavior," but no test files are modified in the diff.

If you'd like to align this with the project's workflow, here's a suggested path:

Create a GitHub issue in github/gh-aw with the title "[Plan] Improve create_pull_request fallback retry mechanism and safe-output resilience".

The issue should contain:
1. **Problem statement**: Describe the current behavior of create_pull_request patch-apply fallback and safe-output cancellation that needs improvement.
2. **Proposed changes**:
   - Stronger non-model retry logic for create_pull_request when git am fails
   - Safe-output orchestration updates so independent messages aren't cancelled after code-push failures
   - Safe-output configuration changes (max issues, labels, expiration, grouping)
3. **Testing strategy**: Focused tests for new retry path and non-cancellation behavior
4. **Implementation scope**: Clear breakdown of which files need changes and why

Label the issue with appropriate tags and assign to a core team member for review and agent-based implementation.

Generated by ✅ Contribution Check · ● 9.5M ·

Copilot AI and others added 2 commits May 19, 2026 13:59
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix create pull request fallback retry mechanism Harden create_pull_request patch recovery and stop cancelling independent safe outputs May 19, 2026
Copilot AI requested a review from pelikhan May 19, 2026 14:04
@pelikhan pelikhan marked this pull request as ready for review May 19, 2026 14:08
Copilot AI review requested due to automatic review settings May 19, 2026 14:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Hardens create_pull_request patch-apply recovery for git am add/add conflicts and removes implicit fail-fast cancellation of unrelated safe outputs after a code-push failure.

Changes:

  • Added tryRecoverGitAmAddAddConflict helper and wired it into both the primary git am --3way failure path and the original-base-commit fallback (which now also uses --3way).
  • Removed the fail-fast block in processMessages that cancelled non-add_comment messages after a code-push failure; updated warning messages accordingly.
  • Updated manager tests for the new behavior and added a create_pull_request test covering fallback add/add conflict recovery.
Show a summary per file
File Description
actions/setup/js/create_pull_request.cjs New add/add recovery helper; applied after both primary and fallback git am --3way failures.
actions/setup/js/create_pull_request.test.cjs Adds test for fallback git am --continue recovery.
actions/setup/js/safe_output_handler_manager.cjs Removes cross-message cancellation; updates warning text.
actions/setup/js/safe_output_handler_manager.test.cjs Updates test to assert non-code-push messages continue after code-push failure.
.github/workflows/spec-librarian.lock.yml Regenerated lock file with new create_issue options.
.github/workflows/duplicate-code-detector.lock.yml Regenerated lock file with new create_issue options and config hashes.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 6/6 changed files
  • Comments generated: 4

Comment on lines +109 to +125
const unresolvedFilesResult = await execApi.getExecOutput("git", ["diff", "--name-only", "--diff-filter=U"]);
const unresolvedFiles = unresolvedFilesResult.stdout
.split("\n")
.map(line => line.trim())
.filter(Boolean);

if (unresolvedFiles.length === 0) {
return false;
}

const statusPorcelainResult = await execApi.getExecOutput("git", ["status", "--porcelain"]);
const addAddFiles = new Set(
statusPorcelainResult.stdout
.split("\n")
.map(line => line.trim())
.filter(line => line.startsWith("AA "))
.map(line => line.substring(3).trim())
Comment on lines +132 to +136
core.warning(`Detected add/add conflict(s) for ${unresolvedFiles.join(", ")}; preferring patch version and continuing`);
for (const file of unresolvedFiles) {
await execApi.exec("git", ["checkout", "--theirs", "--", file]);
await execApi.exec("git", ["add", "--", file]);
}
Comment on lines +1798 to +1803
try {
await exec.exec("git am --abort");
} catch (abortFallbackError) {
core.warning(`Failed to abort fallback git am: ${getErrorMessage(abortFallbackError)}`);
}
throw fallbackPatchError;
mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs
cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_eef6781d680527d3_EOF'
{"create_issue":{"assignees":["copilot"],"max":1},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}}
{"create_issue":{"assignees":["copilot"],"expires":48,"group":true,"labels":["code-quality","automated-analysis","cookie"],"max":3,"title_prefix":"[duplicate-code] "},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}}
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot review all comments

…hanges

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 19, 2026

@copilot review all comments

Reviewed all review comments and pushed fixes in f8c4a68.

Included updates:

  • switched add/add detection to NUL-delimited git output to avoid trimming/corrupting porcelain paths
  • added conflict-side blob SHA/size logging before resolving add/add conflicts with --theirs
  • surfaced recovery-attempt failures separately so they are distinguishable from non-applicable recovery paths
  • reverted unrelated workflow lock-file churn from earlier commits (including the duplicate-code detector label/config drift)

Targeted tests pass: npm run test:js -- create_pull_request.test.cjs.

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot ensure enough logging to log debug

Copilot AI and others added 2 commits May 19, 2026 14:37
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 19, 2026

@copilot ensure enough logging to log debug

Added more debug-level logging in the add/add recovery path in 1cc93ac (unresolved/AA file probes, skip reason, per-file checkout action, and recovery exception details).

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot Merged main, recompiled, and fixed conflicts.

pelikhan and others added 3 commits May 19, 2026 09:44
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…y' into copilot/create-pull-request-retry

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Harden create_pull_request patch recovery and stop cancelling independent safe outputs Merge main into PR branch, resolve workflow lock conflict, and regenerate compiled workflow artifacts May 19, 2026
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot review all changes, add git integration tests

Copilot AI and others added 3 commits May 19, 2026 17:19
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 19, 2026

@copilot review all changes, add git integration tests

Done in 6bfcdc3.

Added a real git integration test in actions/setup/js/git_patch_integration.test.cjs that reproduces an add/add conflict on git am --3way and verifies recovery via git checkout --theirs, git add, and git am --continue.

Validated with:

  • npm run test:js -- git_patch_integration.test.cjs create_pull_request.test.cjs
  • npx prettier --check git_patch_integration.test.cjs

@pelikhan pelikhan merged commit f8f3266 into main May 19, 2026
6 of 7 checks passed
@pelikhan pelikhan deleted the copilot/create-pull-request-retry branch May 19, 2026 17:22
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.

create_pull_request: git am fallback also fails and cancels unrelated safe outputs — needs stronger retry

3 participants