Skip to content

Allow create_pull_request bundle transport to fall back when branch pinning is unavailable#42318

Merged
pelikhan merged 3 commits into
mainfrom
copilot/awfix-incomplete-results
Jun 29, 2026
Merged

Allow create_pull_request bundle transport to fall back when branch pinning is unavailable#42318
pelikhan merged 3 commits into
mainfrom
copilot/awfix-incomplete-results

Conversation

Copilot AI commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

The Daily Agent of the Day Blog Writer could produce a complete blog post but still report report_incomplete because create_pull_request failed before bundle generation. The handler required a locally pinnable branch even though the bundle generation path already supports HEAD-based fallback when that ref is absent.

  • Problem

    • create_pull_request in bundle mode aborted on rev-parse refs/heads/<branch> failure.
    • This made workflows fail in cases where the requested branch did not exist locally, despite the transport layer being able to derive the patch/bundle from HEAD and GITHUB_SHA.
  • Handler change

    • Remove the early hard failure on bundle-mode branch pinning failure in safe_outputs_handlers.cjs.
    • Keep the pin when available, but allow execution to continue into existing patch/bundle generation logic when it is not.
  • Behavioral impact

    • Workflows that write content successfully but do not materialize the requested branch locally can still emit a valid create_pull_request safe output.
    • Genuine generation failures still return the existing error response path.
  • Regression coverage

    • Add a focused test for the case where the requested branch is missing locally but HEAD contains the intended commit range.
    • Update handler expectations so tests assert the post-fallback error shape instead of the removed preflight pinning error.
try {
  pinnedSha = execGitSync(["rev-parse", "--verify", `refs/heads/${entry.branch}^{commit}`], { cwd: gitCwd })
    .toString()
    .trim();
} catch (pinError) {
  if (useBundle) {
    server.debug(
      `create_pull_request: proceeding without branch pinning for '${entry.branch}'; bundle generation will fall back to HEAD-based strategies when available`
    );
  }
  pinnedSha = null;
}

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix incomplete result in Daily Agent of the Day Blog Writer Allow create_pull_request bundle transport to fall back when branch pinning is unavailable Jun 29, 2026
Copilot AI requested a review from pelikhan June 29, 2026 18:34
@pelikhan pelikhan marked this pull request as ready for review June 29, 2026 18:43
Copilot AI review requested due to automatic review settings June 29, 2026 18:44

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.

Pull request overview

This PR updates the create_pull_request safe-output handler to avoid aborting bundle-mode execution when local branch pinning fails, allowing existing HEAD/GITHUB_SHA-based fallback strategies in the transport layer to proceed and still produce a valid patch/bundle when possible.

Changes:

  • Removed the bundle-mode hard failure path when rev-parse refs/heads/<branch> pinning fails; now logs and continues with pinnedSha = null.
  • Updated existing tests to assert the post-fallback patch-generation error shape (instead of the removed preflight pinning error).
  • Added a regression test ensuring bundle transport can succeed via HEAD fallback when the requested branch is missing locally.
Show a summary per file
File Description
actions/setup/js/safe_outputs_handlers.cjs Allows bundle-mode create_pull_request to continue when branch pinning fails, relying on existing HEAD-based transport fallback.
actions/setup/js/safe_outputs_handlers.test.cjs Adds coverage for missing-local-branch HEAD fallback and updates expectations for the new error path behavior.

Review details

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Low

@github-actions

Copy link
Copy Markdown
Contributor

🔍 PR Triage — §28395315609

Field Value
Category bug
Risk low
Score 67 / 100
Action fast_track
Batch bug-fixes-ready (#41830 · #42318 · #42313 · #42317)

Score breakdown: impact 32 + urgency 18 + quality 17

Small targeted safe_outputs fix (2 files, +66/-22). Removes hard failure on bundle-mode branch pinning, falling back to HEAD-based strategies. All JS CI checks passing. Clear description with regression coverage. Fast-track candidate.

Generated by 🔧 PR Triage Agent · 99.1 AIC · ⌖ 11.6 AIC · ⊞ 5.4K ·

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot All CI checks are green and the branch is clean with no merge conflicts or unresolved review threads. Please invoke the pr-finisher skill to complete the final review pass and get this PR ready to merge.

Generated by 👨‍🍳 PR Sous Chef · 141.7 AIC · ⌖ 10.1 AIC · ⊞ 6.7K ·

Copilot AI commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

@copilot All CI checks are green and the branch is clean with no merge conflicts or unresolved review threads. Please invoke the pr-finisher skill to complete the final review pass and get this PR r...

PR finisher pass complete. All local checks are green:

  • make fmt — no formatting changes needed
  • make lint — all validations passed
  • make test-unit — Go unit tests pass
  • vitest run safe_outputs_handlers.test.cjs — 175/175 JS tests pass (including the new regression test)
  • make build — builds cleanly

No unresolved review threads, no conflicts, branch is up to date. CI on the agent's HEAD is unverified until a maintainer re-triggers it (close/reopen or workflow_dispatch). Ready for human review and merge.

Copilot AI requested a review from gh-aw-bot June 29, 2026 19:43
@pelikhan pelikhan merged commit fe9b063 into main Jun 29, 2026
16 checks passed
@pelikhan pelikhan deleted the copilot/awfix-incomplete-results branch June 29, 2026 19:55
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.

[aw] Daily Agent of the Day Blog Writer reported incomplete result

4 participants