kiegroup / git-backporting

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

fix(gh130): apply commits in the correct order on github #131

Closed lampajr closed 4 months ago

lampajr commented 4 months ago

Thank you for submitting this pull request

fixes https://github.com/kiegroup/git-backporting/issues/130

Description

The change that was introduced with https://github.com/kiegroup/git-backporting/pull/115 was assuming that all services were returning the list of commits in the same order, but that's not true:

GITHUB        --> oldest to newest
CODEBERG  --> newest to oldest
GITLAB         --> newest to oldest

Therefore, in according to the GitServiceType, the list of commits is reversed (at the moment for Gitlab and Codeberg) in order to guarantee that the commit are applied from older to newest.

How Has This Been Tested?

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 4 months ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟢 Statements
89.71% (+0.04% 🔼)
497/554
🟢 Branches
86.88% (+0.64% 🔼)
192/221
🟢 Functions 87.4% 111/127
🟢 Lines
89.57% (+0.04% 🔼)
481/537

Test suite run success

215 tests passing in 18 suites.

Report generated by 🧪jest coverage report action from e986f063612c129dcbe7bc6d7fb33981faa5526b