-
Notifications
You must be signed in to change notification settings - Fork 604
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
many: make API confdb reads load ephemeral data #15209
Conversation
Load ephemeral confdb data when reading from the API (for snap get). This requires making the read side of the API async, since it might be necessary to run hooks. The result in then transmitted through the change to the client. In case there are no custodian hooks to run, no tasks are run and the result is just directly placed into a "done" change. Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
Thu Mar 20 11:07:54 UTC 2025 Failures:Preparing:
Executing:
Restoring:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #15209 +/- ##
==========================================
- Coverage 78.09% 78.08% -0.01%
==========================================
Files 1190 1192 +2
Lines 158458 158979 +521
==========================================
+ Hits 123746 124138 +392
- Misses 27017 27110 +93
- Partials 7695 7731 +36
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Thank you, small nitpick comments
cmd/snap/cmd_get.go
Outdated
@@ -76,14 +78,14 @@ func init() { | |||
} | |||
|
|||
addCommand("get", shortGetHelp, longGetHelp, func() flags.Commander { return &cmdGet{} }, | |||
map[string]string{ | |||
waitDescs.also(map[string]string{ |
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.
if the get command won't support --no-wait, why have it in the args description? the x.NoWait
check below should be enough, no?
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.
snap
expects a description for each option so if it's not included here, the parser creation panics. But I agree, this will look a bit confusing. I was trying to avoid making a new mixin but I'll do that. It'll be basically the same as the waitMixin but without NoWait
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.
Actually, cmdWatch
also uses waitMixin without NoWait and it was using it in a hacky way, so a new mixin makes more sense than I thought
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
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.
Thank you!
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.
Thank you!
Load ephemeral confdb data when reading from the API (for snap get). This requires making the read side of the API async, since it might be necessary to run hooks. The result in then transmitted through the change to the client. In case there are no custodian hooks to run, no tasks are run and the result is just directly placed into a "done" change.
This change turned out to be larger than I thought due to the API changes. The changes to the API are relatively simple but they required basically a re-write of the tests which blew up the diff. I can split the changes, if needed