Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add root terminal to Domains tray icon menu #243

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ofenhed
Copy link

@Ofenhed Ofenhed commented Feb 4, 2025

This pull request adds a subtle "Run Root Terminal" option to the Domains tray icon menu, which is very useful when not using qubes-core-agent-passwordless-root.

As I've done before, I've tried my best to not change anything about the user experience of the application for most users (as I expect most users to run with qubes-core-agent-passwordless-root). The behavior after this patch is that holding the shift key changes the "Run Terminal" command into a "Run Root Terminal" command.

Looking at existing issues, the closest I found was QubesOS/qubes-issues#9512, but the use case is different as it is a simpler way of making qubes-core-agent-passwordless-root togglable. This is instead a simplified root terminal access, over having to open a Dom0 terminal and start it with qvm-run.

Extra considerations:

  • I'm not at all familiar with Gtk, and I'm feeling a bit uncertain that signals was the right way to go. No longer using signals
  • There is a race when smashing the shift key. I don't think it's a performance issue, and not really a UX issue (as the text matches the action that will be performed when terminal is pressed). *I had forgotten that my keyboard has an automatic hold function for the shift key 🤦

@Ofenhed Ofenhed marked this pull request as draft February 4, 2025 14:27
@Ofenhed Ofenhed marked this pull request as ready for review February 4, 2025 14:30
@Ofenhed Ofenhed marked this pull request as draft February 6, 2025 10:10
@Ofenhed Ofenhed marked this pull request as ready for review February 6, 2025 22:32
@marmarta
Copy link
Member

I think the signals are a bit overengineered here? Have you tried just iterating over submenus and running on them a function that changes label / sets the "this is root termin actually" variable? It should not cause any issues/races, I think....

@Ofenhed
Copy link
Author

Ofenhed commented Feb 13, 2025

Yes, but I ran into some (probably unrelated) issues, by the time I solved the issues I had the signals. Iirc I moved to signals to solve what I thought could have been a race, but looking back at the code I'm pretty sure I was wrong. I'll take a look at simplifying the code as soon as I get spare time.

@Ofenhed
Copy link
Author

Ofenhed commented Mar 11, 2025

Sorry for the delay. I have now moved away from signals.

I just found mock_app which made this a lot simpler to work on 🥳

@marmarek
Copy link
Member

Black complains about formatting, either adjust manually, or run black -l80 on affected files.

Copy link

codecov bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.16%. Comparing base (7652c60) to head (4d8f52f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #243   +/-   ##
=======================================
  Coverage   93.16%   93.16%           
=======================================
  Files          58       58           
  Lines       11065    11065           
=======================================
  Hits        10309    10309           
  Misses        756      756           

☔ 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

qubesos-bot commented Mar 11, 2025

OpenQA test summary

Complete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2025031115-4.3&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=2025021804-4.3&flavor=update

  • system_tests_whonix@hw7

  • system_tests_suspend@hw1

    • suspend: wait_serial (wait serial expected)
      # wait_serial expected: qr/p5~T5-\d+-/...
  • system_tests_whonix

  • system_tests_qrexec

  • system_tests_basic_vm_qrexec_gui_zfs

    • TC_20_NonAudio_whonix-workstation-17-pool: test_010_run_xterm (error + cleanup)
      raise TimeoutError from exc_val... TimeoutError

    • TC_20_NonAudio_whonix-workstation-17-pool: test_011_run_gnome_terminal (skipped + cleanup)

    • TC_20_NonAudio_whonix-workstation-17-pool: test_012_qubes_desktop_run (error + cleanup)
      raise TimeoutError from exc_val... TimeoutError

  • system_tests_audio

  • system_tests_kde_gui_interactive

    • gui_keyboard_layout: wait_serial (wait serial expected)
      # wait_serial expected: "echo -e '[Layout]\nLayoutList=us,de' | sud...

    • gui_keyboard_layout: Failed (test died)
      # Test died: command 'test "$(cd ~user;ls e1*)" = "$(qvm-run -p wor...

Failed tests

28 failures
  • system_tests_whonix@hw7

    • whonixcheck: fail (unknown)
      Whonixcheck for anon-whonix failed...

    • whonixcheck: unnamed test (unknown)

    • whonixcheck: fail (unknown)
      Whonixcheck for whonix-gateway-17 failed...

    • whonixcheck: unnamed test (unknown)

    • whonixcheck: fail (unknown)
      Whonixcheck for sys-whonix failed...

    • whonixcheck: unnamed test (unknown)

    • whonixcheck: fail (unknown)
      Whonixcheck for whonix-workstation-17 failed...

    • whonixcheck: unnamed test (unknown)

  • system_tests_suspend@hw1

    • suspend: wait_serial (wait serial expected)
      # wait_serial expected: qr/p5~T5-\d+-/...

    • suspend: Failed (test died + timed out)
      # Test died: command 'true' timed out at /usr/lib/os-autoinst/autot...

  • system_tests_whonix

    • whonixcheck: fail (unknown)
      Whonixcheck for anon-whonix failed...

    • whonixcheck: unnamed test (unknown)

    • whonixcheck: fail (unknown)
      Whonixcheck for whonix-gateway-17 failed...

    • whonixcheck: unnamed test (unknown)

    • whonixcheck: fail (unknown)
      Whonixcheck for sys-whonix failed...

    • whonixcheck: unnamed test (unknown)

    • whonixcheck: fail (unknown)
      Whonixcheck for whonix-workstation-17 failed...

    • whonixcheck: unnamed test (unknown)

  • system_tests_suspend

    • suspend: unnamed test (unknown)
    • suspend: Failed (test died)
      # Test died: no candidate needle with tag(s) 'SUSPEND-FAILED' match...
  • system_tests_qrexec

  • system_tests_basic_vm_qrexec_gui_zfs

    • TC_20_NonAudio_whonix-workstation-17-pool: test_010_run_xterm (error + cleanup)
      raise TimeoutError from exc_val... TimeoutError

    • TC_20_NonAudio_whonix-workstation-17-pool: test_011_run_gnome_terminal (skipped + cleanup)

    • TC_20_NonAudio_whonix-workstation-17-pool: test_012_qubes_desktop_run (error + cleanup)
      raise TimeoutError from exc_val... TimeoutError

  • system_tests_audio

  • system_tests_kde_gui_interactive

    • gui_keyboard_layout: wait_serial (wait serial expected)
      # wait_serial expected: "echo -e '[Layout]\nLayoutList=us,de' | sud...

    • gui_keyboard_layout: Failed (test died)
      # Test died: command 'test "$(cd ~user;ls e1*)" = "$(qvm-run -p wor...

Fixed failures

Compared to: https://openqa.qubes-os.org/tests/129058#dependencies

10 fixed
  • system_tests_whonix@hw7

  • system_tests_suspend@hw1

  • system_tests_whonix

  • system_tests_qrexec

  • system_tests_audio

  • system_tests_basic_vm_qrexec_gui_btrfs

    • TC_03_QvmRevertTemplateChanges: test_000_revert_linux (error)
      subprocess.CalledProcessError: Command '['sha1sum', '/var/lib/qubes...
  • system_tests_kde_gui_interactive

    • clipboard_and_web: unnamed test (unknown)
    • clipboard_and_web: Failed (test died)
      # Test died: no candidate needle with tag(s) 'clipboard-paste-notif...

Unstable tests

Performance Tests

Performance degradation:

32 performance degradations
  • debian-12-xfce_exec-data-simplex: 67.34 :small_red_triangle_up: ( previous job: 48.93, degradation: 137.63%)
  • debian-12-xfce_exec-data-duplex: 66.58 :small_red_triangle_up: ( previous job: 50.76, degradation: 131.16%)
  • debian-12-xfce_exec-data-duplex-root: 75.75 :small_red_triangle_up: ( previous job: 64.91, degradation: 116.70%)
  • debian-12-xfce_socket-data-duplex: 149.39 :small_red_triangle_up: ( previous job: 81.49, degradation: 183.33%)
  • fedora-41-xfce_exec-data-simplex: 70.01 :small_red_triangle_up: ( previous job: 49.65, degradation: 141.00%)
  • fedora-41-xfce_exec-data-duplex: 64.55 :small_red_triangle_up: ( previous job: 49.08, degradation: 131.52%)
  • fedora-41-xfce_exec-data-duplex-root: 101.37 :small_red_triangle_up: ( previous job: 81.65, degradation: 124.15%)
  • fedora-41-xfce_socket-data-duplex: 154.38 :small_red_triangle_up: ( previous job: 78.62, degradation: 196.35%)
  • whonix-gateway-17_exec-data-simplex: 80.92 :small_red_triangle_up: ( previous job: 48.76, degradation: 165.94%)
  • whonix-gateway-17_exec-data-duplex: 76.52 :small_red_triangle_up: ( previous job: 48.55, degradation: 157.59%)
  • whonix-gateway-17_exec-data-duplex-root: 95.95 :small_red_triangle_up: ( previous job: 70.13, degradation: 136.82%)
  • whonix-gateway-17_socket-data-duplex: 171.87 :small_red_triangle_up: ( previous job: 82.74, degradation: 207.72%)
  • whonix-workstation-17_exec-data-simplex: 72.37 :small_red_triangle_up: ( previous job: 47.01, degradation: 153.92%)
  • whonix-workstation-17_exec-data-duplex: 72.67 :small_red_triangle_up: ( previous job: 49.48, degradation: 146.88%)
  • whonix-workstation-17_exec-data-duplex-root: 96.72 :small_red_triangle_up: ( previous job: 79.93, degradation: 121.00%)
  • whonix-workstation-17_socket-data-duplex: 163.51 :small_red_triangle_up: ( previous job: 81.71, degradation: 200.10%)
  • dom0_root_seq1m_q8t1_write 3:write_bandwidth_kb: 113077.00 :small_red_triangle_up: ( previous job: 276742.00, degradation: 40.86%)
  • dom0_root_seq1m_q1t1_read 3:read_bandwidth_kb: 120759.00 :small_red_triangle_up: ( previous job: 423495.00, degradation: 28.51%)
  • dom0_root_seq1m_q1t1_write 3:write_bandwidth_kb: 119548.00 :small_red_triangle_up: ( previous job: 185030.00, degradation: 64.61%)
  • dom0_root_rnd4k_q32t1_read 3:read_bandwidth_kb: 31876.00 :small_red_triangle_up: ( previous job: 100699.00, degradation: 31.65%)
  • dom0_varlibqubes_seq1m_q8t1_read 3:read_bandwidth_kb: 402061.00 :small_red_triangle_up: ( previous job: 475329.00, degradation: 84.59%)
  • dom0_varlibqubes_rnd4k_q32t1_write 3:write_bandwidth_kb: 7243.00 :small_red_triangle_up: ( previous job: 8767.00, degradation: 82.62%)
  • fedora-41-xfce_root_seq1m_q1t1_read 3:read_bandwidth_kb: 290223.00 :small_red_triangle_up: ( previous job: 343795.00, degradation: 84.42%)
  • fedora-41-xfce_root_rnd4k_q32t1_write 3:write_bandwidth_kb: 1972.00 :small_red_triangle_up: ( previous job: 3785.00, degradation: 52.10%)
  • fedora-41-xfce_private_seq1m_q8t1_write 3:write_bandwidth_kb: 104722.00 :small_red_triangle_up: ( previous job: 116848.00, degradation: 89.62%)
  • fedora-41-xfce_private_seq1m_q1t1_read 3:read_bandwidth_kb: 313194.00 :small_red_triangle_up: ( previous job: 357875.00, degradation: 87.51%)
  • fedora-41-xfce_private_rnd4k_q32t1_write 3:write_bandwidth_kb: 2660.00 :small_red_triangle_up: ( previous job: 3885.00, degradation: 68.47%)
  • fedora-41-xfce_private_rnd4k_q1t1_write 3:write_bandwidth_kb: 1141.00 :small_red_triangle_up: ( previous job: 1613.00, degradation: 70.74%)
  • fedora-41-xfce_volatile_seq1m_q8t1_write 3:write_bandwidth_kb: 80928.00 :small_red_triangle_up: ( previous job: 139933.00, degradation: 57.83%)
  • fedora-41-xfce_volatile_seq1m_q1t1_write 3:write_bandwidth_kb: 42112.00 :small_red_triangle_up: ( previous job: 78093.00, degradation: 53.93%)
  • fedora-41-xfce_volatile_rnd4k_q32t1_write 3:write_bandwidth_kb: 2820.00 :small_red_triangle_up: ( previous job: 3959.00, degradation: 71.23%)
  • fedora-41-xfce_volatile_rnd4k_q1t1_write 3:write_bandwidth_kb: 2306.00 :small_red_triangle_up: ( previous job: 2693.00, degradation: 85.63%)

Remaining performance tests:

40 tests
  • debian-12-xfce_exec: 6.82 🟢 ( previous job: 7.15, improvement: 95.30%)
  • debian-12-xfce_exec-root: 28.64 :small_red_triangle_up: ( previous job: 27.97, degradation: 102.41%)
  • debian-12-xfce_socket: 8.39 :small_red_triangle_up: ( previous job: 8.33, degradation: 100.75%)
  • debian-12-xfce_socket-root: 8.18 🟢 ( previous job: 8.20, improvement: 99.75%)
  • fedora-41-xfce_exec: 9.12 🟢 ( previous job: 9.13, improvement: 99.80%)
  • fedora-41-xfce_exec-root: 61.17 :small_red_triangle_up: ( previous job: 61.17, degradation: 100.00%)
  • fedora-41-xfce_socket: 8.63 🟢 ( previous job: 8.66, improvement: 99.68%)
  • fedora-41-xfce_socket-root: 8.64 :small_red_triangle_up: ( previous job: 8.61, degradation: 100.43%)
  • whonix-gateway-17_exec: 8.58 :small_red_triangle_up: ( previous job: 7.87, degradation: 109.00%)
  • whonix-gateway-17_exec-root: 40.35 :small_red_triangle_up: ( previous job: 38.36, degradation: 105.19%)
  • whonix-gateway-17_socket: 8.06 :small_red_triangle_up: ( previous job: 7.54, degradation: 106.82%)
  • whonix-gateway-17_socket-root: 8.49 :small_red_triangle_up: ( previous job: 8.27, degradation: 102.59%)
  • whonix-workstation-17_exec: 7.78 🟢 ( previous job: 8.23, improvement: 94.57%)
  • whonix-workstation-17_exec-root: 56.63 :small_red_triangle_up: ( previous job: 52.56, degradation: 107.73%)
  • whonix-workstation-17_socket: 7.88 🟢 ( previous job: 8.21, improvement: 95.99%)
  • whonix-workstation-17_socket-root: 8.19 🟢 ( previous job: 8.20, improvement: 99.86%)
  • dom0_root_seq1m_q8t1_read 3:read_bandwidth_kb: 483660.00 :small_red_triangle_up: ( previous job: 486352.00, degradation: 99.45%)
  • dom0_root_rnd4k_q32t1_write 3:write_bandwidth_kb: 3137.00 :small_red_triangle_up: ( previous job: 3277.00, degradation: 95.73%)
  • dom0_root_rnd4k_q1t1_read 3:read_bandwidth_kb: 10919.00 :green_circle: ( previous job: 10163.00, improvement: 107.44%)
  • dom0_root_rnd4k_q1t1_write 3:write_bandwidth_kb: 1983.00 :green_circle: ( previous job: 282.00, improvement: 703.19%)
  • dom0_varlibqubes_seq1m_q8t1_write 3:write_bandwidth_kb: 116694.00 :green_circle: ( previous job: 95209.00, improvement: 122.57%)
  • dom0_varlibqubes_seq1m_q1t1_read 3:read_bandwidth_kb: 441134.00 :green_circle: ( previous job: 433474.00, improvement: 101.77%)
  • dom0_varlibqubes_seq1m_q1t1_write 3:write_bandwidth_kb: 194639.00 :green_circle: ( previous job: 164133.00, improvement: 118.59%)
  • dom0_varlibqubes_rnd4k_q32t1_read 3:read_bandwidth_kb: 106427.00 :green_circle: ( previous job: 99808.00, improvement: 106.63%)
  • dom0_varlibqubes_rnd4k_q1t1_read 3:read_bandwidth_kb: 7507.00 :green_circle: ( previous job: 7053.00, improvement: 106.44%)
  • dom0_varlibqubes_rnd4k_q1t1_write 3:write_bandwidth_kb: 4789.00 :green_circle: ( previous job: 3868.00, improvement: 123.81%)
  • fedora-41-xfce_root_seq1m_q8t1_read 3:read_bandwidth_kb: 389805.00 :small_red_triangle_up: ( previous job: 396586.00, degradation: 98.29%)
  • fedora-41-xfce_root_seq1m_q8t1_write 3:write_bandwidth_kb: 189453.00 :green_circle: ( previous job: 99783.00, improvement: 189.87%)
  • fedora-41-xfce_root_seq1m_q1t1_write 3:write_bandwidth_kb: 41237.00 :small_red_triangle_up: ( previous job: 44770.00, degradation: 92.11%)
  • fedora-41-xfce_root_rnd4k_q32t1_read 3:read_bandwidth_kb: 85433.00 :small_red_triangle_up: ( previous job: 86742.00, degradation: 98.49%)
  • fedora-41-xfce_root_rnd4k_q1t1_read 3:read_bandwidth_kb: 8447.00 :small_red_triangle_up: ( previous job: 8623.00, degradation: 97.96%)
  • fedora-41-xfce_root_rnd4k_q1t1_write 3:write_bandwidth_kb: 1084.00 :small_red_triangle_up: ( previous job: 1126.00, degradation: 96.27%)
  • fedora-41-xfce_private_seq1m_q8t1_read 3:read_bandwidth_kb: 370129.00 :small_red_triangle_up: ( previous job: 401907.00, degradation: 92.09%)
  • fedora-41-xfce_private_seq1m_q1t1_write 3:write_bandwidth_kb: 91176.00 :green_circle: ( previous job: 41375.00, improvement: 220.36%)
  • fedora-41-xfce_private_rnd4k_q32t1_read 3:read_bandwidth_kb: 97214.00 :green_circle: ( previous job: 87999.00, improvement: 110.47%)
  • fedora-41-xfce_private_rnd4k_q1t1_read 3:read_bandwidth_kb: 8414.00 :small_red_triangle_up: ( previous job: 8744.00, degradation: 96.23%)
  • fedora-41-xfce_volatile_seq1m_q8t1_read 3:read_bandwidth_kb: 375027.00 :small_red_triangle_up: ( previous job: 392725.00, degradation: 95.49%)
  • fedora-41-xfce_volatile_seq1m_q1t1_read 3:read_bandwidth_kb: 341666.00 :green_circle: ( previous job: 294875.00, improvement: 115.87%)
  • fedora-41-xfce_volatile_rnd4k_q32t1_read 3:read_bandwidth_kb: 85383.00 :green_circle: ( previous job: 71108.00, improvement: 120.08%)
  • fedora-41-xfce_volatile_rnd4k_q1t1_read 3:read_bandwidth_kb: 8430.00 :green_circle: ( previous job: 8408.00, improvement: 100.26%)

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.

4 participants