crazy-max / ghaction-github-labeler

GitHub Action to manage labels on GitHub
https://github.com/marketplace/actions/github-labeler
MIT License
143 stars 17 forks source link

use octokit plugin config from probot #125

Open jetersen opened 3 years ago

jetersen commented 3 years ago

fixes #9 fixes #3

So probot's config plugin is really cool in that it supports extends which gives support for central loading of labels config.

The config plugin also allows us to load the config via api.

I implemented tests and chose to use nock as a way to avoid messing with the actual GitHub api.

You can see the use case here: https://github.com/Specshell/.github/blob/main/.github/workflows/labels.yml https://github.com/Specshell/.github/blob/main/.github/labels.yml https://github.com/Specshell/specshell.software.maven.pom/blob/main/.github/workflows/labels.yml https://github.com/Specshell/specshell.software.maven.pom/blob/main/.github/labels.yml

in the .github repo we want to have central control and using repository dispatch event we can trigger label updates when there are changes to the .github/labels.yml in .github repo

codecov[bot] commented 3 years ago

Codecov Report

Merging #125 (dc49321) into master (e3f5171) will increase coverage by 1.21%. The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #125      +/-   ##
==========================================
+ Coverage   60.13%   61.34%   +1.21%     
==========================================
  Files           2        2              
  Lines         148      163      +15     
  Branches       22       26       +4     
==========================================
+ Hits           89      100      +11     
  Misses         45       45              
- Partials       14       18       +4     
Impacted Files Coverage Ξ”
src/labeler.ts 59.60% <80.00%> (+1.51%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data Powered by Codecov. Last update e3f5171...dc49321. Read the comment docs.

jetersen commented 3 years ago

Merging two files does work, but writing a tests for it. Proves difficult and properly needs a merging for the too labels array.

jetersen commented 3 years ago

@crazy-max could you take a look?

crazy-max commented 3 years ago

@jetersen Sure, keep you in touch.

jetersen commented 2 years ago

@crazy-max if your still interested in this.

I'll try and revive it. πŸ˜…

Looking at the action marketplace for label syncs this one is the closest to my use case and I think it still would benefit from using github api to load the yaml file and potentially deep merge with an .github org repo.

jetersen commented 2 years ago

@crazy-max I don't recall the issue you noticed regarding logging.

I don't see any issues locally.

Seems like you need to approve my workflows, so we could get another test run and see the output.

crazy-max commented 2 years ago

Seems like you need to approve my workflows, so we could get another test run and see the output.

Approved

if your still interested in this.

Yes I'm! Will dig this up asap thanks!

crazy-max commented 2 years ago

Looking at issues with ci, might need to rebase?

jetersen commented 2 years ago

I forgot to update the yarn lock.

I would prefer squash merge tbh.

If you want to avoid having to constantly approve my workflow you could add me with a triage permission. I think that should get past the permissions. Although if you would like I would not mind help you maintain the action!

jetersen commented 2 years ago

Running docker buildx bake validate test passes now locally as well. Sorry I was on windows, did not check with Linux πŸ—‘οΈ

jetersen commented 2 years ago

@crazy-max gentle reminder :) I believe this is ready

jetersen commented 2 years ago

@crazy-max ping ☺️

jetersen commented 2 years ago

@crazy-max do you mind trigger the build or at least adding me to triage?

Or perhaps I submit another PR with small bit to get permissions. πŸ˜…

jetersen commented 2 years ago

@crazy-max created https://github.com/crazy-max/ghaction-github-labeler/pull/171 to solve the permissions issue πŸ˜…

Would like to know how GitHub Action sees the test. As you mentioned you notice something off with it.

crazy-max commented 2 years ago

Can you rebase with master branch please? There are also changes that should not belong to this PR like changes with eslint, tsconfig, dependencies update or other refactoring. Can we do that in a follow-up instead. I prefer changes in a PR as focused as possible and related to the bug fix or enhancement it provides. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests. Thanks!

jetersen commented 2 years ago

@crazy-max Fair enough!