o/snapstate: set userID from snapst and from opts as fallback for component installation - #17047
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates component installation to consistently choose the store user based on the snap’s recorded SnapState.UserID, falling back to Options.UserID when needed. This aligns component-only installation behavior with how snap operations typically preserve/propagate the “owning” user for store interactions.
Changes:
- Use
userIDForSnap(st, &snapst, opts.UserID)when determining the user for component install store queries. - Extend the component install test to validate the userID passed through to recorded store
SnapActionoperations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
overlord/snapstate/component.go |
Switches component install store-user selection to prefer SnapState.UserID with fallback to Options.UserID. |
overlord/snapstate/component_install_test.go |
Adds assertions ensuring the chosen userID is propagated into store action ops recorded by the fake backend. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #17047 +/- ##
==========================================
- Coverage 79.07% 79.06% -0.02%
==========================================
Files 1375 1375
Lines 191478 191658 +180
Branches 2465 2465
==========================================
+ Hits 151419 151532 +113
- Misses 30949 31002 +53
- Partials 9110 9124 +14
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:
|
…ponent installation
5fc7550 to
ccc22c0
Compare
|
Tue May 19 09:53:49 UTC 2026 Failures:Preparing:
Executing:
Restoring:
Skipped tests from snapd-testing-skipIf you wish to have any of the below tests run in your PR, in your PR description, add 'unskip:' followed by a copy-and-pasted list (without variants) of the below tests you wish to run (unskip plus test list must be valid yaml)
|
|
Test failures mentioned in #17047 (comment) are not related to the current PR changes |
Follows #17020
This resolves LP2110368 the issue of installing a component for a private snap from within the snap using snapctl. See test results.
SNAPDENG-36844