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

feat(issue-41): set and inherit labels #48

Merged
merged 1 commit into from
Jul 10, 2023
Merged

Conversation

lampajr
Copy link
Member

@lampajr lampajr commented Jul 7, 2023

Thank you for submitting this pull request

fix #41

This change extends the functionality letting user to

  • Set their own labels to the newly created backporting one
  • Inherit the labels from the original pull request
  • Both previous options together

Referenced pull requests

Checklist

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

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

@lampajr lampajr marked this pull request as ready for review July 7, 2023 14:36
@lampajr
Copy link
Member Author

lampajr commented Jul 7, 2023

In addition to the enhancement itself, I improved a bit the test coverage, here the results right now:

----------------------------|---------|----------|---------|---------|-------------------------------
File                        | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s             
----------------------------|---------|----------|---------|---------|-------------------------------
All files                   |   90.25 |       80 |   89.28 |   90.39 |                               
 args                       |   95.83 |     92.3 |     100 |   95.65 |                               
  args-parser.ts            |   83.33 |       80 |     100 |   83.33 | 21                            
  args-utils.ts             |     100 |      100 |     100 |     100 |                               
 args/cli                   |     100 |      100 |     100 |     100 |                               
  cli-args-parser.ts        |     100 |      100 |     100 |     100 |                               
 args/gha                   |     100 |      100 |     100 |     100 |                               
  gha-args-parser.ts        |     100 |      100 |     100 |     100 |                               
 configs                    |     100 |      100 |     100 |     100 |                               
  configs-parser.ts         |     100 |      100 |     100 |     100 |                               
 configs/pullrequest        |    91.3 |    96.29 |     100 |    91.3 |                               
  pr-configs-parser.ts      |    91.3 |    96.29 |     100 |    91.3 | 22-23                         
 git                        |    82.5 |    53.57 |   76.47 |   82.05 |                               
  git-cli.ts                |    62.5 |    21.42 |      60 |    62.5 | 38-43,63-67,88-89,109-110,124 
  git-client-factory.ts     |    90.9 |       60 |     100 |    90.9 | 18,46                         
  git-util.ts               |     100 |      100 |     100 |     100 |                               
  git.types.ts              |     100 |      100 |     100 |     100 |                               
 git/github                 |   91.07 |    84.61 |   88.23 |   92.59 |                               
  github-client.ts          |   91.42 |       75 |     100 |   91.42 | 66,91,104                     
  github-mapper.ts          |   84.61 |     87.5 |   77.77 |    90.9 | 28                            
  octokit-factory.ts        |     100 |      100 |     100 |     100 |                               
 git/gitlab                 |   95.18 |    65.21 |     100 |   95.18 |                               
  gitlab-client.ts          |   96.82 |       75 |     100 |   96.82 | 147,151                       
  gitlab-mapper.ts          |      90 |       60 |     100 |      90 | 23,78                         
 logger                     |   88.88 |      100 |   77.77 |   88.88 |                               
  console-logger-service.ts |      90 |      100 |   83.33 |      90 | 15                            
  logger-service-factory.ts |     100 |      100 |     100 |     100 |                               
  logger.ts                 |   66.66 |      100 |      50 |   66.66 | 13                            
 runner                     |   84.78 |      100 |   66.66 |   84.78 |                               
  runner.ts                 |   84.78 |      100 |   66.66 |   84.78 | 30-40                         
----------------------------|---------|----------|---------|---------|-------------------------------
Test Suites: 14 passed, 14 total
Tests:       103 passed, 103 total
Snapshots:   0 total

src/service/args/args-utils.ts Outdated Show resolved Hide resolved
src/service/git/github/github-client.ts Show resolved Hide resolved
src/service/git/gitlab/gitlab-client.ts Show resolved Hide resolved
@lampajr lampajr force-pushed the labels branch 2 times, most recently from 0c0d50b to d57657e Compare July 7, 2023 17:11
@lampajr lampajr requested a review from shubhbapna July 7, 2023 17:15
@shubhbapna
Copy link
Contributor

Also for the code coverage we can enable sonar cloud for the project so that for each PR we can view the coverage info on sonar cloud automatically. Wdyt?

@lampajr
Copy link
Member Author

lampajr commented Jul 9, 2023

Also for the code coverage we can enable sonar cloud for the project so that for each PR we can view the coverage info on sonar cloud automatically. Wdyt?

Yeah that is for sure a great improvement, created #50 to keep track of this :)

Copy link

@Ginxo Ginxo left a comment

Choose a reason for hiding this comment

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

LGTM, just package.json version should be upgraded right? also CHANGELOG...
many thanks for this ❤️

@lampajr
Copy link
Member Author

lampajr commented Jul 10, 2023

LGTM, just package.json version should be upgraded right? also CHANGELOG... many thanks for this heart

I created this workflow [1] to automatically update (based on diff commits) both package.json and CHANGELOG such that we do not have to do it manually. I already added release section [2] in the README.

[1] https://github.com/kiegroup/git-backporting/actions/workflows/prepare-release.yml
[2] https://github.com/kiegroup/git-backporting/#release

@Ginxo Ginxo merged commit fcc0167 into kiegroup:main Jul 10, 2023
@lampajr lampajr deleted the labels branch July 10, 2023 06:49
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.

Set Labels on Backported Pull Request
3 participants