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: label issue closing PRs as bugfixes #60287

Merged
merged 1 commit into from
Aug 28, 2022

Conversation

casswedson
Copy link
Contributor

@casswedson casswedson commented Aug 19, 2022

Summary

None

Purpose of change

someone once said it would be a good idea to label prs that use
any closing keywords as bugfixes, I took a mental note of that and
immediately forgor about it, oops!

implement that idea; to be specific you gotta add any of these
keywords:
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
close
closes
closed
fix
fixes
fixed
resolve
resolves
# and an issue number, the regex for this specific bit was borrowed
from one of the commands in the cdda discord server #([1-9][0-9]{3,4})
also increase the upper limit of an issue number up to 7

I had to repeat the bugfix labeler entry cuz YAML do be like that

big point this specific labeler workflow happen to be case sensitive, I
take this compromise, the "fix it" or looking for a different labeler
are ehh options honestly
scratch that, I remembered how regex works

website to see this regex in action, string to test included
https://regex101.com/r/pBIUNe/1

or just take a look at this
Screenshot from 2022-08-19 17-51-47

Describe the solution

Describe alternatives you've considered

Testing

casswedson/issue-labeling#23
casswedson/issue-labeling#24

Additional context

@github-actions github-actions bot added Code: Tooling Tooling that is not part of the main game but is part of the repo. astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Aug 19, 2022
@Qrox
Copy link
Contributor

Qrox commented Aug 19, 2022

Might want to actually use the feature/bug label of the issue to be closed, but I'm not sure how doable is that.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Aug 19, 2022
@casswedson
Copy link
Contributor Author

I don't quite get what you mean by that

someone once said it would be a good idea to label prs that use
any closing keywords as bugfixes, I took a mental note of that and
immediately forgor about it, oops!

implement that idea; to be specific you gotta add any of these
keywords:
close
closes
closed
fix
fixes
fixed
resolve
resolves
`#` and an issue number, the regex for this specific bit was borrowed
from one of the commands in the cdda discord server `#([1-9][0-9]{3,4})`
+ increase the upper limit of an issue number up to 7

I had to repeat the bugfix labeler entry cuz YAML do be like that

website to see this regex in action, string to test included
https://regex101.com/r/pBIUNe/1
@Qrox
Copy link
Contributor

Qrox commented Aug 20, 2022

I mean a PR that closes a issue is not necessarily a bugfix: it could close a feature request, add some requested documentation, etc, so it would be better to use the issue's label to determine what label to add to the PR.

@casswedson
Copy link
Contributor Author

That's certainly possible, tho fairly complicated; I think this (+some of the other autolabeling) covers most cases at a satisfying level, like if the pr adds documentation it gets the docs label, other things like features/enhancement need author input, not bad if you ask me

@dseguin dseguin merged commit 2038c37 into CleverRaven:master Aug 28, 2022
@casswedson casswedson deleted the label-as-bugfix branch August 28, 2022 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions Code: Tooling Tooling that is not part of the main game but is part of the repo. json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants