Skip to content

ci: add cherry-pick to latest release workflow#24051

Merged
f0ssel merged 6 commits into
mainfrom
feature/cherry-pick-workflow
Apr 8, 2026
Merged

ci: add cherry-pick to latest release workflow#24051
f0ssel merged 6 commits into
mainfrom
feature/cherry-pick-workflow

Conversation

@f0ssel
Copy link
Copy Markdown
Member

@f0ssel f0ssel commented Apr 6, 2026

Adds a GitHub Actions workflow that cherry-picks merged PRs to the latest release branch when the cherry-pick label is applied.

How it works

  1. Add the cherry-pick label to any PR targeting main (before or after merge).
  2. On merge (or on label if already merged), the workflow detects the latest release/* branch.
  3. It cherry-picks the merge commit (-x -m1) and opens a PR.

This complements the backport label (see #24025) which targets the latest 3 release branches. cherry-pick targets only the latest one — useful for getting fixes into the current release.

Created PRs follow existing repo conventions:

  • Branch: backport/<pr>-to-<version>
  • Title: <original PR title> (#<pr>) — e.g. fix(site): correct button alignment (#12345)
  • Body: links back to the original PR and merge commit

If the cherry-pick encounters conflicts, the workflow aborts the cherry-pick, creates an empty commit with resolution instructions, and opens the PR with a [CONFLICT] prefix so the author can resolve manually.

Also:

  • Removes scripts/backport-pr.sh (replaced by this workflow)
  • Removes .github/cherry-pick-bot.yml (old bot config)
  • Adds a section to the contributing docs explaining the cherry-pick label

Note

Generated with Coder Agents

Adds a GitHub Actions workflow that cherry-picks merged PRs to the
latest release branch when the 'cherry-pick' label is applied.
Also documents both the cherry-pick and backport labels in the
contributing guide.
@f0ssel f0ssel marked this pull request as ready for review April 6, 2026 17:35
@f0ssel f0ssel requested a review from jdomeracki-coder as a code owner April 6, 2026 17:35
Copy link
Copy Markdown
Member

matifali commented Apr 6, 2026

Useful automation overall. Having a dedicated path for cherry-picking into just the latest release branch makes sense, and the workflow itself is easy to follow.

I found one issue I think should be fixed before merge, plus one operational concern in the workflow implementation.

docs/about/contributing/CONTRIBUTING.md:278-286

P1 the docs describe backport behavior that this PR does not implement

This PR adds .github/workflows/cherry-pick.yaml, but the new docs section also says backport cherry-picks to the latest 3 release branches. If someone reads this PR in isolation and uses the backport label based on this docs change, nothing in this PR makes that happen. I would either scope the docs to cherry-pick only here or land the backport docs together with the workflow that implements them.

.github/workflows/cherry-pick.yaml:74-109

Nit this workflow is not idempotent on re-runs

The branch name is deterministic (backport/<pr>-to-<version>), and the job always does git checkout -b, git push, and gh pr create. If the workflow runs again for the same PR, it will start failing once the branch or PR already exists. Worth guarding with an existence check so relabels and retries do not create noisy failures.

🤖 This response was generated by Coder Agents.

Comment thread .github/workflows/cherry-pick.yaml
f0ssel added 2 commits April 7, 2026 14:27
These are replaced by the automated cherry-pick and backport GitHub
Actions workflows.
Matches the idempotency pattern from the backport workflow. Checks
for existing PRs (including closed/merged) before creating a new
one, preventing duplicates on re-runs.
@coder-tasks
Copy link
Copy Markdown
Contributor

coder-tasks Bot commented Apr 7, 2026

Documentation Check

Updates Needed

  • docs/about/contributing/CONTRIBUTING.md - The new cherry-pick section should briefly contrast with the backport label (e.g. "This targets only the latest release branch; for the latest 3 release branches, use the backport label instead"). The PR description states it explains both labels, but the diff only covers cherry-pick.

Already Addressed

  • docs/about/contributing/CONTRIBUTING.md - Cherry-pick workflow documented: how to use the label, how automation works, and conflict handling.

Automated review via Coder Tasks

@f0ssel f0ssel requested a review from zedkipp April 7, 2026 20:36
@f0ssel f0ssel merged commit ab77154 into main Apr 8, 2026
32 checks passed
@f0ssel f0ssel deleted the feature/cherry-pick-workflow branch April 8, 2026 14:22
@f0ssel f0ssel added the backport label Apr 8, 2026
github-actions Bot pushed a commit that referenced this pull request Apr 8, 2026
Adds a GitHub Actions workflow that cherry-picks merged PRs to the
latest release branch when the `cherry-pick` label is applied.

## How it works

1. Add the `cherry-pick` label to any PR targeting `main` (before or
after merge).
2. On merge (or on label if already merged), the workflow detects the
latest `release/*` branch.
3. It cherry-picks the merge commit (`-x -m1`) and opens a PR.

This complements the `backport` label (see #24025) which targets the
latest **3** release branches. `cherry-pick` targets only the **latest**
one — useful for getting fixes into the current release.

Created PRs follow existing repo conventions:
- **Branch:** `backport/<pr>-to-<version>`
- **Title:** `<original PR title> (#<pr>)` — e.g. `fix(site): correct
button alignment (#12345)`
- **Body:** links back to the original PR and merge commit

If the cherry-pick encounters conflicts, the workflow aborts the
cherry-pick, creates an empty commit with resolution instructions, and
opens the PR with a `[CONFLICT]` prefix so the author can resolve
manually.

Also:
- Removes `scripts/backport-pr.sh` (replaced by this workflow)
- Removes `.github/cherry-pick-bot.yml` (old bot config)
- Adds a section to the contributing docs explaining the `cherry-pick`
label

> [!NOTE]
> Generated with [Coder Agents](https://coder.com/agents)

(cherry picked from commit ab77154)
github-actions Bot pushed a commit that referenced this pull request Apr 8, 2026
Adds a GitHub Actions workflow that cherry-picks merged PRs to the
latest release branch when the `cherry-pick` label is applied.

## How it works

1. Add the `cherry-pick` label to any PR targeting `main` (before or
after merge).
2. On merge (or on label if already merged), the workflow detects the
latest `release/*` branch.
3. It cherry-picks the merge commit (`-x -m1`) and opens a PR.

This complements the `backport` label (see #24025) which targets the
latest **3** release branches. `cherry-pick` targets only the **latest**
one — useful for getting fixes into the current release.

Created PRs follow existing repo conventions:
- **Branch:** `backport/<pr>-to-<version>`
- **Title:** `<original PR title> (#<pr>)` — e.g. `fix(site): correct
button alignment (#12345)`
- **Body:** links back to the original PR and merge commit

If the cherry-pick encounters conflicts, the workflow aborts the
cherry-pick, creates an empty commit with resolution instructions, and
opens the PR with a `[CONFLICT]` prefix so the author can resolve
manually.

Also:
- Removes `scripts/backport-pr.sh` (replaced by this workflow)
- Removes `.github/cherry-pick-bot.yml` (old bot config)
- Adds a section to the contributing docs explaining the `cherry-pick`
label

> [!NOTE]
> Generated with [Coder Agents](https://coder.com/agents)

(cherry picked from commit ab77154)
github-actions Bot pushed a commit that referenced this pull request Apr 8, 2026
Adds a GitHub Actions workflow that cherry-picks merged PRs to the
latest release branch when the `cherry-pick` label is applied.

## How it works

1. Add the `cherry-pick` label to any PR targeting `main` (before or
after merge).
2. On merge (or on label if already merged), the workflow detects the
latest `release/*` branch.
3. It cherry-picks the merge commit (`-x -m1`) and opens a PR.

This complements the `backport` label (see #24025) which targets the
latest **3** release branches. `cherry-pick` targets only the **latest**
one — useful for getting fixes into the current release.

Created PRs follow existing repo conventions:
- **Branch:** `backport/<pr>-to-<version>`
- **Title:** `<original PR title> (#<pr>)` — e.g. `fix(site): correct
button alignment (#12345)`
- **Body:** links back to the original PR and merge commit

If the cherry-pick encounters conflicts, the workflow aborts the
cherry-pick, creates an empty commit with resolution instructions, and
opens the PR with a `[CONFLICT]` prefix so the author can resolve
manually.

Also:
- Removes `scripts/backport-pr.sh` (replaced by this workflow)
- Removes `.github/cherry-pick-bot.yml` (old bot config)
- Adds a section to the contributing docs explaining the `cherry-pick`
label

> [!NOTE]
> Generated with [Coder Agents](https://coder.com/agents)

(cherry picked from commit ab77154)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants