Commit graph

77 commits

Author SHA1 Message Date
Christian Kellner
4d9a0b3e9f [skip ci] ci: remove automerge again
Didn't work as expected. :(
2021-12-08 23:02:27 +01:00
Christian Kellner
f26ee9b7dd [skip ci] ci: do not require label for rebase
Allow automerge to update the PR without any labels present.
2021-12-08 16:56:20 +01:00
Christian Kellner
6066407a89 [skip ci] ci: switch to using automerge
Instead of using merify which seems to not do what we want, use
a combination of mergify and automerge. We let mergify review
dependabot PRs. We let mergify dismiss reviews on updates but
exclude those from Schutzbot. We then let Schutzbot update and
merge the PRs via automerge if the `ci:automerge` label is set.
2021-12-08 14:13:43 +01:00
Christian Kellner
055b0203a0 [skip ci] ci: preserve reviews across rebase
Re-review the PR after rebasing it. Leave a message to make it
clear that it was not the impersonated person but mergify that
did it.
Ideally, if we had premium, we would impersonate Schutzbot so
it is clear who did it and then use mergify to dismiss reviews
on changes but not for Schutzbot.
2021-12-08 12:38:28 +01:00
Christian Kellner
eaa00884be [skip ci] ci: review PRs for dependabot
Instead of directly queuing it, just add an auto-review for
dependabot and then let the normal PR condition do its job.
2021-12-08 12:38:28 +01:00
Christian Kellner
daf578b2f1 [skip ci] ci: reviews only for queuing
Require reviews to get into the queue, not out of it.
2021-12-06 23:29:47 +01:00
Christian Kellner
410c047c14 [skip ci] ci: remove label _after_ pr is merged
Don't try to do it in the same action as otherwise the bot will
refuse to actually add it to the queue.
2021-12-06 23:05:30 +01:00
Christian Kellner
a3dc87bd76 [skip ci] ci: accept LGTM neutral (mergify)
Neutral is also ok.
2021-12-06 22:15:12 +01:00
Christian Kellner
0bff008922 [skip ci] ci: don't require branch protection
For dependabot we dont want it anyway (but it is true by default).
Also remove it for "merge via auto-label", so that once all the
conditions are met the PR is queued and the label is removed.
Currently the queuing might not happen because the branch protection
is not met. Therefore we make the condition explicit and remove the
branch protection.
2021-12-06 20:42:38 +01:00
Christian Kellner
43d4b3cf45 ci: initial mergify configuration
Define a merge queue "default", with all current checks (minus the
ostree one) are required to get out of.
Two rules to get into the queue: 1) standard branch protection,
plus packit, plus the ci:automerge
2) dependabot, does not require the standard branch protection
since that implies reviews. Instead the checks are manually
listed.
2021-12-06 17:44:31 +01:00
Christian Kellner
04423e8a6a ci: update to latest osbuild ci image
Needed to get `cryptsetup` package needed for testing the luks2
related stages and devices.
2021-11-19 00:19:05 +00:00
Simon Steinbeiss
493b1f9a1b Let schutzbot do the post-release version bump
We need a privileged / admin user doing the post-release version bump as
this is a direct commit to main (i.e. without a PR) so switch to using
schutzbot with a scoped personal access token (only public_repo).
2021-11-01 21:58:35 +01:00
Simon Steinbeiss
a33f1a975b Fix GitHub Action tag pattern
GitHub Actions currently doesn't support regular expressions, but
instead only "filter patterns".
https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
2021-10-25 15:13:03 +02:00
Ondřej Budai
2f1b5d72dd trigger-gitlab: do not interpret the fetch_pulls outputs
Here documents are by default interpreted. Quoting the delimiter prevents
that.

See https://stackoverflow.com/questions/27920806/how-to-avoid-heredoc-expanding-variables
2021-10-21 11:35:08 +02:00
Simon Steinbeiss
4ff59e2086 Bump version numbers ahead of release
This is necessary for the new simplified release process and is done
ahead of time once for the upcoming release now.
After osbuild 40 this will be done by the GitHub composite action.
2021-10-19 11:21:54 +02:00
Simon Steinbeiss
4ea2915ef7 Switch to simple upstream releases
This commit changes our release process from the model of having a
release commit (and pull request) which also updated the NEWS.md file
and bumped the versions in the osbuild.spec and setup.py files to simply
pushing a tag.

After the tag (containing the release notes) is pushed, a GitHub
composite action is triggered that creates a GitHub release with the
contents of the git release tag. Furthermore the bumping of the version
number now always has to happen directly after a release to avoid having
to push a(n untested) commit to main for the release and this is also
handled by the GitHub composite action.

Finally packit pushes directly to dist-git now on pushing the release
tag, so no pull-request needs to be reviewed and merged anymore.
2021-10-19 11:21:54 +02:00
Sanne Raymaekers
79f842d4e7 .github: Write PR data to a file first in trigger-gitlab
Using echo breaks if any PR body contains a `'` character.
2021-10-07 10:07:41 +02:00
Christian Kellner
ebb7a982f8 ci: trigger gitlab from checks not tests
Use the "Checks" workflow to trigger gitlab; this workflow should
be much quicker to complete and thus the gitlab ci will trigger
earlier leading to a more parallel ci run.
2021-09-29 20:07:59 +02:00
Christian Kellner
ead48226fc ci: split out checks from tests
Split out all checks that verify documentation, spelling and that
test data is update to date from the actual unit and integration
tests.
2021-09-29 20:07:59 +02:00
Sanne Raymaekers
706e1ce243 .github: Get PR number from sha
Sadly `github.event.workflow_run.pull_requests` is empty if the pull
request was opened from another fork. Use the sha to find an open PR,
otherwise assume it's a branch.
2021-09-29 13:24:46 +02:00
Sanne Raymaekers
1c9fd1cf99 .github: Use the workflow_run event data in trigger-gitlab
This workflow doesn't have access to the original pull request event
that resulted in this workflow being triggered.

Simply use `head_sha` which will contain the PR sha if it was triggered
by a PR's workflow, or the branch sha if it was triggered from a
branch's workflow.
2021-09-27 16:25:45 +02:00
Christian Kellner
ea2ee10268 ci: trigger gitlab ci via workflow run event
The `workflow_run` event is triggered either when a workflow was
requested or complete (see `types`). We can use this event as a
trigger for the gitlab ci conditioning on a successful workflow
run of the main tests ("Tests" workflow). This will ensure that,
with outside contributor protection turned o, no secrets are
leaked via PRs from non-contributors, but also that gitlab ci is
run for those PRs once they were manually allowed to run.
The only downside is that now the gitlab ci will only run after
the main workflow ("Tests) has completed and thus serializing
both CI runs. OTOH gitlab CI is quite intense so maybe this is
not so bad after all. If in the future we want to parallelize
both CI runs we could have a third "precheck" condition with
maybe the spell checker and the pylint tests that the main tests
as well as the gitlab ci run depend on.
2021-09-24 17:51:40 +02:00
Christian Kellner
5ba1807837 ci: use new ci image that includes lvm2
Use a new CI container that now includes lvm2[1].

[1] https://github.com/osbuild/containers/pull/20
2021-08-13 12:20:54 +02:00
Christian Kellner
e92b40952b samples: replace with symlink to test data
Instead of maintaining a separate set of samples that by now are very
much outdated (using Fedora 31 or older), make the samples directory
a symlink to the test data. Manifests in there are indeed tested and
maintained.
The error and noop samples are also covered in unit tests, so no need
for extra samples there either.

CI: remove the sample validation since all the test data manifests
    are actually built.
2021-07-12 18:44:50 +02:00
Jakub Rusz
e5d599d8ee ci: add Gitlab CI
This is an inital commit that enables the use of Gitlab CI.
2021-06-30 19:54:37 +02:00
Jakub Rusz
803c698f9a ci: Remove Jenkins in favor of Gitlab CI
Jenkinsfile and the trigger are no longer neccessary since
we're moving all testing to Gitlab CI.
2021-06-30 19:54:37 +02:00
Tomas Hozza
e96366fb10 stages/cloud-init: add new stage for configuring cloud-init
Add new `org.osbuild.cloud-init` stage, which currently allows to create
configuration files for cloud-init under `/etc/cloud/cloud.cfg.d`. The
stage supports only a very limited subset of cloud-init configuration
options, which is covering needs of RHEL AMI images.

The schema mandates that if the 'configuration_files' option is
specified, then at least one configuration file must be defined. In
addition each section of the configuration must contain at least one
property (section or configuration option).

Add `python3-pyyaml` package to the `F34-build` testing manifest,
because it is required for running and testing the new stage.
Regenerate all affected manifests.

Add test for the new stage.

Update the `osbuild-ci` container image used for testing to a new tag,
which includes python3-pyyaml, the dependency of the new stage.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-06-24 16:55:18 +02:00
David Rheinsberg
87a7b4ae5f ci: update images to F33
We explicitly pinned the F32 CI images in the past due to update issues
in F33. However, those have been resolved and we should switch back to
the most recent Fedora CI images.

This commits switches all instances of the osbuild-ci image back to the
latest stream, snapshot taken on 2021-02-19 13:11 (latest-202102191311).

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2021-03-17 14:31:26 +00:00
Christian Kellner
99160ad369 ci: increase fetch-depth to 2
Codecov apparently has trouble detecting the git commit if the
fetch depth is only 1 (the default). Therefore increase it.
See https://github.com/codecov/codecov-action/issues/190 for
more details.
2021-03-11 12:46:24 +00:00
David Rheinsberg
3072f882ca ci: convert to new immutable ci images
Use the new immutable image infrastructure from `osbuild/containers`.
While at it, also switch over to the new github-actions helper, now that
we no longer run `systemd-nspawn` in our tests.

The old image was renamed from `ghci-osbuild` to `osbuild-ci` to avoid
accidentally replacing old images. The new infrastructure uses immutable
images, so downstream will no longer get automatic updates, unless the
`latest` tags are used.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2021-02-19 11:02:17 +01:00
Ondřej Budai
dd9099c53a ci: trigger schutzbot from github action
Previously, we had a webhook relay. It received a notification from Github
and sent it to AWS SQS. Now, the webhook is dead. The new method (already used
in osbuild-composer and image-builder) is to send the notification directly
from a github action to AWS SQS.
2021-02-12 17:56:14 +01:00
Christian Kellner
14fc39e416 ci: include test_ostree in github action
Execute the new test_ostree integration test suit.
2021-02-12 15:55:43 +01:00
Tomas Hozza
8cb3d25329 GHCI: Don't use --always-make to regenerate test data
`make test-data` always regenerates test data, without the need to pass
the `--always-make` option to make.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-01-15 13:57:49 +01:00
Christian Kellner
e85d340cd8 ci: send coverage data to codecov
Integrate with codecov. Define a threshold of 5% to pass. Coverage
is cumulative, i.e. all the tests send their coverage to codecov,
which will integrate them all into a total.
2020-12-10 16:14:37 +01:00
Christian Kellner
0c53e55753 ci: use pytest to test
This has nicer output and will make adding coverage easy in the
near future.
2020-12-04 18:24:48 +01:00
Christian Kellner
2902d0945b ci: check spelling via codespell
Use the github action[1] provided by the codespell project to
check the spelling on every PR.

[1] https://github.com/codespell-project/actions-codespell
2020-10-06 14:41:00 +02:00
Christian Kellner
a505a82169 ci: schedule coverity only for osbuild/osbuild
Don't schedule the run of coverity on forks of osbuild, but only
on the main repository.
2020-07-07 08:26:53 +02:00
Christian Kellner
3d13c825c0 ci: run coverity check every night
Add a github workflow that will trigger the run of coverity every
night at 05:00 UTC. Uses the new Makefile coverity targets.
2020-06-24 10:01:24 +02:00
David Rheinsberg
5c3ce5c30a ghci: merge unittest invocations
Merge all unittest invocations into a single Github-Workflow Job. This
simplifies our workflow and allows us to easily parallelize individual
jobs.
2020-06-05 09:27:40 +02:00
David Rheinsberg
0010514c4a test: move assembler-tests into ./test/run/
Move the last remaining test into the correct subdir. With this done,
all our tests run in one of the 3 groups:

   * `make test-src`
     Run tests against the source-code, including linters.

   * `make test-mod`
     Run unit-tests on the individual python modules. This needs no
     special permissions (unless noted in each test) or runtime
     environments. It is meant to be fast and easy to run in all
     circumstances.

   * `make test-run`
     Run tests that execute the osbuild pipeline. This requires
     superuser privileges and will likely take a while. Furthermore,
     this might produce large artifacts.
2020-06-05 09:27:40 +02:00
David Rheinsberg
55da864e0a build: align makefile targets with test-targets
Align the makefile targets with the test-targets (`module` -> `mod`,
etc.). This way, we have consistent names everywhere.

While at it, move the `make test-run` invocation closer to the others.
2020-06-05 09:27:40 +02:00
David Rheinsberg
d584a1e225 test: move stage-tests into test/run and test/data
Move the stage-tests over to the new test-infrastructure. This moves
the test invocation into `./test/run/test_stages.py`, so it is invoked
as part of the runtime-tests. Secondly, the test-data is stored in
./test/data/stages/ so the path is relative to
TestBase.locate_test_data().

While at it, this also drops the dynamic class modifications and instead
uses subTest(). This simplifies the code quite a bit and avoids
dynamically creating python code.
2020-06-05 09:27:40 +02:00
David Rheinsberg
e8445da3d9 test: move test_osbuild.py into module tests
Move the `test_osbuild.py` test into the module-test directory. This
test contains just a bunch of basic functionality tests for a selection
of osbuild modules. Hence, it can be run together with the other module
tests.
2020-06-05 09:27:40 +02:00
David Rheinsberg
3cf8b79e80 test: move test_objectstore into module-tests
Move `test_objectstore` into the module-level tests. This allows us to
run it as part of `make test-module.

Make sure to properly guard it as root-only module.
2020-06-05 09:27:40 +02:00
David Rheinsberg
9bb6123963 test: convert test_boot to runtime tests with F32
Move the `test_boot` suite into ./test/run closer to the other runtime
tests, and convert the used manifest over to an MPP based F32 manifest.
2020-06-05 09:27:40 +02:00
David Rheinsberg
2aa9755f88 ci: regenerate test data
Run the MPP tools in the CI and verify the committed test-data did not
change and is up-to-date.

This runs `make test-data` and then simply uses `git diff --exit-code`
to trigger a CI failure if there are any differences in ./test/data.
2020-06-05 09:27:40 +02:00
David Rheinsberg
a3d1e3ff50 test: import no-op test into the runtime-tests
Add a new trivial runtime-test which simply runs a no-op pipeline. This
is a fast, trivial test that simply verifies osbuild is properly setup
and accessible.

Remove the explicit no-op test from the CI, now that the test-suite has
it as well.
2020-06-05 09:27:40 +02:00
Major Hayden
0640610f54 Remove RPM builds in GitHub Workflows
We are now building RPMs via mock in Jenkins, so we don't need these RPM
build jobs in GitHub Workflows.

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-22 09:00:01 -05:00
Major Hayden
53ba692dbe GH Actions: Use upstream Fedora containers
Work around the quay.io issues by using the standard Fedora containers.
Also, make most of the dnf operations a little quieter to make it easier
to find problems.

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-22 10:39:51 +02:00
David Rheinsberg
0ffae822ce ci: run test-src with ghci
Use the GHCI image to run `make test-src`. This makes sure all our
dependencies are available (including `dnf`, `hawkey`, and other python
packages).
2020-05-20 18:54:38 +02:00