Skip to content

ci: cherry-pick a stacked PR's change, not its empty merge commit - #1070

Merged
frontegg-david merged 1 commit into
release/1.11.xfrom
fix/cherry-pick-stack-content
Nov 4, 2026
Merged

frontegg-david merged 1 commit into
release/1.11.xfrom
fix/cherry-pick-stack-content

Conversation

@frontegg-david

@frontegg-david frontegg-david commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What and why

When stack #1057 merged, #1056's change landed on release/1.11.x as its own commit, 2a43a8b66, and #1056's merge commit, 29920b485, was empty. cherry-pick-prompt.yml cherry-picks merge_commit_sha, so it picked the empty commit. That left nothing to commit, so it commented on #1056 that main already had the change. main didn't; #1069 back-ports it by hand.

  • New script: scripts/cherry-pick-commits.mjs <merge-sha> <pr-number> prints the commits that hold a PR's change, oldest first:
    • it walks back along first parents from the merge commit, through the commits whose subject ends with the PR's (#N) suffix, as GitHub's squash commits do;
    • it keeps only those that change files;
    • a merge commit with several parents is printed alone, as is the merge commit when none of the commits changes anything (then the workflow still reports "already applied").
  • The workflow:
    • "Resolve target branches" runs the script and outputs commits, falling back to the merge commit with a warning if the script fails;
    • "Prepare cherry-pick branch" cherry-picks those commits;
    • the cherry-pick commit's Original commit: line, the "No cherry-pick needed" comment and the conflict issue's instructions name them.
  • CLAUDE.md: the stacked-PR note describes this case.

This is the bottom of the skill-search stack, so the stack's own cherry-picks use it when it merges.

Tests

Summary by CodeRabbit

  • Improvements
    • Cherry-pick requests now include the commits that contain a pull request’s changes, including changes from stacked pull requests, rather than relying only on the merge commit.
    • Status updates, conflict details, and manual instructions now refer to the commits being cherry-picked.
    • If the relevant commits cannot be identified, the workflow warns and falls back to the merge commit.

When a native stack merged, #1056's change landed on release/1.11.x as
its own commit (2a43a8b) and its merge commit (29920b4) was empty.
The workflow cherry-picked the empty commit, found nothing to commit,
and reported that main already had the change, which it didn't.

scripts/cherry-pick-commits.mjs walks back from the merge commit
through the commits with the PR's (#N) suffix and prints those that
change files. The workflow cherry-picks those.
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request adds a script that selects commits containing a PR’s changes. The cherry-pick workflow uses the selected commit list for cherry-pick operations, status messages, comments, conflict details, and manual instructions.

Changes: Cherry-pick commit resolution

Layer / File(s) Summary
Commit selection and validation
scripts/cherry-pick-commits.mjs, scripts/cherry-pick-commits.test.mjs
The script selects commits by walking first parents while commit subjects match the PR-number suffix. It handles merge commits, filters commits without file changes, and falls back to the merge commit when needed. Tests cover stacked PRs, empty commits, merge commits, and invalid inputs.
Workflow integration and stacked-PR guidance
.github/workflows/cherry-pick-prompt.yml, CLAUDE.md
The workflow resolves and cherry-picks the commit list, and uses it in status output, comments, conflict details, and manual instructions. The guidance describes the stacked-PR case.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CherryPickWorkflow
  participant CommitScript as cherry-pick-commits.mjs
  participant Git
  CherryPickWorkflow->>CommitScript: Pass merge SHA and PR number
  CommitScript->>Git: Inspect commit history and file changes
  Git-->>CommitScript: Return commit metadata
  CommitScript-->>CherryPickWorkflow: Return selected commit list
  CherryPickWorkflow->>Git: Cherry-pick selected commits
Loading

Possibly related PRs

  • agentfront/frontmcp#1069: Addresses the same empty-merge cherry-pick failure by applying the file-changing commit instead.

Suggested reviewers: alexmercerpo

Merge Risk: Moderate · up to 308fe

Some stacked PRs may be reported as conflicted or cherry-picked without all their changes. Resolve both commit-list failures before merging.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@frontegg-david
frontegg-david merged commit 753a1ae into release/1.11.x Nov 4, 2026
18 of 19 checks passed
@frontegg-david
frontegg-david deleted the fix/cherry-pick-stack-content branch November 4, 2026 11:43
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Cherry-pick Created

A cherry-pick PR to main has been automatically created.

Please review and merge if this change should also be in main.

If the cherry-pick is not needed, close the PR.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Performance Test Results

Status: ✅ All tests passed

Summary

Project Tests Passed Warnings Failed Leaks
✅ demo-e2e-agents 4 4 0 0 0
✅ demo-e2e-cache 11 11 0 0 0
✅ demo-e2e-codecall 4 4 0 0 0
✅ demo-e2e-config 4 4 0 0 0
✅ demo-e2e-direct 3 3 0 0 0
✅ demo-e2e-elicitation 1 1 0 0 0
✅ demo-e2e-errors 4 4 0 0 0
✅ demo-e2e-hooks 3 3 0 0 0
✅ demo-e2e-multiapp 4 4 0 0 0
✅ demo-e2e-notifications 3 3 0 0 0
✅ demo-e2e-openapi 2 2 0 0 0
✅ demo-e2e-providers 4 4 0 0 0
✅ demo-e2e-public 4 4 0 0 0
✅ demo-e2e-redis 15 15 0 0 0
✅ demo-e2e-remember 4 4 0 0 0
✅ demo-e2e-remote 5 5 0 0 0
✅ demo-e2e-serverless 2 2 0 0 0
✅ demo-e2e-skills 15 15 0 0 0
✅ demo-e2e-standalone 2 2 0 0 0
✅ demo-e2e-transport-recreation 3 3 0 0 0
✅ demo-e2e-ui 4 4 0 0 0

Total: 101 tests across 21 projects

📊 View full report in workflow run


Generated at: 2026-11-04T11:53:52.113Z
Commit: 4c8152b3

frontegg-david added a commit that referenced this pull request Nov 4, 2026
…ge commit (#1071)

Cherry-picked from #1070 (merged to release/1.11.x)
Original commit: 753a1ae

Co-authored-by: agentfront[bot] <agentfront[bot]@users.noreply.github.com>
Co-authored-by: frontegg-david <69419539+frontegg-david@users.noreply.github.com>
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.

1 participant