algod: Rename enums by default#5089
Merged
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5089 +/- ##
==========================================
+ Coverage 53.53% 53.56% +0.02%
==========================================
Files 430 430
Lines 54086 54086
==========================================
+ Hits 28954 28969 +15
+ Misses 22880 22866 -14
+ Partials 2252 2251 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
algochoi
approved these changes
Feb 1, 2023
Contributor
algochoi
left a comment
There was a problem hiding this comment.
Thanks for this PR - I think this is a good improvement as changing existing type names when regenerating code seems undesirable and confusing. I also thing there is a nice improvement in getCodecHandle that will make it more robust to future changes. I didn't see any existing references to the other changed field names either (Acfg -> TxTypeAcfg), so I will leave a soft vote of approval.
winder
approved these changes
Feb 2, 2023
This was referenced Mar 10, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@algochoi noticed that some of the values for enums in our generated models had inconsistent naming. For example, https://github.com/algorand/go-algorand/blob/master/daemon/algod/api/server/v2/generated/model/types.go#L117 is named
Jsonwhereas all other parameters have their type name prefixed.This is because we are not setting https://github.com/deepmap/oapi-codegen/blob/f4cf8f9a570380c24c6ba03ae04b9393cf120692/pkg/codegen/configuration.go#L66
AlwaysPrefixEnumValues. I've set that for our model and regenerated them, fixing issues that I saw come up because of it.This means that every enum value will have its name prefixed, not just those where a naming conflict is detected.