Commit graph

161 commits

Author SHA1 Message Date
Tomáš Hozza
53301d5e6f GHA: enable the stale action to delete its saved state
It turns out that the stale action is not able to delete its saved
state due to missing permissions. As a result, it was not processing
issues and PRs, that have been processed once, for almost a month.

The error in the job log was:
```
Warning: Error delete _state: [403] Resource not accessible by integration
```

The fix is to add `actions: write` to the action permissions

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-06-18 15:07:25 +01:00
Brian C. Lane
3f91723402 Tests/tox: Fedora 43 is now using python 3.14
Add testing on pythong 3.14 and keep testing on python 3.13 for the
current stable Fedora version (42 at this time).

Use osbuild-ci:latest-202506112350 for tests.yml
2025-06-17 00:21:21 -07:00
Tomáš Hozza
e294f38d9c Tests: fix packit config validation
Packit changed the command to validate its configuration, without
keeping backward compatibility.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-04-22 21:15:21 +02:00
Achilleas Koutsou
56fca5d632 github: bump ubuntu runners to 24.04
20.04 is EOL soon.
2025-04-09 00:04:29 +02:00
Tomáš Hozza
09bc0d1ffb GH Action/create-tag: allow passing the version when run manually
Modify the action to allow passing the version when run manually. This
will be useful in the future once we branch-off a `rhel-x.y` branch to
backport a fix and will be doing the first "dot" release from such
branch.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-04-08 21:20:31 +02:00
Tomáš Hozza
6c9c314b48 CI: update osbuild-ci container to latest-202502250751
The main reason is that it comes with license_expression python package
needed for newly added SBOM test cases.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-02-27 13:31:19 +01:00
Tomáš Hozza
8fe28a2e98 GH/update-images: fix missing quote in the script
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-02-14 17:48:13 +01:00
Brian C. Lane
d30cbde6f8 workflows: Switch utility workflows to using ubuntu-24.04
Pin the os version at 24.04 to avoid unexpected changes that can happen
when using ubuntu-latest
2025-02-12 22:23:32 +00:00
Brian C. Lane
26b48e87a9 workflows: Use ubuntu-24.04 for tests
Pin the ubuntu os version at 24.04 to avoid unexpected changes that can
happen when using ubuntu-latest
2025-02-12 22:23:32 +00:00
Tomáš Hozza
f299c02414 Add initial CODEOWNERS file
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-02-06 18:33:14 +01:00
Tomáš Hozza
89d8aa623b GH actions: update the osbuild-ci* images to latest-202501201758
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-02-05 12:00:20 +01:00
Tomáš Hozza
35dda557ab GH Action/update-images: escape back-quote when echoing PR body
Make sure that shell does not interpret the text within the back-quote
as a command to execute in a sub-shell.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-02-03 12:47:35 +01:00
Tomáš Hozza
cb0b44701f GH Action: don't push any updates to manifest-db repo
This is no longer relevant or needed.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-01-31 10:18:14 +01:00
Tomáš Hozza
b3647dfb75 GH Action: update images ref in Schutzfile on schedule
Add a simple script and an action to update images ref in Schutzfile on
schedule.

Both, the script and action are based on those in the osbuild/images
repository and the credit for those goes to Achilleas Koutsou.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-01-31 10:18:14 +01:00
Simon Steinbeiss
cdf8856f19 github/actions: Enable /jira-epic slash commands
This change allows for using the command to create Jira Tasks under a
given Epic both in a pull request comment or in the pull request
description.
2024-12-16 11:02:34 +01:00
Ondřej Budai
b3123a1c19 github: prevent script injections via PR branch names
Prior this commit, ${{ github.event.workflow_run.head_branch }} got
expanded in the bash script. A malicious actor could inject
an arbitrary shell script. Since this action has access to a token
with write rights the malicious actor can easily steal this token.

This commit moves the expansion into an env block where such an
injection cannot happen. This is the preferred way according to the
github docs:
https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
2024-12-03 18:40:04 +01:00
Michael Vogt
bca7fb1418 workflow: install python3-pytest too to workaround test_host.py
The test_host.py:test_signals_on_separate_fd (and more)  runs
itself but that run will happen without the tox env so a pip/tox
installed pytest will not be found, install the pytest package
as a workaround.
2024-11-28 20:06:51 +01:00
Michael Vogt
b3b639517a workflow: add smoke test that runs unit tests as user
This commit adds a tiny smoke test that runs the unit tests as
a normal user on a regular github runner. This should ensure that
we catch issues like in osbuild#1936.
2024-11-28 20:06:51 +01:00
Tomáš Hozza
a6c7b56d98 Tests/tox: latest Fedora uses Python 3.13, so use it
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-11-28 13:29:12 +01:00
Tomáš Hozza
81cc279074 GH actions: use the latest build of osbuild-ci* containers
This will bring the latest image builds with new dependencies for unit
tests.

In addition, pin down the osbuild-ci-c*s container to a specific tag, to
ensure stability of the CI.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-11-28 13:29:12 +01:00
Paweł Poławski
8f7a3d7234 CI: Update excluded tests list
After removal of TOML write packages on c9s and c10s some
tests using this library needs to be skipped.
2024-10-09 17:41:01 -07:00
Tomáš Hozza
9510e88c0f CI: determine the libdnf python version from /osb/libdnf-python-version
Instead of hard-coding the Python version that the installed
python3-dnf has been built against on the latest Fedora, read the
value from the osbuild-ci container. The container now has the version
written in /osb/libdnf-python-version.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-09-18 12:26:36 +02:00
Tomáš Hozza
75b6fb4abe Tests: allow site packages in tox to test code depending on 'dnf'
'dnf' Python package can't be installed using pip in the tox
environment. In order to test the code which uses it, we need to use the
system version. Our testing environment uses Fedora as the system,
therefore we can reasonably use the system version of 'dnf' only with
Python version which is on Fedora.

Enable site packages in tox for Python 3.12 when testing osbuild
internals.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-09-18 12:26:36 +02:00
Paweł Poławski
92e5e43794 CI: Add testing based on Centos containers
In the release loop upstream changes are merged to Centos every two
weeks. This creates a delay in error detection when new tests
being added upstream.

Running tests in Centos based containers on top of the upstream code
more frequently should speed up error detection.
2024-06-24 20:25:04 +02:00
Michael Vogt
ed0239c808 workflow: bump osbiuld-ci container to include podman, et al.
This will include the latest osbuild-ci container changes from
https://github.com/osbuild/containers/pull/73

This includes a bunch of binaries that were missing and lead
to skpped tests.
2024-05-02 12:09:44 +02:00
Michael Vogt
15e969c4c6 workflow: show summary why tests are skipped
In PR#1752 Florian noticed that `make_containers` is buggy [0] in
one specific testcase. However the GH actions did not trigger and
uppon inspection the test is skipped:
```
stages/test/test_container_deploy.py::test_container_deploy_integration SKIPPED [  7%]
```
This commit adds `-rs` to get a summary why the tests are skipped.

This is useful in general, I suspect the test container might miss
podman but this commit will bring clarity.

[0] https://github.com/osbuild/osbuild/pull/1752#discussion_r1578294358
2024-04-25 20:44:32 +02:00
Brian C. Lane
970b9409b7 workflow: Use new container ghcr.io/osbuild/osbuild-ci:latest-202404161303 2024-04-23 07:42:09 +02:00
Michael Vogt
d9a228d3e8 workflow: simplify unit test running in the GH workflow
Run only two jobs in the GH runner for the unittest. The `test_stage.py`
because it takes a very long time and needs to run in parallel and
all the other tests.

This split avoid that we forget to add new unittests to the matrix
as we did before (see e.g. https://github.com/osbuild/osbuild/pull/1731)
and it will also enable the tests in:
- sources/test
- inputs/tests
- mounts/test

to run.

This will reduce the "granularity" of the test output a bit, in the
GH runner we only see two unit test matrix jobs now. However that
should not be too bad because the non-stage tests are really quick
to run.
2024-04-16 15:16:49 +02:00
Michael Vogt
5d3dac9fb9 tox,workflow: pass tests to run via tox {posargs} instead of env
Using an environ for passing the tests is a bit of a headache when
it comes to quoting which is important when trying to write something
like: `-k "not test_stages.py"`.

I (personally) also find it slightly nicer/more intuitive to be able to do:
```
$ tox -e py36 -- ./test/mod
```
compared to
```
$ TEST_CATEGORY="./test/mod" tox -e py36
```
2024-04-16 15:16:49 +02:00
Achilleas Koutsou
b432f43022 github: add tools/test to unit test matrix
Run the depsolver tests.
2024-04-16 07:38:18 +02:00
Brian C. Lane
6549bf1992 trigger-gitlab.yml: Bump actions/checkout to v4 2024-04-10 01:32:51 +02:00
Brian C. Lane
ecb91ecb1e test.yml: Bump actions/checkout to v4 2024-04-10 01:32:51 +02:00
Brian C. Lane
21c1573ae8 generate.yml: Bump actions/checkout to v4 2024-04-10 01:32:51 +02:00
Brian C. Lane
3666aa510a coverity.yml: Bump actions/checkout to v4 2024-04-10 01:32:51 +02:00
Brian C. Lane
922e22758d check.yml: Bump actions/checkout to v4 2024-04-10 01:32:51 +02:00
Achilleas Koutsou
7f6dea860a github: add new workflow for checking json files
Reformat all json files in the repository and check that they're
formatted properly.
2024-03-26 01:20:37 +01:00
Michael Vogt
4f8ff6bc99 workflows: improve speed of test_stages and test_assemblers
The other tests have concurrency issues at the moment.

It seems in https://github.com/osbuild/osbuild/pull/1655 we lost
parallel running. The issue seems to be that `env` does not
actually define a shell environment but only a github environment.

This sets commit sets the shell env explicitly to unbreak us
again.
2024-03-23 15:38:34 +01:00
Michael Vogt
ba08a524a4 github: add cache key to generate.yml flow
There are recent GH failures because the github cache action
complains:
```
Input required and not supplied: key
```
This is slightly odd as we did not provide a cache key before and
it was fine but *shrug*. We also don't really need a cache key,
we always get the same cache, osbuild is smart enough to figure
it out.
2024-03-20 14:20:43 +01:00
Michael Vogt
2efe2de09c workflow: run all unit tests in parallel
There were special cases in the workflow for only running specific
tests in parallel. However how that the test_assemblers parallel
runs are fixed [0] there is really no need for special cases anymore
and we can just run them all in parallel.

[0] https://github.com/osbuild/osbuild/pull/1641
2024-03-11 13:48:47 +01:00
Michael Vogt
1278e5d217 test: fix test_assembler to support parallel runs and run in parallel
The `test_assembler.py` hardcods some filesystem and partition
UUIDs. This leads to hard to diagnose test failures when the
test is run in parallel. The btrfs and xfs filesystem drivers
will see the same uuid for multi created images and error sometimes with
someting like:
```
Mar 06 10:22:54 top kernel: BTRFS error: device /dev/loop104 belongs to fsid aff010e9-df95-4f81-be6b-e22317251033, and the fs is already mounted, scanned by mount (123856)
```
Its a race that only happens when two images are checked at the
same time.

This commit fixes the issue by just using a randomized UUID in
the test_assemblers.py. It also re-enables running the test in
parallel (which make it run a lot faster, from 34min to 14min).
2024-03-06 12:28:10 +01:00
Michael Vogt
87636878da Revert "workflow: run assembler tests in parallel"
This reverts commit ea36e25b09.
2024-03-06 10:43:21 +01:00
Simon Steinbeiss
37d5a23a64 tests: Cancel in-progress tests on PR updates
Before this commit GitHub Action runs that were triggered by a PR were
not canceled when updates were made to the same PR. This lead to even
more clogging of our pipelines and not enough runners being available.

This changes the behavior in a way that whenever a PR gets updated all
still-in-progress runs get canceled and new runs get spawned.
2024-03-05 16:40:34 +01:00
Simon Steinbeiss
b8e0253493 actions: Add a PR best practices check
This pipeline tests:
1. If the PR description is not empty (blocking)
2. If the PR title follows our format (non-blocking)
   `component: This is the change (JIRA-001)`
3. If 1. and 2. are True, it adds a 'best practice' label to the PR
2024-03-05 12:01:10 +02:00
Michael Vogt
ea36e25b09 workflow: run assembler tests in parallel
The assembler tests currently run around 45min, try to run in
parallel to see how much we can win from that.
2024-03-05 07:44:26 +01:00
Michael Vogt
4d2476a26d test: use OSBUILD_TEST_STORE in test_assemblers.py too
Use the OSBUILD_TEST_STORE in the test_assemblers.py file too
and re-use already downloaded sources.
2024-03-05 07:44:26 +01:00
Simon Steinbeiss
75bb706cb0 actions/test: Only test assemblers on Python3.6
Assemblers are only part of v1 manifests, so the only Python version we
need to test is 3.6 (RHEL8).
2024-03-04 14:39:50 +01:00
Michael Vogt
ba732b8532 workflow, osbuild-mpp: run with cache and use GH cache
Share cache between runs and also put into GH cache accross runs.
2024-03-04 14:06:33 +01:00
Michael Vogt
1ea7b4943c workflow: drop python3.11 from matrix (HMS-3697)
With fedora moving to python3.12 we can stop testing on py311.

As a drive-by this commit also documents why we need to test on
py36 and py39.
2024-03-04 13:51:41 +01:00
Achilleas Koutsou
b42e1afddc github: change container storage driver inside test container
The default overlayfs doesn't work inside the container runner which
causes the test to fail with
  Invalid destination name
  containers-storage:localhost/osbuild-skopeo-test-...:
  'overlay' is not supported over overlayfs, a mount_program is
  required: backing file system is unsupported for this graph driver

Changing the driver to vfs solves the issue.
2024-02-21 17:55:37 +01:00
Michael Vogt
3ec0925bff test: drop -k from -k stages/test test matrix
With pytest 8.0.0 the `-k` option seem to have changed it's
behavior. Drop `-k` therefore.

Tests started to fail recently and it looks like this is because
pytest 8.0.0 changes the semantic of the `-k` option. We used
to pass `-k stages/test` but that seems to no longer work. So
pin pytest to the last good version until this is better
understood.
2024-01-31 09:24:59 +01:00