Conversation
Avoid creating an update-gadget-cmdline task before seeding, when its handler would be a no-op. Discussion: canonical#17483 (comment)
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #17682 +/- ##
==========================================
- Coverage 78.52% 78.39% -0.14%
==========================================
Files 1418 1417 -1
Lines 200500 200463 -37
Branches 2502 2503 +1
==========================================
- Hits 157444 157145 -299
+ Misses 33945 33915 -30
- Partials 9111 9403 +292
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The logging checker no longer validates child ensures beneath renamed submanager entry points.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Centralizes seed readiness and device-context resolution in manager Ensure paths.
Changes:
- Renames post-seed helpers and passes resolved device contexts explicitly.
- Tightens readiness gates for device, service, refresh, and management work.
- Expands readiness, cache-lifecycle, and Ensure logging tests.
| File | Description |
|---|---|
overlord/swfeats/swfeatstest/ensurelogchecker.go |
Supports renamed submanager Ensure methods. |
overlord/swfeats/swfeatstest/ensurelogchecker_test.go |
Tests EnsureAfterSeed logging. |
overlord/snapstate/snapstate_update_test.go |
Updates auto-refresh references. |
overlord/snapstate/snapstate_test.go |
Tests seeded work and transition gating. |
overlord/snapstate/snapmgr.go |
Centralizes seed/context checks and post-seed dispatch. |
overlord/snapstate/refreshhints.go |
Accepts a resolved device context. |
overlord/snapstate/export_test.go |
Adapts test-facing Ensure helpers. |
overlord/snapstate/catalogrefresh.go |
Moves seed/context prerequisites to the manager. |
overlord/snapstate/autorefresh.go |
Renames the post-seed entry point. |
overlord/snapstate/autorefresh_test.go |
Updates auto-refresh tests. |
overlord/servicestate/servicemgr_test.go |
Tests missing post-seed context. |
overlord/devicestate/export_test.go |
Adapts cloud-init test helper. |
overlord/devicestate/devicestate_test.go |
Tests readiness and early-seed cache lifecycle. |
overlord/devicestate/devicestate_cloudinit_test.go |
Tests pre-seed cloud-init gating. |
overlord/devicestate/devicemgr.go |
Passes context through post-seed device helpers. |
overlord/devicemgmtstate/devicemgmtmgr_test.go |
Tests pre-seed exchange gating. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Tue Sep 22 09:33:05 UTC 2026 Test Predictor AnalysisPreparing
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 of the below tests you wish to run (unskip plus test list must be valid yaml)
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The logging checker can validate the wrong method when a submanager defines multiple Ensure-prefixed methods.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Resolved since last review (1)
Teach the checker to inspect child ensure calls from renamed submanager entry points such as EnsureAfterSeed, instead of assuming the entry point is always Ensure. Preserve the exact receiver and method called by the parent when selecting a submanager declaration, so files with multiple Ensure-prefixed methods are checked correctly. Reuse the AST call traversal and replace textual cross-file method lookup with AST matching.
fec4e3f to
6625226
Compare
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It changes boot-time sequencing and device-context lifecycle across several core state managers, warranting final human validation.
Review effort: Balanced
Findings: None
Resolved since last review (1)
| } | ||
| if !seeded { | ||
| return nil | ||
| } |
There was a problem hiding this comment.
this and the others cleaned up nicely
| // of snap files if the units are modified as services | ||
| // in the snap have a Requires= on them. Otherwise the | ||
| // services would be restarted. | ||
| // This is especially relevant for the snapd snap as if |
There was a problem hiding this comment.
| // This is especially relevant for the snapd snap as if |
| // TODO refactor so the check for kernel type is not repeated | ||
| // in the installation case |

This is phase 2 of the Ensure refactor started in #17483 It completes the move from repeated prerequisite checks in leaf methods to resolving seed readiness and device context once in each manager’s Ensure.
Passes resolved DeviceContext values into dependent device and snap ensure helpers.
Makes post-seeding dependencies explicit through EnsureAfterSeed/ensure...AfterSeed naming and removes redundant seeded, model, and context lookups.
Preserves pre-seed, at-seed, and post-seed ordering and error aggregation.
Tightens readiness gates for device-management exchanges, service updates, and kernel command-line fragment application.
Extends tests for readiness gates, early-seed cache lifecycle, and EnsureAfterSeed logging.