-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[chore] generate issue templates with githubgen #28655
Conversation
2f0724e
to
0321eca
Compare
I appreciate moving from Bash to Golang. I just wish the Golang code was easier to read. This tool's code was already quite messy before and with this change, it's getting more messy and hard to follow. From what I can understand, with this change running the
The options are inconsistent. Not passing the
We could disregard this with "this is just a tool", but reading and reviewing this code is painful or amusing depending on reviewer's approach 😉, and definitely takes more time than it could. More importantly, messy code makes it easier to introduce bugs. I propose a little rework of the tool for consistent behavior - either run all generators when no options are passed, or only run the generators explicitly specified with options, not running any generators if no option is specified. Having consistency in behavior should also make the code more comprehensible. Here's example pseudo-code for the first approach:
|
Yes. It’s painful. Especially some of the weird contortions the code has to follow to match the existing rules. We can make things a bit nicer, however note that the generators all depend on the same one time parsing. There is some state to pass around. |
I am rereading your comment, and I agree - most of my code is the stuff of comedy, and I should not code past 7pm. |
@astencel-sumo did you want to review this PR again? |
Awesome! this is so much better to read! 😍 Thank you Antoine. Just one fix is needed as the tool currently fails on the $ GITHUB_TOKEN=redacted githubgen codeowners
panic: strings: negative Repeat count
goroutine 1 [running]:
strings.Repeat({0x7e3000?, 0xc00026c5f0?}, 0x7e15b8?)
/usr/local/go/src/strings/strings.go:554 +0x318
main.codeownersGenerator.generate({}, 0xc0001e6000)
/home/andrzej/sumo/opentelemetry-collector-contrib/cmd/githubgen/codeowners.go:146 +0xa3d
main.run({0x7e15c8, 0x1}, {0x763965, 0x1b}, {0xc00002e2e0, 0x1, 0x58?})
/home/andrzej/sumo/opentelemetry-collector-contrib/cmd/githubgen/main.go:174 +0x60a
main.main()
/home/andrzej/sumo/opentelemetry-collector-contrib/cmd/githubgen/main.go:50 +0x3e9 |
Co-authored-by: Andrzej Stencel <[email protected]>
Co-authored-by: Andrzej Stencel <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Antoine!
Here's the output I'm getting now:
$ GITHUB_TOKEN=redacted githubgen
The following modules were not added to Dependabot to keep within limits of 220
- "/cmd/configschema"
- "/cmd/githubgen"
- "/cmd/mdatagen"
- "/cmd/opampsupervisor"
- "/extension/encoding/jaegerencodingextension"
- "/extension/encoding/jsonlogencodingextension"
- "/extension/encoding/textencodingextension"
- "/extension/encoding/zipkinencodingextension"
- "/extension/opampextension"
- "/receiver/splunkenterprisereceiver"
2023/10/31 15:54:53 codeowners are not members: cparkins
$ echo $?
1
Seems that cperkins
needs to be added to /cmd/githubgen/allowlist.txt
if I'm not mistaken. Not sure if this is something that should be fixed as part of this change or separately.
It needs to be fixed separately. Unfortunately, we still don't have a PAT to run this check as part of CI. Feel free to upvote open-telemetry/community#1659 |
#28855 is open to fix this issue. |
I guess this can be merged now? |
@atoulme can you confirm this is good to merge now? |
yes, good to merge, thanks! |
Remove a bash script, use go code instead. --------- Co-authored-by: Andrzej Stencel <[email protected]>
Remove a bash script, use go code instead.