Skip to content

o/devicestate: add seed allowlist to recovery-system creation - #17410

Open
andrewphelpsj wants to merge 3 commits into
canonical:masterfrom
andrewphelpsj:seed-refresh-allowlist
Open

o/devicestate: add seed allowlist to recovery-system creation#17410
andrewphelpsj wants to merge 3 commits into
canonical:masterfrom
andrewphelpsj:seed-refresh-allowlist

Conversation

@andrewphelpsj

@andrewphelpsj andrewphelpsj commented Jul 24, 2026

Copy link
Copy Markdown
Member

We need to enable seed-refresh to tell create-recovery-system that it shouldn't include some snaps/components in the seed, even if it technically could. This allowlist concept enables that.

I've split this into two commits to make things easier on reviewers. First commit is only additive, then I clean up some dead code in the final commit.

@github-actions github-actions Bot added the Run only one system Only runs spread tests on one system label Jul 24, 2026
@andrewphelpsj
andrewphelpsj force-pushed the seed-refresh-allowlist branch from b903b4e to a312da3 Compare July 24, 2026 19:01
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown

Fri Jul 24 21:21:14 UTC 2026
The following results are from: https://github.com/canonical/snapd/actions/runs/30126830308

No spread failures reported

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.92308% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.83%. Comparing base (887e6cc) to head (a312da3).

Files with missing lines Patch % Lines
overlord/devicestate/devicestate.go 75.00% 16 Missing and 8 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #17410      +/-   ##
==========================================
- Coverage   78.90%   78.83%   -0.08%     
==========================================
  Files        1393     1405      +12     
  Lines      196467   196821     +354     
  Branches     2462     2462              
==========================================
+ Hits       155026   155165     +139     
- Misses      32113    32309     +196     
- Partials     9328     9347      +19     
Flag Coverage Δ
unittests 78.83% <76.92%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@andrewphelpsj andrewphelpsj left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Working on a spread test, will add that when finished.

LocalComponents []snapstate.PathComponent `json:"local-components,omitempty"`
// SeedAllowlist identifies the snaps and components that may be used
// to create the recovery system.
SeedAllowlist *SeedAllowlist `json:"seed-allowlist,omitempty"`

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Using nil here enables other callers to not have to provide a full allowlist. This keeps remodeling working.

@andrewphelpsj
andrewphelpsj force-pushed the seed-refresh-allowlist branch 2 times, most recently from a63363f to d504d29 Compare July 24, 2026 20:07

model_json="$(pwd)/model.json"
sed \
-e "s/@@VERSION@@/${version}/g" \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is nice! I'll be inspired by this for the other spread test.

@andrewphelpsj
andrewphelpsj force-pushed the seed-refresh-allowlist branch from d504d29 to fd881cd Compare July 24, 2026 21:10
Let seed-refresh preserve the current seed's optional snap and component
membership instead of adding every installed optional container.
@andrewphelpsj
andrewphelpsj force-pushed the seed-refresh-allowlist branch from fd881cd to db5e584 Compare July 24, 2026 21:11
@andrewphelpsj
andrewphelpsj marked this pull request as ready for review July 24, 2026 21:16
@github-actions github-actions Bot removed the Run only one system Only runs spread tests on one system label Jul 24, 2026
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