kiegroup / git-backporting

Git backporting is a CLI tool to execute pull request backporting.
MIT License
17 stars 9 forks source link

fix: cherry-pick order on GitLab by reversing commmit list only once #137

Closed peat-psuwit closed 2 months ago

peat-psuwit commented 2 months ago

Thank you for submitting this pull request

Description

GitLabClient already handle commit order reversing, so re-handle it in Runner causes cherry-pick order on GitLab to be wrong.

Remove commit order handling from Runner, and instead handle difference between GitHub and Codeberg inside GitHubClient.

Now, since the default of --bp-branch-name takes the commit list from {GitHub,GitLab}Client directly, that means backporting branch name on Codeberg will also be changed to have commits in the correct order too (old to new, in line with GitHub and GitLab), which is IMO a nice bonus.

How Has This Been Tested?

Checklist

Merge criteria:

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](https://gist.github.com/qoomon/5dfcdf8eec66a051ecd85625518cfd13) pattern, therefore the commits should have the following format: ``` (): empty separator line empty separator line ``` 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 --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](./workflows/prepare-release.yml) *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](https://github.com/kiegroup/git-backporting/blob/main/README.md#package-release) section of the README.
github-actions[bot] commented 2 months ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟒 Statements 89.71% 497/554
🟒 Branches
86.1% (-0.12% πŸ”»)
192/223
🟒 Functions 87.4% 111/127
🟒 Lines 89.57% 481/537
Show files with reduced coverage πŸ”»
|
St.:grey_question:
| File | Statements | Branches | Functions | Lines | | :-: | :- | :- | :- | :- | :- | | 🟒 | runner/runner.ts |
90% (-0.28% πŸ”»)
| 100% | 80% |
90% (-0.28% πŸ”»)
|

Test suite run success

215 tests passing in 18 suites.

Report generated by πŸ§ͺjest coverage report action from aab201c862a7df5176255645b594295efd99872a