Skip to content

qrexec-policy-graph: add qube colors#222

Open
notmuchtohide wants to merge 4 commits into
QubesOS:mainfrom
notmuchtohide:3007-policy-graph-node-color
Open

qrexec-policy-graph: add qube colors#222
notmuchtohide wants to merge 4 commits into
QubesOS:mainfrom
notmuchtohide:3007-policy-graph-node-color

Conversation

@notmuchtohide
Copy link
Copy Markdown

@notmuchtohide notmuchtohide commented Feb 28, 2026

Fixes QubesOS/qubes-issues#3007. I have not fixed the tests yet, but I believe the rest is ready for feedback.

Code decisions:

  1. Node styling is not organized: Node styling is added as nodes are found instead of being grouped together. It should have no impact on the final graph and was considered as a potentially acceptable trade-off for implementation simplicity.
  2. qubesadmin vs. system_info: The already used system_info did not provide qube colors, therefore it was obtained from qubesadmin.

Styling decisions:

  1. Qube color was added to node borders in case of a literal qube (one that doesn't start with "@"). On non-literal qubes, nodes are dotted because it's not necessarily an individual qube.
  2. The chosen style of coloring borders instead of solid filling made it easier to deal with the inner text (example: black text on black colored qubes).

Before

before

After

after

Fixes QubesOS/qubes-issues#3007

Code decisions:
    1. Node styling is not organized:
    Node styling is added as nodes are found instead of being grouped
    together. It should have no impact on the final graph and was
    considered as a potentially acceptable trade-off for
    implementation simplicity.

    2. qubesadmin vs. system_info:
    The already used system_info did not provide qube colors,
    therefore it was obtained from qubesadmin.

Styling decisions:

    1. Qube color was added to node borders in case of a literal qube
    (one that doesn't start with "@"). On non-literal qubes, nodes
    are dotted because it's not necessarily an individual qube.

    2. The chosen style of coloring borders instead of solid filling
    made it easier to deal with the inner text (example: black text
    on black colored qubes).
@notmuchtohide notmuchtohide force-pushed the 3007-policy-graph-node-color branch from 8984c4c to 6770795 Compare March 1, 2026 01:00
@ben-grande
Copy link
Copy Markdown
Contributor

2. qubesadmin vs. system_info: The already used system_info did not provide qube colors, therefore it was obtained from qubesadmin.

Then I believe that you could add label to system_info in qubes-core-admin instead of adding a dependency in qubesadmin.

Styling decisions:

1. Qube color was added to node borders in case of a literal qube (one that doesn't start with "@"). On non-literal qubes, nodes are dotted because it's not necessarily an individual qube.

I think that is okay.

2. The chosen style of coloring borders instead of solid filling made it easier to deal with the inner text (example: black text on black colored qubes).

I think that the border is too big with penwidth = 5. Without that, are the colors hard to distinguish because of being too thin?

Obtain label from system_info instead of adding a dependency in
qubesadmin.
@notmuchtohide
Copy link
Copy Markdown
Author

2. qubesadmin vs. system_info: The already used system_info did not provide qube colors, therefore it was obtained from qubesadmin.

Then I believe that you could add label to system_info in qubes-core-admin instead of adding a dependency in qubesadmin.

Done: QubesOS/qubes-core-admin#786

I think that the border is too big with penwidth = 5. Without that, are the colors hard to distinguish because of being too thin?

I believe the colors also look nice on thinner borders. I have now changed the width to 3.
This is how it looks now:

qrexec-policy-graph

@ben-grande
Copy link
Copy Markdown
Contributor

PipelineRetryFailed

@ben-grande
Copy link
Copy Markdown
Contributor

ben-grande commented Mar 9, 2026

PipelineRetryFailed


cairo-gobject at it again... will retry pipeline until it gets a functional runner.

@ben-grande
Copy link
Copy Markdown
Contributor

CI failure seems to be related to missing the PR on core-admin. I believe that will be run by the gitlab runner when creating the openqa job.

@marmarek
Copy link
Copy Markdown
Member

marmarek commented Mar 9, 2026

CI failure seems to be related to missing the PR on core-admin.

Tests have mockup system info structure, see qrexec/tests/policy_graph.py. And I'm pretty sure some of the tests will need an update to include the label too.

@notmuchtohide
Copy link
Copy Markdown
Author

CI failure seems to be related to missing the PR on core-admin.

Tests have mockup system info structure, see qrexec/tests/policy_graph.py. And I'm pretty sure some of the tests will need an update to include the label too.

I believe I fixed the tests now.

The pipeline seems to be failing with the cairo-gobject that @ben-grande mentioned but the tests and lint are passing locally.

@ben-grande
Copy link
Copy Markdown
Contributor

PipelineRetryFailed

@ben-grande
Copy link
Copy Markdown
Contributor

Passed CI: https://gitlab.com/QubesOS/qubes-core-qrexec/-/pipelines/2373959020

gi problem for pylint, will ignore that and let this PR be scheduled for openqa.

@ben-grande
Copy link
Copy Markdown
Contributor

PipelineRetryFailed

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 10, 2026

Codecov Report

❌ Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.90%. Comparing base (cc801b8) to head (f4e05be).

Files with missing lines Patch % Lines
qrexec/tools/qrexec_policy_graph.py 94.73% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #222      +/-   ##
==========================================
+ Coverage   78.88%   78.90%   +0.02%     
==========================================
  Files          55       55              
  Lines       10531    10542      +11     
==========================================
+ Hits         8307     8318      +11     
  Misses       2224     2224              

☔ 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.

@qubesos-bot
Copy link
Copy Markdown

OpenQA test summary

Complete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026031319-4.3-debian&flavor=pull-requests

Test run included the following:

New failures, excluding unstable

Compared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026020304-devel&flavor=update

Failed tests

No failures!

Fixed failures

Compared to: https://openqa.qubes-os.org/tests/166096#dependencies
Nothing fixed

Unstable tests

Details

Performance Tests

Performance degradation:

No issues

Remaining performance tests:

13 tests
  • debian-13-xfce_dom0-dispvm-api (mean:6.539): 78.47 🟢 ( previous job: 79.83, improvement: 98.29%)
  • debian-13-xfce_dom0-dispvm-gui-api (mean:7.827): 93.92 🔻 ( previous job: 92.49, degradation: 101.55%)
  • debian-13-xfce_dom0-dispvm-preload-2-api (mean:3.149): 37.79 🟢 ( previous job: 44.94, improvement: 84.08%)
  • debian-13-xfce_dom0-dispvm-preload-2-delay-0-api (mean:2.917): 35.00 🟢 ( previous job: 41.46, improvement: 84.42%)
  • debian-13-xfce_dom0-dispvm-preload-2-delay-minus-1d2-api (mean:3.307): 39.69 🟢 ( previous job: 47.01, improvement: 84.43%)
  • debian-13-xfce_dom0-dispvm-preload-4-api (mean:2.284): 27.41 🟢 ( previous job: 37.67, improvement: 72.75%)
  • debian-13-xfce_dom0-dispvm-preload-4-delay-0-api (mean:2.809): 33.71 🟢 ( previous job: 36.76, improvement: 91.71%)
  • debian-13-xfce_dom0-dispvm-preload-4-delay-minus-1d2-api (mean:2.441): 29.29 🟢 ( previous job: 37.87, improvement: 77.36%)
  • debian-13-xfce_dom0-dispvm-preload-2-gui-api (mean:4.989): 59.87 🔻 ( previous job: 55.58, degradation: 107.71%)
  • debian-13-xfce_dom0-dispvm-preload-4-gui-api (mean:4.135): 49.62 🔻 ( previous job: 47.73, degradation: 103.97%)
  • debian-13-xfce_dom0-dispvm-preload-6-gui-api (mean:4.198): 50.38 🔻 ( previous job: 47.11, degradation: 106.93%)
  • debian-13-xfce_dom0-vm-api (mean:0.038): 0.45 🔻 ( previous job: 0.41, degradation: 109.93%)
  • debian-13-xfce_dom0-vm-gui-api (mean:0.039): 0.47 🟢 ( previous job: 0.48, improvement: 96.67%)

marmarek added a commit to QubesOS/qubes-core-admin that referenced this pull request Mar 28, 2026
* origin/pr/786:
  Add label to test_010
  Add label to vm_events
  Add label to system_info

Pull request description:

This is necessary to display qube colors in qrexec-policy-graph (QubesOS/qubes-core-qrexec#222).
@marmarek
Copy link
Copy Markdown
Member

This needs a rebase now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

qrexec-policy-graph: color nodes according to actual colors

4 participants