Skip to content

feat: skip pull request if changes were already backported - #235

Merged
lampajr merged 2 commits into
kiegroup:mainfrom
oliverpool:skip-already-cherry-picked
Sep 29, 2026
Merged

lampajr merged 2 commits into
kiegroup:mainfrom
oliverpool:skip-already-cherry-picked

Conversation

@oliverpool

Copy link
Copy Markdown
Contributor

Description

Skip the pull request creation if the changes were already backported:

  • skip empty cherry picks silently (--empty=drop)
  • after all cherry picks, check if the head is pointing at the same commit as the base (to exit early)

How Has This Been Tested?

Unit-tests have been adapted.
I also tested with the following invocation:

> node ./dist/cli/index.js --dry-run -pr https://codeberg.org/forgejo/forgejo/pulls/14491 --target-branch v16.0/forgejo --strategy=ort --strategy-option=find-rename --cherry-pick-options=-x
(snip)
[DEBUG] [v16.0/forgejo] Cherry picking commits..
[INFO ] [v16.0/forgejo] Cherry picking a8fbdd9b2a08c12ac3427216f33ca254a989309a
[DEBUG] [v16.0/forgejo] Cherry picking command git cherry-pick,-m,1,--strategy=ort,--strategy-option=find-rename,--empty=drop,-x,a8fbdd9b2a08c12ac3427216f33ca254a989309a
[INFO ] [v16.0/forgejo] Nothing new to push, exiting early
[INFO ] Process succeeded

(PR not already cherry-picked still work: 13661 for instance)

Checklist

  • Tests added if applicable.
  • Documentation updated if applicable.

Merge criteria:

  • The commits and have meaningful messages; the author will squash them after approval or will ask to merge with squash.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

Note: dist/cli/index.js and dist/gha/index.js are automatically generated by git hooks and gh workflows.

First time here?

This project follows git conventional commits pattern, therefore the commits should have the following format:

<type>(<optional scope>): <subject>
empty separator line
<optional body>
empty separator line
<optional footer>

Where the type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test]

NOTE: if you are still in a work in progress branch and you want to push your changes remotely, consider adding --no-verify for both commit and push, e.g., git push origin <feat-branch> --no-verify - this could become useful to push changes where there are still tests failures. Once the pull request is ready, please amend the commit and force-push it to keep following the adopted git commit standard.

How to prepare for a new release?

There is no need to manually update package.json version and CHANGELOG.md information. This process has been automated in Prepare Release Github workflow.

Therefore whenever enough changes are merged into the main branch, one of the maintainers will trigger this workflow that will automatically update version and changelog based on the commits on the git tree.

More details can be found in package release section of the README.

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Coverage report

St.❔
Category Percentage Covered / Total
🟢 Statements
87.97% (-0.08% 🔻)
651/740
🟢 Branches
82.32% (-0.7% 🔻)
312/379
🟢 Functions
85.56% (+0.24% 🔼)
154/180
🟢 Lines
88.08% (-0.08% 🔻)
628/713
Show files with reduced coverage 🔻
St.❔
File Statements Branches Functions Lines
🟢 runner/runner.ts
88.2% (-0.62% 🔻)
87.93% (-4.52% 🔻)
83.33% (+0.98% 🔼)
88.13% (-0.62% 🔻)
🟡 git/git-cli.ts
67.69% (+1.56% 🔼)
40.74% (-1.57% 🔻)
85.71% (+1.1% 🔼)
67.19% (+1.61% 🔼)

Test suite run success

230 tests passing in 19 suites.

Report generated by 🧪jest coverage report action from ba6dc2f

@oliverpool
oliverpool force-pushed the skip-already-cherry-picked branch from 2a4c332 to 77d56bd Compare September 27, 2026 20:46
@oliverpool
oliverpool force-pushed the skip-already-cherry-picked branch from 77d56bd to d909de4 Compare September 27, 2026 20:49

@lampajr lampajr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm! also thanks for making it configurable 🙏

@lampajr
lampajr merged commit 18b1f04 into kiegroup:main Sep 29, 2026
5 checks passed
@oliverpool
oliverpool deleted the skip-already-cherry-picked branch September 30, 2026 19:59
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.

2 participants