ghaction-github-labeler icon indicating copy to clipboard operation
ghaction-github-labeler copied to clipboard

use octokit plugin config from probot

Open jetersen opened this issue 4 years ago β€’ 16 comments

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

jetersen avatar Jan 08 '21 16:01 jetersen

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.

codecov[bot] avatar Jan 08 '21 16:01 codecov[bot]

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

jetersen avatar Jan 08 '21 19:01 jetersen

@crazy-max could you take a look?

jetersen avatar Jan 16 '21 18:01 jetersen

@jetersen Sure, keep you in touch.

crazy-max avatar Jan 16 '21 18:01 crazy-max

@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 avatar Jul 27 '22 15:07 jetersen

@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.

jetersen avatar Jul 27 '22 21:07 jetersen

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 avatar Jul 27 '22 21:07 crazy-max

Looking at issues with ci, might need to rebase?

crazy-max avatar Jul 27 '22 21:07 crazy-max

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 avatar Jul 27 '22 22:07 jetersen

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

jetersen avatar Jul 28 '22 02:07 jetersen

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

jetersen avatar Jul 29 '22 11:07 jetersen

@crazy-max ping ☺️

jetersen avatar Aug 07 '22 13:08 jetersen

@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 avatar Aug 11 '22 13:08 jetersen

@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.

jetersen avatar Aug 11 '22 13:08 jetersen

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!

crazy-max avatar Aug 11 '22 23:08 crazy-max

@crazy-max Fair enough!

jetersen avatar Aug 12 '22 05:08 jetersen