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

workflows: Run unit tests in our tasks container #21

Closed
wants to merge 11 commits into from
Closed

Conversation

try {
const passphrases = JSON.parse(window.sessionStorage.getItem("cockpit_passphrases")) || { };
passphrases[device_name(block)] = passphrase;
window.sessionStorage.setItem("cockpit_passphrases", JSON.stringify(passphrases));

Check failure

Code scanning / CodeQL

Clear text storage of sensitive information High

This stores sensitive data returned by
a call to getItem
as clear text.
This stores sensitive data returned by
an access to passphrase
as clear text.
This stores sensitive data returned by
an access to passphrases
as clear text.
This stores sensitive data returned by
an access to old_passphrase
as clear text.
This stores sensitive data returned by
an access to passphrase
as clear text.
This stores sensitive data returned by
an access to passphrase
as clear text.
This stores sensitive data returned by
an access to passphrase
as clear text.
This stores sensitive data returned by
an access to passphrase
as clear text.
This stores sensitive data returned by
an access to passphrase
as clear text.
@martinpitt martinpitt force-pushed the unit-tasks branch 9 times, most recently from 1cb3f92 to 300fab7 Compare February 13, 2024 16:22
This spotted a wrong `pytest.fail()` invocation, whose second argument
(`pytrace`) is a boolean. Make the message part of the reason.
And use the `/` operator instead of the `Path()` constructor for
building subpaths.
This covers the two happy paths of creating a new file and updating an
existing one.
Catch errors from `rename()` and translate them into an `access-denied`
(e.g. the specified `path` is a directory) or `not-found` (directory is
deleted underneath us) channel error instead of crashing the bridge.

Likewise, intercept `FileNotFoundError` when trying to create a temp
file in a nonexisiting directory. That previously returned
`internal-error`, but it's really not. We don't have a really good
exisiting problem code, but `access-denied` is closest.
@martinpitt martinpitt force-pushed the unit-tasks branch 4 times, most recently from 274a919 to c8b6ee7 Compare February 13, 2024 17:27
We don't support the C bridge on this branch any more.
We won't add a lot of new C code any more, valgrinding Python code isn't
very useful (or architecture specific), and more and more distributions
drop i386 support. Also, we still run the unit tests during RPM package
build through packit/COPR, which cover even more architectures.

This paves the way for dropping the unit test container altogether in
favor of running the tests in the cockpit/tasks container, once we agree
on how to build a proper staging setup.

Drop tools/valgrind.supp which was only relevant for i386.
@martinpitt martinpitt force-pushed the unit-tasks branch 4 times, most recently from 7887269 to c9d40d0 Compare February 13, 2024 20:15
`tput` requires `$TERM`. The Debian-based unit test container sets this
by default, but the Fedora based cockpit/tasks container doesn't. Set it
explicitly to a known-good value to make sure the test passes there.
It hasn't helped us in years, modern gcc has good static analysis (plus
of course CodeQL and Coverity), none of our supported downstream distros
care, and we are not going to add significant amounts of C code any
more.
This reduces our tools like `ruff` to a single source of truth (as all
our other projects already run their unit tests and linting in the tasks
container). It also removes a lot of moving parts only relevant for CI.
In practice, us developers run the unit tests in toolbox or our own dev
machines anyway.

Move building the guide in the release workflow to the tasks container
as well.
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