Closed favmd closed 2 years ago
i can confirm that using v1.8.0
only works with a single filename. i created a PR (in a private repo) with the config changes and some dummy changes in an index.ts
file to test the ignore.
files_to_ignore: "index.ts"
β size label: xsfiles_to_ignore: "yarn.lock poetry.lock index.ts cz.json de.json en.json es.json fr.json nl.json pt.json sk.json"
β size label: xl@rgomezcasas please release a hotfix.
Thank you @szamanr for verifying this π
You're right, it gets even worse with longer lists, counting the changes multiple times.
I am not sure if what we are seeing is the same issue or a different issue, but with 1.8.0 our labeling stopped working completely. Rolling back to 1.7.0 fixed things. Here is our job:
label_size:
runs-on: ubuntu-latest
name: Label the PR size
steps:
- uses: codelytv/pr-size-labeler@v1.7.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_label: 'size/xs'
xs_max_size: '10'
s_label: 'size/s'
s_max_size: '100'
m_label: 'size/m'
m_max_size: '500'
l_label: 'size/l'
l_max_size: '1000'
xl_label: 'size/xl'
fail_if_xl: 'false'
message_if_xl: >
'Wow, this is a big boi! How might be break something like this into smaller pieces next time?'
github_api_url: 'api.github.com'
Could this be due to us not passing files_to_ignore
at all?
Dear @danielmklein
That's a very valid question and I can assure you that I had your exact case in mind when testing my feature PR:
People that just link their workflow to the latest available version or v1
and that will thus not pass the new parameter at all. I just tested the version that I currently use for our workflows once more (~> https://github.com/favmd/pr-size-labeler/commit/992a73aa3e13a366211a8e4180fd9f0886e917b4), which basically is v1.7.0
+ files_to_ignore
, and it works: without passing the parameter, with the parameter but empty string, with a one-word list, with a multi-word list (imho that should be all relevant cases).
That being said, I think you might be right in guessing that not passing files_to_ignore
causes the failure because of the fact that the diff between the previous version v1.7.0
and the current version v1.8.0
(v1
) shows that the new version does handle command line parameters in a fresh new way: ~> https://github.com/CodelyTV/pr-size-labeler/compare/v1.7.0...v1.8.0
@danielmklein I think you could test by actually passing some files to ignore. For us, it didnt fix the issue.
@favmd I reverted the code to your original implementation and it works fine π
@davidpilny Can you open a new issue with your error attaching your labeler.yml
config?
@rgomezcasas Nice π Thanks for letting me know!
Dear @rgomezcasas
thanks for testing, refactoring and merging my feature pr #33 (based on issue #9) π
But I do think that one of your changes might have added a very subtle bug.
See this code in main:
https://github.com/CodelyTV/pr-size-labeler/blob/88ab4d8199ba00e6ea8da944e59453ea7e2c6ca4/src/github.sh#L19-L27
compared to my original version:
The difference I want to point at is on line 22:
https://github.com/CodelyTV/pr-size-labeler/blob/88ab4d8199ba00e6ea8da944e59453ea7e2c6ca4/src/github.sh#L22
Does this work for
files_to_ignore
lists with more than one filename?Let's say that
files_to_ignore
='Pipfile.lock package-lock.json'
and you change your
package-lock.json
.Pipfile.lock
!=package-lock.json
?That's why you will have to loop over all filenames all the time.
Note π I haven't tested this, just compared your code to mine and this seemed like a real logical difference.
If you can confirm this, let's do a
v1.8.1
asap π