Skip to content

overlord: integrate delayed effects into the bunch#16690

Open
bboozzoo wants to merge 7 commits intocanonical:masterfrom
bboozzoo:bboozzoo/delayed-effects-final-boss
Open

overlord: integrate delayed effects into the bunch#16690
bboozzoo wants to merge 7 commits intocanonical:masterfrom
bboozzoo:bboozzoo/delayed-effects-final-boss

Conversation

@bboozzoo
Copy link
Contributor

Integrated delayed security backend side effects into the rest of the code. The set of changes appears to be large, but the actual non-test change is ~100 lines or so.

Related: SNAPDENG-35950 SNAPDENG-36410

@github-actions github-actions bot added the Needs Documentation -auto- Label automatically added which indicates the change needs documentation label Feb 27, 2026
@bboozzoo bboozzoo requested a review from Copilot February 27, 2026 13:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request integrates delayed security backend side effects into snapd's snap installation and update workflows. The feature allows security backend setup operations to delay certain mount namespace side effects until snap operations complete successfully, improving efficiency when multiple snaps are affected by a single change (e.g., when a content provider snap is updated and has multiple connected consumers).

Changes:

  • Adds a new NoDelayedSideEffects flag to control whether side effects should be delayed or applied immediately
  • Integrates delayed effects processing into install and update workflows by adding ProcessDelayedSecurityBackendEffects tasks
  • Modifies test infrastructure to mock delayed effects processing and updates ~100 tests to accommodate the new task in their expectations
  • Adds comprehensive spread test to verify delayed effects behavior with content provider/consumer snaps

Reviewed changes

Copilot reviewed 30 out of 33 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
overlord/snapstate/snapstate.go Core integration adding setupDelayedSecurityBackendEffects() helper and updating install/update flows to create delayed effects tasks
overlord/snapstate/target.go Updates InstallOne() and InstallWithGoal() to handle delayed effects tasksets, with special logic to merge tasksets for single-snap operations
overlord/snapstate/flags.go Adds NoDelayedSideEffects flag to control behavior
overlord/snapstate/handlers.go Exports ProcessDelayedSecurityBackendEffects hook for interface state integration
overlord/ifacestate/ifacestate.go Implements ProcessDelayedSecurityBackendEffects() to create monitoring tasks
overlord/devicestate/*.go Disables delayed effects for device state operations (firstboot, remodel) where they're not needed
overlord/snapstate/*_test.go Updates ~100 unit tests to expect additional delayed effects tasks in tasksets
overlord/managers_test.go Adds verification helpers and updates integration tests
overlord/hookstate/ctlcmd/*.go Updates service control logic to not create dependencies on freestanding delayed effects tasks
tests/main/layout-content-delayed-effects/ New spread test validating delayed effects with content connections

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 94.31818% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.54%. Comparing base (2e9abce) to head (a5802b1).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
overlord/snapstate/target.go 82.35% 2 Missing and 1 partial ⚠️
overlord/snapstate/handlers.go 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #16690      +/-   ##
==========================================
- Coverage   77.54%   77.54%   -0.01%     
==========================================
  Files        1359     1359              
  Lines      187378   187381       +3     
  Branches     2446     2446              
==========================================
- Hits       145301   145296       -5     
- Misses      33295    33299       +4     
- Partials     8782     8786       +4     
Flag Coverage Δ
unittests 77.54% <94.31%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

@bboozzoo bboozzoo force-pushed the bboozzoo/delayed-effects-final-boss branch from 7b9dfd7 to d05da61 Compare February 27, 2026 13:28
@github-actions
Copy link

github-actions bot commented Feb 27, 2026

Fri Feb 27 15:41:46 UTC 2026
The following results are from: https://github.com/canonical/snapd/actions/runs/22488455988

Failures:

Preparing:

  • openstack-ext:ubuntu-18.04-64:tests/nested/manual/devmode-snaps-can-run-other-snaps
  • openstack-ext:ubuntu-18.04-64:tests/nested/classic/activate-state
  • openstack-ext:ubuntu-18.04-64:tests/nested/classic/hotplug
  • openstack-ext:ubuntu-20.04-64:
  • openstack-ext:ubuntu-24.04-64:tests/nested/core/interfaces-custom-devices
  • openstack-ext:ubuntu-24.04-64:tests/nested/manual/kernel-modules-components:encrypted
  • openstack-ext:ubuntu-24.04-64:tests/nested/manual/hybrid-fde-recovery-keys
  • openstack-ext:ubuntu-24.04-64:tests/nested/manual/uc-grub-boot-chains
  • openstack:ubuntu-20.04-64:tests/main/interfaces-pulseaudio
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-snapd-startup
  • openstack:ubuntu-24.04-64:tests/main/lxd-try

Executing:

  • openstack:debian-12-64:tests/main/auto-refresh-pre-download:restart
  • openstack-ext:ubuntu-22.04-64:tests/nested/core/core20-degraded
  • openstack-ext:ubuntu-22.04-64:tests/nested/core/core20-reinstall-partitions
  • openstack-ext:ubuntu-22.04-64:tests/nested/manual/core20-remodel
  • openstack-ext:ubuntu-24.04-64:tests/nested/manual/core-broken-fde-state
  • openstack-ext:ubuntu-24.04-64:tests/nested/manual/core-shim-update-revokes-old-keys
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-factory-reset:fde
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/remount-hotplug
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/minimal-smoke:secboot_enabled
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/minimal-smoke:secboot_disabled
  • openstack:ubuntu-core-20-64:tests/main/degraded
  • openstack:ubuntu-core-24-64:tests/core/kernel-base-gadget-pair-single-reboot-failover:gadget_base
  • openstack:ubuntu-20.04-64:tests/unit/go:gcc
  • openstack:ubuntu-24.04-64:tests/main/prepare-image-gating:fetched

Restoring:

  • openstack:ubuntu-core-24-64:tests/core/kernel-base-gadget-pair-single-reboot-failover:gadget_base
  • openstack:ubuntu-core-24-64:tests/core/
  • openstack:ubuntu-core-24-64:
  • openstack:ubuntu-24.04-64:tests/main/prepare-image-gating:fetched
  • openstack:ubuntu-24.04-64:tests/main/
  • openstack:ubuntu-24.04-64:

Skipped tests from snapd-testing-skip

  • openstack:ubuntu-24.04-64:tests/main/i18n

Integrate delayed backend effects into snapstate. Update relevant tests.

Related: SNAPDENG-35950 SNAPDENG-36410

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
Fix dependencies of injected service commands. Make sure to avoid
introducing unresolvable wait cycles with freestanding tasks.

Related: SNAPDENG-35950

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
@bboozzoo bboozzoo force-pushed the bboozzoo/delayed-effects-final-boss branch from d05da61 to a5802b1 Compare February 27, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Documentation -auto- Label automatically added which indicates the change needs documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants