-
Notifications
You must be signed in to change notification settings - Fork 365
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: Use nullable types in PatchExperiment [DET-6486] #3497
chore: Use nullable types in PatchExperiment [DET-6486] #3497
Conversation
✔️ Deploy Preview for determined-ui ready! 🔨 Explore the source changes: abb5727 🔍 Inspect the deploy log: https://app.netlify.com/sites/determined-ui/deploys/61f9782c12ebae00097fe8ea 😎 Browse the preview: https://deploy-preview-3497--determined-ui.netlify.app/ |
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.
the approach lgtm. I'll check it out more and get back to you in a bit
@@ -90,6 +91,25 @@ message Experiment { | |||
google.protobuf.Int32Value forked_from = 16; | |||
} | |||
|
|||
// PatchModel is a partial update to an experiment with only id required. | |||
message PatchExperiment { |
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.
👍🏼
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.
Proto (as of v3) drops any unknown fields before passing it to our Go code ( protocolbuffers/protobuf#272 , golang/protobuf#1390 ). The best way that someone can know that their unexpected change didn't happen, at the moment, is to look at the Experiment which we returned and that the field isn't added or updated. |
oh I should look into this https://developers.google.com/protocol-buffers/docs/proto3#unknowns
|
aah 34
is that how fieldmask retained unknown paths? last image here #3497 (review) looks like all the generated structs in go have an unknownFileds attached to them but that's internal |
Description
Replace the field masking / multiple queries format of
PATCH /api/v1/experiment/:id
and instead, following the Models API, accept aPatchExperiment
body with nullable types. This allows us to send a partial update{ "id": 101, "name": "new_name" }
and the other fields will be unchanged.Checklist
docs/release-notes/
.