-
Notifications
You must be signed in to change notification settings - Fork 26
ENG-1760: add moose versions to inframap #3435
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,6 +23,10 @@ message InfrastructureMap { | |||||||||||||
| map<string, SqlResource> sql_resources = 12; | ||||||||||||||
| map<string, WebApp> web_apps = 13; | ||||||||||||||
|
|
||||||||||||||
| // Version of Moose CLI that created or last updated this infrastructure map | ||||||||||||||
| // Helps with debugging, compatibility tracking, and migration planning | ||||||||||||||
| string moose_version = 14; | ||||||||||||||
|
Comment on lines
+26
to
+28
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Consider using The Rust side treats this as Suggested change // Version of Moose CLI that created or last updated this infrastructure map
// Helps with debugging, compatibility tracking, and migration planning
- string moose_version = 14;
+ optional string moose_version = 14;As per coding guidelines: "Use 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not use optional here? that will make sure we have an Option in the Rust code I believe
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Currently, the code works around the non-optional field by treating empty strings as Using
The suggestion to change it to 🧠 Learnings used
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So by default strings with an empty value already represent an optional empty state. This is the same as if we got a proto message with no message field as well when we try to deserailize. Optional is a bad paradigm to use in protobuf so we should stick away from that as there is no actual advantage. We already handle it correctly above.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe we had that impression with @phiSgr and we actually had an issue in prod. That's why we are putting optional
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was added in a way to be backwards compatible since protobuf comes with strong support for that without optional. In reality this item is not actually optional its always required its just that previous versions of the message may not have it hence why it got tag 14 which is new allowing protobuf to skip over it if the code doesn't support tag 14 yet or to decode it either via a default value if it doesn't exist or the real value. If we had issues with protobuf in prod happy to take a peek at why. |
||||||||||||||
|
|
||||||||||||||
| string default_database = 15; | ||||||||||||||
|
|
||||||||||||||
| // Structured materialized views (replaces SqlResource for MVs) | ||||||||||||||
|
|
||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.