Skip to content

Conversation

@aesteve-rh
Copy link
Collaborator

@aesteve-rh aesteve-rh commented Oct 7, 2025

Add qm-wayland package. This is a revamp of the
previous windowmanager subpackage. But in this case,
it is not a qm subpackage in the sense of requiring QM
and installing in rootfs. Instead, this qm-wayland
package is meant to be installed within QM. It adds
the files required to run the wayland scenario, and
depends on container images maintained on quay.io.

This is the first draft, but it requires the
dev-binder-hook to function correctly.

Signed-off-by: Albert Esteve [email protected]

Summary by Sourcery

Split out the previous windowmanager subpackage into two independent RPMs (qm-wayland and qm-oci-hooks) with their own Packit pipelines, refactor specs and file layouts, update tests, and add documentation for the Wayland subsystem.

New Features:

  • Introduce qm-wayland as an independent RPM providing Wayland session scripts and systemd configurations
  • Add qm-oci-hooks as an independent RPM with OCI hooks including dynamic device manager and new seat manager hook

Enhancements:

  • Refactor Packit CI pipeline to add dedicated jobs for qm-wayland and qm-oci-hooks using shared job anchors
  • Remove legacy windowmanager subsystem and update project Makefiles to exclude new subpackages

Documentation:

  • Add subsystem README documenting Wayland components and usage

Tests:

  • Update OCI hook tests to handle the new seat manager hook and remove nested QM rootfs checks

Chores:

  • Switch linting in tox from Black to Flake8
  • Add helper scripts (.packit-wayland.sh and .packit-oci-hooks.sh) for Packit spec preprocessing

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 7, 2025

Reviewer's Guide

This PR restructures the QM project by introducing a new qm-wayland RPM package (including spec, packaging scripts, Makefile targets, and documentation), extending Packit pipelines for the new packages, enhancing the qm-oci-hooks package (adding a seat manager hook and cleaning up rootfs path logic), updating associated build and test tooling, and removing the deprecated windowmanager subsystem.

File-Level Changes

Change Details Files
Add a standalone qm-wayland package to provide Wayland support inside QM
  • Create rpm/wayland/qm-wayland.spec with systemd units, PAM configs, and packaging metadata
  • Add subsystems/wayland/Makefile and README.md for building and documentation
  • Introduce .packit-wayland.sh to drive Packit source tarball and spec adjustments
  • Add Wayland config files under subsystems/wayland/etc and usr/bin/wayland-session
rpm/wayland/qm-wayland.spec
subsystems/wayland/Makefile
subsystems/wayland/README.md
subsystems/wayland/etc/weston/weston.ini
subsystems/wayland/etc/systemd/system/wayland-session.service
subsystems/wayland/usr/bin/wayland-session
.packit-wayland.sh
Refactor Packit CI pipelines to support qm-wayland and qm-oci-hooks
  • Extend .packit.yaml with new copr, koji, bodhi, and downstream jobs for qm-wayland and qm-oci-hooks
  • Extract shared target and branch anchors for multiarch builds
  • Add fix-spec-file actions calling .packit-wayland.sh and .packit-oci-hooks.sh
.packit.yaml
.packit-wayland.sh
.packit-oci-hooks.sh
Enhance qm-oci-hooks package by adding seat manager and cleaning rootfs logic
  • Bump qm-oci-hooks.spec Version and drop QM rootfs ghost directory installs
  • Add qm-seat-manager hook JSON and update %files lists
  • Simplify install paths and update hook library installation
rpm/oci-hooks/qm-oci-hooks.spec
subsystems/qm-oci-hooks/Makefile
oci-hooks/qm-seat-manager/oci-qm-seat-manager.json
Update tests, linting, and build scripts for new hooks and subsystems
  • Adjust test_hook_configs.py to handle seat-manager executable resolution
  • Switch linting in oci-hooks/tox.ini from black to flake8 and adjust ignores
  • Modify top‐level Makefile to exclude subpackages with their own Packit pipelines
oci-hooks/tests/test_hook_configs.py
oci-hooks/tox.ini
Makefile
Remove deprecated windowmanager subsystem
  • Delete rpm/windowmanager spec and related packaging files
  • Remove subsystems/windowmanager directory and all its configuration and Makefiles
  • Clean up references in main Makefile
rpm/windowmanager/windowmanager.spec
subsystems/windowmanager

Possibly linked issues

  • #QM-Wayland-Support: The PR adds a new qm-wayland package to provide Wayland support within QM, replacing the old windowmanager subpackage and installing necessary files and services as requested by the issue.
  • qm.container mounts /var/tmp as tmpfs #723: The PR adds the qm-wayland package and oci-qm-seat-manager hook, which are designed to enable Wayland and manage device access, directly addressing the issue of Wayland needing write access to /dev/tty*.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@gemini-code-assist
Copy link

Summary of Changes

Hello @aesteve-rh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This PR introduces the qm-wayland package, a re-architecture of the previous windowmanager subpackage, to enable Wayland display server support within the QM containerized environment. It replaces the old package with a new, independent package that installs systemd services, PAM configurations, and a session management script, all designed to run within QM and utilize container images for core components like D-Bus and the Wayland compositor. The old windowmanager package and its associated files have been completely removed.

Highlights

  • Intent: This pull request introduces a new qm-wayland package, which is a significant revamp of the previous windowmanager subpackage. The primary goal is to provide Wayland display server support specifically for the QM (Quality Management) containerized environment. Unlike its predecessor, this new package is designed to be installed within QM and relies on container images hosted on quay.io. It aims to facilitate running Wayland scenarios within QM containers.
  • Changes: The pull request primarily involves adding the new qm-wayland package and removing the old windowmanager subpackage. The new qm-wayland package includes a new RPM spec file (rpm/wayland/qm-wayland.spec), a Makefile for building, a README, and various systemd unit files and PAM configurations. Key components added are a wayland-session script for managing Wayland user sessions, systemd socket units (qm-dbus.socket, wayland.socket), and container unit files (qm-dbus-broker.container, wayland-compositor.container) that leverage container images for D-Bus and the Wayland compositor (Weston). Concurrently, all files associated with the old windowmanager subpackage, including its spec file, Makefiles, container definitions, PAM configurations, and related scripts, have been removed. The tools/version-update script was also updated to remove references to the deprecated windowmanager spec file.
  • Reviewer Activity: No specific reviewer activity has been recorded or is available in the provided context for this pull request.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • The spec file’s conditional logic around copr_username and Epoch adds unnecessary complexity; consider simplifying the version/Epoch handling for consistency across build environments.
  • The Makefile’s dist target hardcodes paths for each file, which is brittle; switch to wildcard patterns or a manifest to dynamically include subsystem files.
  • There’s an unintended empty diff entry for tools/version-update — please remove or properly populate this change.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The spec file’s conditional logic around copr_username and Epoch adds unnecessary complexity; consider simplifying the version/Epoch handling for consistency across build environments.
- The Makefile’s dist target hardcodes paths for each file, which is brittle; switch to wildcard patterns or a manifest to dynamically include subsystem files.
- There’s an unintended empty diff entry for tools/version-update — please remove or properly populate this change.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new qm-wayland package to replace the old windowmanager subpackage. The changes are extensive, including a new RPM spec, systemd units, PAM configurations, and a session management script. My review focuses on ensuring the correctness and robustness of these new components. I've found several critical issues, including a potential packaging bug in the Makefile, a CPU-spinning bug in the session script, and a typo that would prevent the OCI hook from working correctly. I've also noted some areas for improvement in script efficiency and RPM packaging practices. Please address the critical and high severity issues to ensure the package works as intended.

@aesteve-rh aesteve-rh marked this pull request as draft October 7, 2025 14:47
@packit-as-a-service
Copy link

Failed to load packit config file:

Cannot parse package config. ValidationError({'jobs': {0: {'job': ['Missing data for required field.'], 'trigger': ['Missing data for required field.']}, 1: {'job': ['Missing data for required field.'], 'trigger': ['Missing data for required field.']}, 2: {'job': ['Missing data for required field.'], 'trigger': ['Missing data for required field.']}, 3: {'job': ['Missing data for required field.'], 'trigger': ['Missing data for required field.']}}})

For more info, please check out the documentation or contact the Packit team. You can also use our CLI command config validate or our pre-commit hooks for validation of the configuration.

@aesteve-rh aesteve-rh force-pushed the upstream-wayland branch 3 times, most recently from ff6f766 to 23e537a Compare October 8, 2025 14:56
@Yarboa
Copy link
Collaborator

Yarboa commented Oct 15, 2025

@aesteve-rh we have that issue, #921
Do you really want to add it as subpackage? we have no agreement related to subpackages usage, I assume we can continue discuss this on the issue
I remember Alex was not in favor of that approach

@aesteve-rh
Copy link
Collaborator Author

This is not a qm subpackage in the same sense the others that were discussed previously. In this case, there is no direct dependency between both packages in the specfile. The tweak is that this is a package meant to be installed within the qm container, adding some pre-defined workloads to support a scenario. This was discussed with @alexlarsson too, he suggested following this approach.

I have to link the commit to the issue, true. I am waiting for the oci-dev-binder-hook to land upstream so that I can add the dependency to the qm package and test that the scenario works together before readying this up.

@Yarboa
Copy link
Collaborator

Yarboa commented Oct 16, 2025

This is not a qm subpackage in the same sense the others that were discussed previously. In this case, there is no direct dependency between both packages in the specfile. The tweak is that this is a package meant to be installed within the qm container, adding some pre-defined workloads to support a scenario. This was discussed with @alexlarsson too, he suggested following this approach.

I have to link the commit to the issue, true. I am waiting for the oci-dev-binder-hook to land upstream so that I can add the dependency to the qm package and test that the scenario works together before readying this up.

MHO, go with what exist, later we could change things gradually,
I mean use qm oci-hooks also, with weak dependency
The make command can control it.

@aesteve-rh
Copy link
Collaborator Author

MHO, go with what exist, later we could change things gradually,

Fair point. I will try to do that for now.

@aesteve-rh aesteve-rh force-pushed the upstream-wayland branch 8 times, most recently from 1b62cd1 to 67c61f4 Compare October 24, 2025 06:55
@aesteve-rh aesteve-rh marked this pull request as ready for review October 24, 2025 06:58
@aesteve-rh
Copy link
Collaborator Author

@sourcery-ai summary

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • The new Packit pipeline entries for qm-wayland and qm-oci-hooks are very similar—consider extracting common anchors or jobs and overriding only identifier/specfile_path to reduce duplication.
  • Rather than having two nearly identical .packit-*.sh scripts, you could factor out the tarball creation and spec‐file sed logic into a shared helper to avoid duplicated versioning and source‐setup code.
  • The special-case seat-manager executable lookup in the tests would be cleaner if you extended the hook_configs fixture or parametrized the mapping, so you don’t need ad-hoc branches inside the test body.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new Packit pipeline entries for qm-wayland and qm-oci-hooks are very similar—consider extracting common anchors or jobs and overriding only identifier/specfile_path to reduce duplication.
- Rather than having two nearly identical `.packit-*.sh` scripts, you could factor out the tarball creation and spec‐file sed logic into a shared helper to avoid duplicated versioning and source‐setup code.
- The special-case seat-manager executable lookup in the tests would be cleaner if you extended the hook_configs fixture or parametrized the mapping, so you don’t need ad-hoc branches inside the test body.

## Individual Comments

### Comment 1
<location> `rpm/wayland/qm-wayland.spec:51` </location>
<code_context>
+
+%build
+
+%install
+# Install wayland script
+install -d %{buildroot}%{_bindir}
</code_context>

<issue_to_address>
**issue (complexity):** Consider grouping repeated install and macro commands to reduce boilerplate in the spec file.

Here’s one way you can collapse the boilerplate without changing any functionality:

1) Group all your directory-creates into one `install -d`:

```spec
%install
# install binaries
install -d %{buildroot}%{_bindir}
install -m 755 subsystems/wayland/usr/bin/wayland-session %{buildroot}%{_bindir}/

# create all config & unit dirs in one go
install -d \
  %{buildroot}%{_sysconfdir}/containers/systemd \
  %{buildroot}%{_sysconfdir}/containers/systemd/qm-dbus-broker.container.d \
  %{buildroot}%{_sysconfdir}/containers/systemd/wayland-compositor.container.d \
  %{buildroot}%{_unitdir} \
  %{buildroot}%{_unitdir}/wayland-session.service.d \
  %{buildroot}%{_sysconfdir}/pam.d \
  %{buildroot}%{_sysconfdir}/weston \
  %{buildroot}%{_presetdir}
```

2) Group your `-m 644` copies by destination:

```spec
# container files
install -m 644 \
  subsystems/wayland/etc/containers/systemd/qm-dbus-broker.container \
  subsystems/wayland/etc/containers/systemd/wayland-compositor.container \
  %{buildroot}%{_sysconfdir}/containers/systemd/

# systemd units
install -m 644 subsystems/wayland/etc/systemd/system/* %{buildroot}%{_unitdir}/

# pam, weston, preset
install -m 644 \
  subsystems/wayland/etc/pam.d/* \
  %{buildroot}%{_sysconfdir}/pam.d/
install -m 644 subsystems/wayland/etc/weston/weston.ini %{buildroot}%{_sysconfdir}/weston/
install -m 644 subsystems/wayland/50-qm-wayland.preset %{buildroot}%{_presetdir}/
```

3) Collapse your four systemd macros into one each:

```spec
%post
%systemd_post qm-dbus.socket \
               wayland.socket \
               wayland-session.service \
               wayland-compositor.service

%preun
%systemd_preun qm-dbus.socket \
                wayland.socket \
                wayland-session.service \
                wayland-compositor.service

%postun
%systemd_postun_ex qm-dbus.socket \
                   wayland.socket \
                   wayland-session.service \
                   wayland-compositor.service
```

This preserves all paths and unit handling but cuts ~20 lines of boilerplate.
</issue_to_address>

### Comment 2
<location> `oci-hooks/tests/test_hook_configs.py:246-248` </location>
<code_context>

</code_context>

<issue_to_address>
**issue (code-quality):** Avoid conditionals in tests. ([`no-conditionals-in-tests`](https://docs.sourcery.ai/Reference/Rules-and-In-Line-Suggestions/Python/Default-Rules/no-conditionals-in-tests))

<details><summary>Explanation</summary>Avoid complex code, like conditionals, in test functions.

Google's software engineering guidelines says:
"Clear tests are trivially correct upon inspection"
To reach that avoid complex code in tests:
* loops
* conditionals

Some ways to fix this:

* Use parametrized tests to get rid of the loop.
* Move the complex logic into helpers.
* Move the complex part into pytest fixtures.

> Complexity is most often introduced in the form of logic. Logic is defined via the imperative parts of programming languages such as operators, loops, and conditionals. When a piece of code contains logic, you need to do a bit of mental computation to determine its result instead of just reading it off of the screen. It doesn't take much logic to make a test more difficult to reason about.

Software Engineering at Google / [Don't Put Logic in Tests](https://abseil.io/resources/swe-book/html/ch12.html#donapostrophet_put_logic_in_tests)
</details>
</issue_to_address>

### Comment 3
<location> `oci-hooks/tests/test_hook_configs.py:406-410` </location>
<code_context>

</code_context>

<issue_to_address>
**issue (code-quality):** Avoid conditionals in tests. ([`no-conditionals-in-tests`](https://docs.sourcery.ai/Reference/Rules-and-In-Line-Suggestions/Python/Default-Rules/no-conditionals-in-tests))

<details><summary>Explanation</summary>Avoid complex code, like conditionals, in test functions.

Google's software engineering guidelines says:
"Clear tests are trivially correct upon inspection"
To reach that avoid complex code in tests:
* loops
* conditionals

Some ways to fix this:

* Use parametrized tests to get rid of the loop.
* Move the complex logic into helpers.
* Move the complex part into pytest fixtures.

> Complexity is most often introduced in the form of logic. Logic is defined via the imperative parts of programming languages such as operators, loops, and conditionals. When a piece of code contains logic, you need to do a bit of mental computation to determine its result instead of just reading it off of the screen. It doesn't take much logic to make a test more difficult to reason about.

Software Engineering at Google / [Don't Put Logic in Tests](https://abseil.io/resources/swe-book/html/ch12.html#donapostrophet_put_logic_in_tests)
</details>
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@aesteve-rh aesteve-rh force-pushed the upstream-wayland branch 2 times, most recently from c750d85 to 84c35ee Compare October 24, 2025 11:23
@aesteve-rh
Copy link
Collaborator Author

@Yarboa @dougsland @telemaco ready to be reviewed!

@aesteve-rh
Copy link
Collaborator Author

Copy link
Collaborator

@Yarboa Yarboa left a comment

Choose a reason for hiding this comment

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

Sorry small leftovers, from previous review, I did not submit

@aesteve-rh aesteve-rh force-pushed the upstream-wayland branch 3 times, most recently from d44f103 to 7a5b183 Compare October 27, 2025 10:24
@aesteve-rh aesteve-rh force-pushed the upstream-wayland branch 2 times, most recently from 066e73a to 772c692 Compare October 29, 2025 08:27
@dougsland
Copy link
Member

@aesteve-rh ready for review?

@aesteve-rh
Copy link
Collaborator Author

@dougsland yes, there is still a bit of refinement with systemd orchestration going on, but that will only change a few lines in the quadlets, sockets and service files for wayland. Which should not block reviewing this overall.

I know it's many changes, I tried to split in commits to make it easier to review.

@aesteve-rh
Copy link
Collaborator Author

aesteve-rh commented Nov 6, 2025

@dougsland @Yarboa refinement done. This works in my setup.

Feel free to review it already. I will take the changes from #942 once it lands.

@Yarboa
Copy link
Collaborator

Yarboa commented Nov 9, 2025

@dougsland @Yarboa refinement done. This works in my setup.

Feel free to review it already. I will take the changes from #942 once it lands.

Sure, I am back, reviewing

@aesteve-rh
Copy link
Collaborator Author

Pushed mostly to include the container support in 6a06e95

That was missing even though I remember adding it at some point. Shouldn't change other parts of the patch.

Remove windowmanager subsystem package. We
want to revamp the scenario and allow the package
to be installed within QM instead of extending QM.

Signed-off-by: Albert Esteve <[email protected]>
Add qm-wayland package. This is a revamp of the
previous windowmanager subpackage. But in this case,
it is not a qm subpackage in the sense of requiring QM
and installing in rootfs. Instead, this qm-wayland
package is meant to be installed within QM. It adds
the files required to run the wayland scenario, and
depends on container images maintained on quay.io.

This is the first draft, but it requires the
dev-binder-hook to function correctly.

Signed-off-by: Albert Esteve <[email protected]>
Make qm-oci-hooks package indepent from qm. It can then
be installed both in the host or within the qm to get
the hooks installed in the right folders.

As it is indepent we can now add it to the Packit
configuration so it gets built and deployed automatically.

Signed-off-by: Albert Esteve <[email protected]>
Split seat and devices hooks as otherwise the
annotations were not matching correctly to execute
the hooks when they should.

Also, fix the package to add a missing dependency
to include udevadm application.

Signed-off-by: Albert Esteve <[email protected]>
Now that hooks is an independent package, qm-wayland
can recomment it to work properly.

Signed-off-by: Albert Esteve <[email protected]>
Exclude packages that were added to packit from the
subpackages target. That will exclude also from the
`Build Subpackages` job in the pipelines, as the build
environment have missing dependencies.

Signed-off-by: Albert Esteve <[email protected]>
@telemaco
Copy link
Contributor

I've been reviewing the PR @aesteve-rh and LGTM.

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.

4 participants