Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: auto-no-squash inference for GitLab #140

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

peat-psuwit
Copy link
Contributor

Thank you for submitting this pull request

Description

When a GitLab MR is not squashed, squash_commit_sha will be null, not undefined. Update inferSquash() to account for this.

How Has This Been Tested?

node dist/cli/index.js -pr https://gitla
b.com/ubports/development/core/lomiri-system-settings-cellular/-/merge_requests/10 --auto-no-squash -tb personal/peat-psuwit
/ignore-me-test-backporter -d
[WARN ] Dry run enabled
[INFO ] Auth argument not provided, checking available tokens from env..
[INFO ] Git token not found in the environment
[DEBUG] Setting up gitlab client: apiUrl=https://gitlab.com/api/v4, token=****
[DEBUG] Parsing configs..
[DEBUG] cherry-pick the merged commit(s)
[DEBUG] [personal/peat-psuwit/ignore-me-test-backporter] Cloning repo..
[INFO ] [personal/peat-psuwit/ignore-me-test-backporter] Cloning repository https://gitlab.com/ubports/development/core/lomiri-system-settings-cellular.git to /workspaces/git-backporting/bp
[DEBUG] [personal/peat-psuwit/ignore-me-test-backporter] Creating local branch..
[INFO ] [personal/peat-psuwit/ignore-me-test-backporter] Creating branch bp-personal/peat-psuwit/ignore-me-test-backporter-97c8dc6-2d0c909
[DEBUG] [personal/peat-psuwit/ignore-me-test-backporter] Cherry picking commits..
[INFO ] [personal/peat-psuwit/ignore-me-test-backporter] Cherry picking 97c8dc681c1f732cb174c809209de666b9b833db
[DEBUG] [personal/peat-psuwit/ignore-me-test-backporter] Cherry picking command git cherry-pick,-m,1,--strategy=recursive,--strategy-option=theirs,97c8dc681c1f732cb174c809209de666b9b833db
[INFO ] [personal/peat-psuwit/ignore-me-test-backporter] Cherry picking 2d0c9092db2900c675a728e135b2365f04687d9e
[DEBUG] [personal/peat-psuwit/ignore-me-test-backporter] Cherry picking command git cherry-pick,-m,1,--strategy=recursive,--strategy-option=theirs,2d0c9092db2900c675a728e135b2365f04687d9e
[WARN ] [personal/peat-psuwit/ignore-me-test-backporter] Pull request creation and remote push skipped
[INFO ] [personal/peat-psuwit/ignore-me-test-backporter] {
  "owner": "ubports/development/core",
  "repo": "lomiri-system-settings-cellular",
  "head": "bp-personal/peat-psuwit/ignore-me-test-backporter-97c8dc6-2d0c909",
  "base": "personal/peat-psuwit/ignore-me-test-backporter",
  "title": "[personal/peat-psuwit/ignore-me-test-backporter] Implement a VoLTE Switch in Cellular Settings",
  "body": "**Backport:** https://gitlab.com/ubports/development/core/lomiri-system-settings-cellular/-/merge_requests/10\r\n\r\nFor the switch to be shown, device port has to set a new\nOfonoImplementsIms configuration value in deviceinfo.\n\nThe reason for enabling it per-device is that there is currently no\nway to query from ofono-binder-plugin whether it has an underlying\nextension that implements IMS, since it always registers the ofono\nIMS driver.\n\nPutting it as draft for discussion for now, as I'm not quite sure about where to put the settings item exactly across single-SIM and dual-SIM setups.\n\n![screenshot20240914_230337458](/uploads/064dcdae23b09f26244a776821cff6fd/screenshot20240914_230337458.png){width=400px}\n![screenshot20240914_214640538](/uploads/11598b17c0b3b6f2a9004c18d14857a2/screenshot20240914_214640538.png){width=400px}",
  "reviewers": [
    "NotKit",
    "peat-psuwit"
  ],
  "assignees": [],
  "labels": [],
  "comments": []
}
[INFO ] Process succeeded

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.

When a GitLab MR is not squashed, `squash_commit_sha` will be `null`,
not `undefined`. Update `inferSquash()` to account for this.
Copy link
Contributor

github-actions bot commented Oct 7, 2024

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 89.71% 497/554
🟢 Branches 86.1% 192/223
🟢 Functions 87.4% 111/127
🟢 Lines 89.57% 481/537

Test suite run success

217 tests passing in 18 suites.

Report generated by 🧪jest coverage report action from 568f2e4

Copy link
Member

@lampajr lampajr left a comment

Choose a reason for hiding this comment

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

lgtm!

@lampajr lampajr merged commit b4d0481 into kiegroup:main Oct 7, 2024
6 checks passed
@peat-psuwit peat-psuwit deleted the fix-gitlab-auto-squash branch October 7, 2024 16:55
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