Repository navigation
Conversation
Add --post-command and --post-command-commit-message options that run an arbitrary shell command after cherry-pick(s) succeed but before the result is committed and pushed. If the command produces changes, they are staged and included in an additional fixup commit. This is useful when backporting across major version branches where the cherry-picked code contains import paths or references that are correct on the source branch but wrong on the target branch (e.g. Go module paths, Python package versions, namespace renames). Closes kiegroup#237
Contributor
Coverage report
Show files with reduced coverage 🔻
Test suite run success239 tests passing in 19 suites. Report generated by 🧪jest coverage report action from e734034 |
lampajr
reviewed
Oct 17, 2026
lampajr
left a comment
Member
There was a problem hiding this comment.
Thanks @mandre , overall looks good and working!! It seems pretty easy to give it a try imho 🚀
I just left one nit-picking comment and maybe it might be better to move the "runScript" method into another service as it is not git-related.
| * @param cwd working directory | ||
| * @param command shell command to execute | ||
| */ | ||
| async runPostCommand(cwd: string, command: string): Promise<void> { |
Member
There was a problem hiding this comment.
I'd rename this to something a bit more generic, e.g., runScript, as this might be used in the future for other hooks (e.g., pre-command)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #237
Description
Add --post-command and --post-command-commit-message options that run an arbitrary shell command after cherry-pick(s) succeed but before the result is committed and pushed. If the command produces changes, they are staged and included in an additional fixup commit.
This is useful when backporting across major version branches where the cherry-picked code contains import paths or references that are correct on the source branch but wrong on the target branch (e.g. Go module paths, Python package versions, namespace renames).
How Has This Been Tested?
Untested, apart from the newly added unit tests. This was produced with the help of opus-4.6. The code looks good to me, but since I'm not a big javascript person, my view doesn't really count 😄
Checklist
Merge criteria:
First time here?
This project follows git conventional commits pattern, therefore the commits should have the following format:
Where the type must be one of
[build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test]How to prepare for a new release?
There is no need to manually update
package.jsonversion andCHANGELOG.mdinformation. This process has been automated in Prepare Release Github workflow.Therefore whenever enough changes are merged into the
mainbranch, one of the maintainers will trigger this workflow that will automatically updateversionandchangelogbased on the commits on the git tree.More details can be found in package release section of the README.