Skip to content

feat: rewrite ujust harden-flatpak in Python#1599

Merged
RoyalOughtness merged 4 commits intosecureblue:livefrom
HastD:harden-flatpak
Nov 20, 2025
Merged

feat: rewrite ujust harden-flatpak in Python#1599
RoyalOughtness merged 4 commits intosecureblue:livefrom
HastD:harden-flatpak

Conversation

@HastD
Copy link
Copy Markdown
Collaborator

@HastD HastD commented Nov 11, 2025

The Python rewrite has the same basic logic but with some improvements to user-facing messages and the app ID search logic.

The third-party inquirer module is used for letting the user select from a list of options, and is installed via RPM. (I put it in common-packages.yml rather than desktop-packages.yml because it's likely to be useful in other ujust scripts, and is a small package in any case.)

Also move audit-script-specific parts of the utils module into a new audit_utils module, and fix a minor type error in is_using_vpn.

@RoyalOughtness
Copy link
Copy Markdown
Collaborator

Aside from the cyclomatic complexity codacy complaints (which are almost certainly already present in the bash), this seems good

@HastD
Copy link
Copy Markdown
Collaborator Author

HastD commented Nov 13, 2025

The cyclomatic complexity issues being flagged are due to the difference between Lizard (the complexity analyzer Codacy uses) and the one Ruff uses; this issue has come up before, and I still think the one Ruff uses does a better job of measuring the complexity of Python code. The main difference I've noticed is that with Lizard, list comprehensions increase cyclomatic complexity as if they were written as loops.

Ruff is set up to check that all functions have cyclomatic complexity at most 8, and the code here passes that check.

RoyalOughtness
RoyalOughtness previously approved these changes Nov 14, 2025
The Python rewrite has the same basic logic but with some improvements
to user-facing messages and the app ID search logic.

The third-party `inquirer` module is used for letting the user select
from a list of options, and is installed via RPM. (I put it in
`common-packages.yml` rather than `desktop-packages.yml` because it's
likely to be useful in other ujust scripts, and is a small package in
any case.)

Also move audit-script-specific parts of the `utils` module into a new
`audit_utils` module, and fix a minor type error in `is_using_vpn`.
This ensures the version of `just` used in CI is the same as the one
used in the images. Also made some minor reliability improvements to
`manuallyinstalljust.sh`: use `mktemp` to generate a temporary directory
instead of just using `/tmp`, and set `curl` options to retry on failure
and to not suppress error message output.
@RoyalOughtness RoyalOughtness merged commit 22c120b into secureblue:live Nov 20, 2025
21 of 22 checks passed
@HastD HastD deleted the harden-flatpak branch November 20, 2025 03:31
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.

3 participants