Skip to content

feat(safe-outputs): add patch-format: bundle transport for code-push flows#23190

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/fix-merge-commit-history
Draft

feat(safe-outputs): add patch-format: bundle transport for code-push flows#23190
Copilot wants to merge 6 commits intomainfrom
copilot/fix-merge-commit-history

Conversation

Copy link
Contributor

Copilot AI commented Mar 27, 2026

create-pull-request and push-to-pull-request-branch use git format-patch/git am which loses merge topology and drops merge-resolution-only content. This adds a bundle transport option using git bundle, which preserves commit graph fidelity, merge commits, authorship, and per-commit messages.

New config field

safe-outputs:
  create-pull-request:
    patch-format: bundle   # "am" (default) | "bundle"
  push-to-pull-request-branch:
    patch-format: bundle

Changes

generate_git_bundle.cjs (new)

  • Mirrors the 3-strategy fallback structure of generate_git_patch.cjs
  • Full mode (create-pull-request): bundles <baseRef>..<branchName>
  • Incremental mode (push-to-pull-request-branch): bundles origin/<branch>..<branch> after fetching remote

safe_outputs_handlers.cjs

  • Both PR handlers check patch_format (per-handler config, with global fallback)
  • "bundle" → calls generateGitBundle, writes bundle_path to JSONL entry
  • "am" (default) → existing generateGitPatch path, writes patch_path — no behavior change

create_pull_request.cjs

  • When bundle_path present: skips git am; uses git fetch <bundle> refs/heads/<orig>:refs/heads/<newBranch> to reconstruct the branch, then pushes via pushSignedCommits
  • Existing patch path and all fallback-as-issue logic unchanged

push_to_pull_request_branch.cjs

  • When bundle_path present: skips git am; fetches bundle into a temp ref, git merge --ff-only to advance the branch, then pushes via pushSignedCommits
  • Non-fast-forward error behavior preserved

Go structs / compiler

  • PatchFormat string added to CreatePullRequestsConfig and PushToPullRequestBranchConfig (validated enum: am | bundle)
  • Serialized as patch_format into the handler JSON config consumed at runtime
  • patch-format enum property added to the JSON schema for both create-pull-request and push-to-pull-request-branch

Changeset generator workflow

  • changeset.md updated to use patch-format: bundle for its push-to-pull-request-branch config

[!WARNING]


⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

Copilot AI and others added 2 commits March 27, 2026 00:43
- Create generate_git_bundle.cjs with git bundle generation logic
  (full and incremental modes, same strategy structure as generate_git_patch.cjs)
- Modify safe_outputs_handlers.cjs to check patch_format config and
  dispatch to bundle or patch generation (bundle path sets bundle_path,
  patch path sets patch_path on the JSONL entry)
- Modify create_pull_request.cjs to handle bundle_path: fetch from bundle
  into a local branch and push via pushSignedCommits (skips git am)
- Modify push_to_pull_request_branch.cjs to handle bundle_path: fetch
  from bundle into temp ref and ff-merge before pushing via pushSignedCommits
- Add PatchFormat field to CreatePullRequestsConfig and
  PushToPullRequestBranchConfig in Go structs
- Add patch_format to serialized handler config in compiler_safe_outputs_config.go
- Parse and validate patch-format field in Go parsers (valid: am, bundle)

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/220273af-754a-4610-9d4d-f8d2ad9a7c48

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…e patchFileName)"

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/220273af-754a-4610-9d4d-f8d2ad9a7c48

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix merge commit history in safe-outputs flow feat(safe-outputs): add patch-format: bundle transport for code-push flows Mar 27, 2026
Copilot AI requested a review from pelikhan March 27, 2026 00:46
@pelikhan
Copy link
Collaborator

@copilot update changeset generator to use bundle mode

Copy link
Contributor Author

Copilot AI commented Mar 27, 2026

@copilot update changeset generator to use bundle mode

Added changeset .changeset/minor-safe-outputs-patch-format-bundle.md in 9145035.

@pelikhan
Copy link
Collaborator

@copilot update changeset generator agentic workflow to use bundle patch format

…eset workflow

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/8b757d6e-a587-4103-968c-e3920ac0d1d0

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

Copilot AI commented Mar 27, 2026

@copilot update changeset generator agentic workflow to use bundle patch format

Done in a03c86d. Added patch-format: bundle to the push-to-pull-request-branch config in changeset.md, and also added the patch-format enum field to the JSON schema for both create-pull-request and push-to-pull-request-branch (which was missing and caused a compilation error).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw manager.md nce.md none.md ilit�� t.md ons-warning.md y.md checker.md (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw -embedcfg /tmp/go-build700627530/b295/embedcfg -pack (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha logs/user.env (http block)
  • https://api.github.com/repos/github/gh-aw
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .visibility org-health-report.md example-permissions-warning.md artifacts-summary.md cli-consistency-/usr/bin/gh craft.md cli-version-checgraphql code-simplifier.-f cons�� workflow-generat-f jsweep.md x_amd64/compile r (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0 --jq .object.sha (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha or.md (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@github-actions
Copy link
Contributor

github-actions bot commented Mar 27, 2026

❌ Tool validation failed! Agent Container Smoke Test detected missing tools: failed

@github-actions
Copy link
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions github-actions bot removed the smoke label Mar 27, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 27, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

@github-actions
Copy link
Contributor

github-actions bot commented Mar 27, 2026

💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges...

@github-actions
Copy link
Contributor

📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident...

@pelikhan
Copy link
Collaborator

Copy link
Contributor Author

Copilot AI commented Mar 27, 2026

@copilot update setup.sh https://github.com/github/gh-aw/actions/runs/23650300015/job/68893166596#step:23:1

Fixed in 3533140. generate_git_bundle.cjs was missing from the SAFE_OUTPUTS_FILES list in setup.sh, causing a MODULE_NOT_FOUND error at runtime when safe_outputs_handlers.cjs tried to require it.

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.

safe-outputs: preserve merge/rebase commit history in code-push flow

2 participants