Skip to content

Conversation

@sunshowers
Copy link
Contributor

@sunshowers sunshowers commented Nov 18, 2025

Sled Agent depends on nexus-lockstep-client via RSS, and we now ensure that nothing else that's part of one of the deployment units depends on it. (We don't treat omdb as part of a deployment unit because it doesn't participate in upgrade in the typical sense.)

Also add an expectorate test for the output of ls-apis check, similar to the existing one for ls-apis apis.

Closes #9057.

Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
@sunshowers
Copy link
Contributor Author

Testing notes

With this change:

diff --git a/dev-tools/ls-apis/api-manifest.toml b/dev-tools/ls-apis/api-manifest.toml
index 3143acd089..56556ef748 100644
--- a/dev-tools/ls-apis/api-manifest.toml
+++ b/dev-tools/ls-apis/api-manifest.toml
@@ -351,7 +351,8 @@
 # `packages` arrays in the deployment_units table above) are allowed to use this
 # API. ls-apis check will error out if the list of consumers is incorrect.
 consumers = [
-     { name = "omicron-sled-agent", reason = "RSS uses it, which isn't part of upgrade" },
+     #{ name = "omicron-sled-agent", reason = "RSS uses it, which isn't part of upgrade" },
+     { name = "omicron-nexus", reason = "Nexus uses it, which isn't part of upgrade" },
 ]
 
 [[apis]]

ls-apis check has this output:

https://gist.github.com/sunshowers/787f58ef7a34458ffdce430cb7b10129

ls-apis apis has this output:

https://gist.github.com/sunshowers/0ddf0da4ecb18d7c495abfd5ab594a85

for consumer in &check.unexpected {
let deployment_unit =
apis.server_component_unit(consumer).unwrap_or_else(|| {
panic!(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you have examples of this problem? I just want to make sure these messages are clear and actionable to people that might run into this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For example, if you say

restricted_to_consumers = [
     { name = "omicron-foobar", reason = "..." },
]

Then, at load-time we error out with:

Error: api nexus-lockstep-client specifies unknown consumer: omicron-foobar (with expected reason: ...)

This panic asserts that the load-time check has already been performed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe add "this is a bug" or something, if the expectation is that they'd never see this message?

Comment on lines +366 to +367
/// No assertions were made about this API consumer.
NoAssertion,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thoughts on: Unrestricted, meaning "this API has no configured restrictions on which consumers can use it"?

Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Copy link
Collaborator

@davepacheco davepacheco left a comment

Choose a reason for hiding this comment

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

Thanks!

for consumer in &check.unexpected {
let deployment_unit =
apis.server_component_unit(consumer).unwrap_or_else(|| {
panic!(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe add "this is a bug" or something, if the expectation is that they'd never see this message?

Created using spr 1.3.6-beta.1
@sunshowers sunshowers enabled auto-merge (squash) November 20, 2025 23:33
@sunshowers sunshowers merged commit 884d26e into main Nov 21, 2025
17 checks passed
@sunshowers sunshowers deleted the sunshowers/spr/ls-apis-check-that-only-omicron-sled-agent-depends-on-nexus-lockstep-client branch November 21, 2025 01:44
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.

ls-apis test should ensure we don't ship any unexpected consumers of the nexus-lockstep API

3 participants