-
Notifications
You must be signed in to change notification settings - Fork 66
feat: skip default vpc #9750
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?
feat: skip default vpc #9750
Conversation
sudomateo
left a comment
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.
Gave things a one pass after getting the API versioning stuff to work locally.
| method = POST, | ||
| path = "/v1/projects", | ||
| tags = ["projects"], | ||
| versions = VERSION_SKIP_DEFAULT_VPC.., |
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'm unsure if the operation_id is needed here.
| method = POST, | ||
| path = "/v1/projects", | ||
| tags = ["projects"], | ||
| operation_id = "project_create", |
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'm unsure if the operation_id is needed here in the versioned function.
| // License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| // file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
|
||
| //! Types that changed in v2026012900. |
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 wasn't a huge fan of the comments from previous files since they often referenced a non-existent "to" version.
| "vpc_create_params", | ||
| )); | ||
|
|
||
| if !params.project_create.skip_default_vpc { |
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'm unsure if skipping parts of sagas like this is the preferred way to handle such conditional logic but it seemed to be the cleanest method here.
| .await; | ||
| } | ||
|
|
||
| #[nexus_test(server = crate::Server)] |
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'm still figuring out tests for this. It's not pretty currently.
|
|
||
| /// Whether to skip creating the "default" VPC when the project is created. | ||
| #[serde(default)] | ||
| pub skip_default_vpc: bool, |
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 opted to use a field that defaults to false to represent the current behavior since serialization (e.g., Go) often treats omitted booleans as false. I know this has the consequence of reading like a double negative so I'm open to suggestions here. I really want the user to understand the act of skipping the creation of the default VPC must be intentional.
Added the ability to skip creating the `default` VPC when calling `project_create`. This allows users to control every aspect of their project using automation, rather than needing to delete `default` VPC first. Closes oxidecomputer/customer-support#567.
6df8c22 to
15e4839
Compare
Added the ability to skip creating the
defaultVPC when callingproject_create. This allows users to control every aspect of their project using automation, rather than needing to deletedefaultVPC first.Closes https://github.com/oxidecomputer/customer-support/issues/567.