Skip to content

Conversation

@sunshowers
Copy link
Contributor

Migrate the downstairs admin and repair APIs to being API traits.

Part of oxidecomputer/omicron#8922.

Created using spr 1.3.6-beta.1
Copy link
Contributor

@jmpesp jmpesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions:

// Repair API types
#[derive(Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct Eid {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed any more? It looks like it was replaced with ExtentPath in extent_repair_ready and get_files_for_extent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah -- would you prefer I rename this back to Eid or keep it as ExtentPath?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either works, whatever matches our convention - ExtentPath has less of a naming collision than Eid haha.

Cargo.toml Outdated
Comment on lines 142 to 143
crucible-downstairs-admin-api = { path = "./downstairs-admin-api" }
crucible-downstairs-repair-api = { path = "./downstairs-repair-api" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why two separate API traits here? They're both for the Downstairs, and (I think?) should be versioned together.

Copy link
Contributor Author

@sunshowers sunshowers Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, so both could live in the same crate, I thought you'd prefer the opposite haha.

The reason I did this is that crucible-downstairs-repair's OpenAPI document is checked into crucible, but the crucible-downstairs-admin document is not checked in. I figured that separating the two makes the most sense because they have different characteristics. But if you prefer they live in the same crate that's fine too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't had my head in this space but I think they should live in the same crate, it seems easier to map downstairs version to one api version instead of two separate ones.

It might be an oversight to not have checked in the admin document, but: if both traits are combined that'll mean that the combined document should cover both right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be an oversight to not have checked in the admin document, but: if both traits are combined that'll mean that the combined document should cover both right?

So yes, but at the moment it isn't possible to combine multiple traits into one document -- this is work that we deferred, there isn't anything fundamental about traits that makes them impossible to combine.

Created using spr 1.3.6-beta.1
@sunshowers sunshowers requested a review from jmpesp August 30, 2025 04:48
@sunshowers sunshowers merged commit 4c0952c into main Sep 8, 2025
17 checks passed
@sunshowers sunshowers deleted the sunshowers/spr/crucible-downstairs-migrate-to-api-traits branch September 8, 2025 20:43
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