-
Notifications
You must be signed in to change notification settings - Fork 88
task: improve autogeneration integration with other tools #3706
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
Conversation
| // | ||
| // This code was autogenerated using `make gen-L1-commands` | ||
|
|
||
| // Code generated using `make gen-api-commands`. DO NOT EDIT. |
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.
GH will consider any file with // Code generated ... as auto generated
Intellij will show a warning when opening files with DO NOT EDIT.
| @@ -1,4 +1,5 @@ | |||
| {{- /* Template for generating L1 commands */ -}} | |||
| {{- /*gotype: github.com/mongodb/mongodb-atlas-cli/atlascli/internal/api.GroupedAndSortedCommands */ -}} | |||
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.
intellij type hint
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.
this file has a year that auto-updates which means tests will start failing on January next year
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.
yeap, we will need to regenerate the snapshots once a year, I think that is ok, better the write 2024 like before
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.
copyright years don't need to be updated FYI, we also skip the whole copyright header on some autogenerated files like mocks and we tell the checks to ignore those folders, just things to consider if this becomes a problem
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.
on old files is ok, but generating new files on old dates seems weird.
Proposed changes
Improve the generate code to leverage tools conventions for detecting autogenerated code
As a side note I find a bit confusing I need to run
make bin/api-generatorif I do changes to the generation code since make will cache the bin and won't try to rebuild, I wonder why we went with a pre-built binary overgo run