Skip to content

Conversation

@sudomateo
Copy link
Contributor

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 https://github.com/oxidecomputer/customer-support/issues/567.

Copy link
Contributor Author

@sudomateo sudomateo left a 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..,
Copy link
Contributor Author

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",
Copy link
Contributor Author

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.
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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)]
Copy link
Contributor Author

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,
Copy link
Contributor Author

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants