Deprecate fields and methods if file is deprecated#6613
Merged
johanbrandhorst merged 2 commits intogrpc-ecosystem:mainfrom Apr 15, 2026
Merged
Deprecate fields and methods if file is deprecated#6613johanbrandhorst merged 2 commits intogrpc-ecosystem:mainfrom
johanbrandhorst merged 2 commits intogrpc-ecosystem:mainfrom
Conversation
Signed-off-by: Aidan Jensen <aidan.jensen@robust.ai>
johanbrandhorst
requested changes
Apr 15, 2026
Collaborator
johanbrandhorst
left a comment
There was a problem hiding this comment.
Some minor comments, thanks for this!
| } | ||
|
|
||
| func deprecateFieldsAndMethods(file *descriptor.File) { | ||
| if opts := file.GetOptions(); opts != nil && opts.GetDeprecated() { |
Collaborator
There was a problem hiding this comment.
Could we lift this check outside of this function so that it's clearer in the caller what's happening?
|
|
||
| content := resp[0].GetContent() | ||
|
|
||
| var doc map[string]interface{} |
Collaborator
There was a problem hiding this comment.
Please use map[string]any
Contributor
Author
Good feedback, done! |
Collaborator
|
Thanks for your contribution! |
This was referenced Apr 23, 2026
fix(deps): vuln minor upgrades — 11 packages (minor: 7 · patch: 4) [server]
DataDog/temporalio-ui#27
Closed
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.
Being able to deprecate an entire file and mark methods and fields as deprecated is nice when deprecating an entire API. I started this MR by passing a file descriptor around to the methods in template, so I could check for file level deprecation, but because of how the files are merged, individual file options are lost before templating. So instead if a file is deprecated, I propagate that option to the fields and methods, which is technically less correct, but simplifies the logic a lot.
The prior art for this is the golang code generator deprecates all fields, methods, services, etc if a file is deprecated.