-
Notifications
You must be signed in to change notification settings - Fork 62
[ls-apis] check that only omicron-sled-agent depends on nexus-lockstep-client #9413
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
[ls-apis] check that only omicron-sled-agent depends on nexus-lockstep-client #9413
Conversation
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Testing notesWith 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]]
https://gist.github.com/sunshowers/787f58ef7a34458ffdce430cb7b10129
https://gist.github.com/sunshowers/0ddf0da4ecb18d7c495abfd5ab594a85 |
| for consumer in &check.unexpected { | ||
| let deployment_unit = | ||
| apis.server_component_unit(consumer).unwrap_or_else(|| { | ||
| panic!( |
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.
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.
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.
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.
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.
Maybe add "this is a bug" or something, if the expectation is that they'd never see this message?
| /// No assertions were made about this API consumer. | ||
| NoAssertion, |
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.
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
davepacheco
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.
Thanks!
| for consumer in &check.unexpected { | ||
| let deployment_unit = | ||
| apis.server_component_unit(consumer).unwrap_or_else(|| { | ||
| panic!( |
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.
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
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 forls-apis apis.Closes #9057.