-
Notifications
You must be signed in to change notification settings - Fork 222
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
Fix versioning override with AutoUpgrade behavior #1765
Merged
antlai-temporal
merged 5 commits into
temporalio:master
from
antlai-temporal:fix-versioning-override
Jan 8, 2025
+49
−5
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
eace425
Fix versioning override with AutoUpgrade behavior
antlai-temporal 5799109
Fix comment
antlai-temporal 8d386d6
Add comment
antlai-temporal ee19542
Merge remote-tracking branch 'upstream/master' into fix-versioning-ov…
antlai-temporal da72344
Merge remote-tracking branch 'upstream/master' into fix-versioning-ov…
antlai-temporal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.
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.
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.
Why not make the source of this a pointer if unset is a valid state? Meaning, make
VersioningOverride.Deployment
accept a pointer.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.
I thought it was cleaner not to expose pointers and just use an empty struct. Otherwise you ended up with what "a pointer to an empty struct" means vs a nil pointer. It is also consistent with the other apis that use Deployment.
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.
It sounds like the server treats an empty struct here as invalid and errors is that correct?
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.
If there is a difference between empty and null in the server-side API and we need to represent that difference, we should do the same here. If the server errors on empty, good, that tells the user it was invalid like it might for anything else invalid. If the server wants to treat empty and null as the same, we can too.
Are there other fields where the zero value of a struct means nil when converting to proto? I think we should consider fixing those too.
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.
Yes, other empty structs related to deployment are ok, but this one was not... They may eventually fix that, but this is
blocking the autoUpgrade override...
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.
@cretz There was a difference but it was not intentional, there should be no difference. It is just that the OSS server release is out, and it is better to fix it internally in the first SDK release without exposing it, and eventually change it in the server...
All the other values that I can think of would take either empty or nil. I mapped VersioningOverride{} to nil mostly to keep things more clear, but I don't think it is strictly needed.
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.
Can we add a comment explaining this so future readers understand why we are inconsistent here?
If the server will always treat nil and empty the same then I am fine using an empty struct instead of a pointer.
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.
Comment added