Skip to content

wrappers/internal: Add implicit graphical user daemons (#16326)#16687

Open
sergio-costas wants to merge 1 commit intocanonical:masterfrom
sergio-costas:add-implicit-graphical-user-daemons-dependent-version
Open

wrappers/internal: Add implicit graphical user daemons (#16326)#16687
sergio-costas wants to merge 1 commit intocanonical:masterfrom
sergio-costas:add-implicit-graphical-user-daemons-dependent-version

Conversation

@sergio-costas
Copy link
Contributor

This is the third of three PRs to replace #16601 It requires #16685 and #16686

This is an implicit implementation of graphical user daemons. Here, if an user-scoped daemon has the Wayland or the X11 plugs defined, it is presumed that it requires access to the desktop graphical environment, so it will depend on graphical-session.target instead of the default target.

It implements the implicit way of SD-230.

It also fixes all the problems with Gnome 50.

This PR is an alternative to #16091

  • Add "s" (for seconds) in tests

  • Added test for desktop daemons

  • Fix typo

  • Added execute

  • Check that the test works

  • Update tests/lib/snaps/test-user-daemon-in-graphical-environment/task.yaml

Co-authored-by: Oliver Calder oliver@calder.dev

  • Update wrappers/internal/service_unit_gen.go

Co-authored-by: Marco Trevisan mail@3v1n0.net

  • Added test for dbus daemons

  • Moved test into tests/main

  • Requested changes

  • Test to see if this is being run

  • Remove error

  • Update tests/main/test-user-daemon-in-graphical-environment/test-implicit-graphical-user-daemon/meta/snap.yaml

Co-authored-by: Oliver Calder oliver@calder.dev

  • Update tests/main/test-user-daemon-in-graphical-environment/test-implicit-graphical-user-daemon/meta/snap.yaml

Co-authored-by: Oliver Calder oliver@calder.dev

  • Update tests/main/test-user-daemon-in-graphical-environment/test-implicit-graphical-user-daemon/meta/snap.yaml

Co-authored-by: Oliver Calder oliver@calder.dev

  • Update tests/main/test-user-daemon-in-graphical-environment/test-implicit-graphical-user-daemon/meta/snap.yaml

Co-authored-by: Oliver Calder oliver@calder.dev

  • Update tests/main/test-user-daemon-in-graphical-environment/task.yaml

Co-authored-by: Oliver Calder oliver@calder.dev

  • Update tests/main/test-user-daemon-in-graphical-environment/task.yaml

Co-authored-by: Oliver Calder oliver@calder.dev

  • Added systems

  • Moved the snap

  • Fix snaps-state

  • Fix paths in task.yaml

  • Set daemon experimental flag

  • Fixed test in dbus services

  • Update tests/main/test-user-daemon-in-graphical-environment/task.yaml

Co-authored-by: Oliver Calder oliver@calder.dev

  • Update tests/main/test-user-daemon-in-graphical-environment/task.yaml

Co-authored-by: Oliver Calder oliver@calder.dev

  • Update tests/main/test-user-daemon-in-graphical-environment/task.yaml

Co-authored-by: Oliver Calder oliver@calder.dev

  • Extra required changes

  • Update tests/lib/snaps/test-implicit-graphical-user-daemon/meta/snap.yaml

Co-authored-by: Oliver Calder oliver@calder.dev

  • Update tests/main/implicit-graphical-user-daemon/task.yaml

Co-authored-by: Oliver Calder oliver@calder.dev


Co-authored-by: Oliver Calder oliver@calder.dev
Co-authored-by: Marco Trevisan mail@3v1n0.net

Always use PartOf instead of BindsTo

Added extra tests

The new Asserts allow to check that both scoped and unscoped plugs are detected.

Thanks for helping us make a better snapd!
Have you signed the license agreement and read the contribution guide?

* daemon: Add implicit graphical user daemons

This is an implicit implementation of graphical user daemons.
Here, if an user-scoped daemon has the Wayland or the X11 plugs
defined, it is presumed that it requires access to the desktop
graphical environment, so it will depend on graphical-session.target
instead of the default target.

It implements the implicit way of SD-230.

It also fixes all the problems with Gnome 50.

This PR is an alternative to canonical#16091

* Add "s" (for seconds) in tests

* Added test for desktop daemons

* Fix typo

* Added execute

* Check that the test works

* Update tests/lib/snaps/test-user-daemon-in-graphical-environment/task.yaml

Co-authored-by: Oliver Calder <oliver@calder.dev>

* Update wrappers/internal/service_unit_gen.go

Co-authored-by: Marco Trevisan <mail@3v1n0.net>

* Added test for dbus daemons

* Moved test into tests/main

* Requested changes

* Test to see if this is being run

* Remove error

* Update tests/main/test-user-daemon-in-graphical-environment/test-implicit-graphical-user-daemon/meta/snap.yaml

Co-authored-by: Oliver Calder <oliver@calder.dev>

* Update tests/main/test-user-daemon-in-graphical-environment/test-implicit-graphical-user-daemon/meta/snap.yaml

Co-authored-by: Oliver Calder <oliver@calder.dev>

* Update tests/main/test-user-daemon-in-graphical-environment/test-implicit-graphical-user-daemon/meta/snap.yaml

Co-authored-by: Oliver Calder <oliver@calder.dev>

* Update tests/main/test-user-daemon-in-graphical-environment/test-implicit-graphical-user-daemon/meta/snap.yaml

Co-authored-by: Oliver Calder <oliver@calder.dev>

* Update tests/main/test-user-daemon-in-graphical-environment/task.yaml

Co-authored-by: Oliver Calder <oliver@calder.dev>

* Update tests/main/test-user-daemon-in-graphical-environment/task.yaml

Co-authored-by: Oliver Calder <oliver@calder.dev>

* Added systems

* Moved the snap

* Fix snaps-state

* Fix paths in task.yaml

* Set daemon experimental flag

* Fixed test in dbus services

* Update tests/main/test-user-daemon-in-graphical-environment/task.yaml

Co-authored-by: Oliver Calder <oliver@calder.dev>

* Update tests/main/test-user-daemon-in-graphical-environment/task.yaml

Co-authored-by: Oliver Calder <oliver@calder.dev>

* Update tests/main/test-user-daemon-in-graphical-environment/task.yaml

Co-authored-by: Oliver Calder <oliver@calder.dev>

* Extra required changes

* Update tests/lib/snaps/test-implicit-graphical-user-daemon/meta/snap.yaml

Co-authored-by: Oliver Calder <oliver@calder.dev>

* Update tests/main/implicit-graphical-user-daemon/task.yaml

Co-authored-by: Oliver Calder <oliver@calder.dev>

---------

Co-authored-by: Oliver Calder <oliver@calder.dev>
Co-authored-by: Marco Trevisan <mail@3v1n0.net>

Always use PartOf instead of BindsTo

Added extra tests

The new Asserts allow to check that both scoped and unscoped
plugs are detected.
@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.59%. Comparing base (8d929ea) to head (330ea56).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #16687      +/-   ##
==========================================
+ Coverage   77.52%   77.59%   +0.07%     
==========================================
  Files        1359     1351       -8     
  Lines      187225   187188      -37     
  Branches     2446     2446              
==========================================
+ Hits       145152   145255     +103     
+ Misses      33298    33162     -136     
+ Partials     8775     8771       -4     
Flag Coverage Δ
unittests 77.59% <100.00%> (+0.07%) ⬆️

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.

@github-actions
Copy link

Fri Feb 27 11:16:37 UTC 2026
The following results are from: https://github.com/canonical/snapd/actions/runs/22480680604

Failures:

Preparing:

  • openstack:arch-linux-64:tests/main/implicit-graphical-user-daemon
  • openstack:debian-12-64:tests/main/implicit-graphical-user-daemon
  • openstack:ubuntu-20.04-64:tests/main/nss-modules:winbind
  • openstack:ubuntu-20.04-64:tests/main/implicit-graphical-user-daemon
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_allow_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:timespan_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:read_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_safer
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_conflict
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:timespan_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:read_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_deny_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_deny
  • openstack:ubuntu-25.10-64:tests/main/implicit-graphical-user-daemon
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_defaults
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_allow
  • openstack:ubuntu-24.04-64:tests/main/implicit-graphical-user-daemon
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:download_file_defaults
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_deny
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:read_single_deny
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_allow_deny
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:download_file_conflict
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_deny
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:timespan_deny
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_deny_allow
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:download_file_safer
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_deny
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_allow
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:write_single_deny
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:timespan_allow
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_allow
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:read_single_allow
  • openstack:ubuntu-24.04-64:tests/main/apparmor-prompting-integration-tests:write_single_allow

Executing:

  • openstack:debian-12-64:tests/smoke/find-info
  • openstack:ubuntu-core-20-64:tests/core/snapd-failover
  • openstack:ubuntu-core-20-64:tests/core/gadget-update-pc
  • openstack:ubuntu-25.10-64:tests/main/snap-quota

Restoring:

  • openstack:ubuntu-core-20-64:tests/core/gadget-update-pc
  • openstack:ubuntu-core-20-64:tests/core/
  • openstack:ubuntu-core-20-64:
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-prompt-restoration
  • openstack:ubuntu-25.10-64:tests/main/
  • openstack:ubuntu-25.10-64:

Skipped tests from snapd-testing-skip

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

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.

1 participant