Commit graph

2124 commits

Author SHA1 Message Date
David Rheinsberg
5aaa4e602e test/isort: print diff
Make isort print the diff so we can actually fix the problems. This
might be overly verbose when introducing isort, but for new changes it
is very nice to see the actual code it complains about.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-09-23 12:08:10 +02:00
David Rheinsberg
2d6d902428 tree: pep8 + linter fixes
For some reasons I forgot to fix those in the previous runs. Fix a
linter and pep8 warning.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-09-23 12:08:10 +02:00
Simon Steinbeiss
f3033dd579 packit: Enable Bodhi updates for unstable Fedoras
As we don't only want to get Bodhi updates for the stable releases, but
also the ones still in development, we need to use 'fedora-branched'.

See https://packit.dev/docs/configuration/#aliases
2022-09-23 11:06:11 +02:00
Vit Mojzis
34c801e670 selinux: Update based on latest packaging guide
https://fedoraproject.org/wiki/SELinux/IndependentPolicy

- Add dependency on selinux-policy-targeted
- Move %selinux_relabel_pre to osbuild-selinux
- Start shipping osbuild interface file
- Exclude installed policy module file from RPM verification

Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
2022-09-23 10:10:31 +02:00
Ondřej Budai
c824e18b45 packit: add epel-9 to copr_build
Currently, we build only in the CS9 chroot. It contains newer packages than
RHEL 9 has which causes the package built in CS9 chroot uninstallable
on RHEL 9 - selinux-policy is the usual suspect.

Let's enable builds in the EPEL 9 chroot (which is actually EPEL 9 on RHEL 9)
in order to have a repository for users that use RHEL 9.

This was requested in the Image Builder chat room.
2022-09-15 09:48:35 +02:00
David Rheinsberg
054bba5228 stages/greenboot: avoid new pylint suppressions
The `consider-using-f-string` suppression is new, thus old pylint will
complain about unknown directives. If we start ignoring unknown
directives for this reasons, we will no longer get warned about
misspelled directives. Hence, lets avoid this for now and just use an
f-string.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-09-14 12:26:37 +02:00
schutzbot
a298254dce Post release version bump
[skip ci]
2022-09-14 08:18:10 +00:00
Thomas Lavocat
77153698c5 ci: remove the composer image test
This test that compiles and compare image-info from manifests is
redundant with the tests from manifest-db.
2022-09-14 10:00:43 +02:00
David Rheinsberg
a65cf82b5e osbuild-mpp: fix pylint warnings
Fix a bunch of pylint warnings about coding-style. Nothing really major.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-09-13 17:41:27 +02:00
David Rheinsberg
73ad1a3eac osbuild-mpp: avoid symbol shadowing
Avoid using `os` or `input` as symbol names, since they shadow
previously defined symbols.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-09-13 17:41:27 +02:00
David Rheinsberg
0f49ed9f98 osbuild-mpp: implement virtual functions
Make sure to correctly implement virtual functions and raise
NotImplementedError, as suggested by the standard library. Pylint will
otherwise complain about unavailable functions being accessed.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-09-13 17:41:27 +02:00
David Rheinsberg
0471c646a8 osbuild-mpp: fix YAMLError.problem accessors
The `problem` member is only defined if a problem-mark is present. If
the mark is not set, we get no details on the error whatsoever and have
to just print a generic error message.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-09-13 17:41:27 +02:00
David Rheinsberg
8c6049f197 osbuild-mpp: fix PartitionTable.__getitem__() bail-out
The __getitem__() function incorrectly returns `None` if the
partition-type is not found. Make sure to always return IndexError if
the requested value is outside the supported range.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-09-13 17:41:27 +02:00
David Rheinsberg
8c367dfa6f tree: fix pylint warnings
This fixes pylint warnings on our modules that are currently not part of
CI-pylint. The fixes should all be straightforward.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-09-13 16:21:14 +02:00
David Rheinsberg
cdd65d4fd9 stages/greenboot: ignore f-string recommendation
The explicit string-formatting is definitely easier to manage than an
f-string in the greenboot case. Make pylint suppress its recommendation.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-09-13 16:21:14 +02:00
David Rheinsberg
c50f14974e build: extend pylint suppressions
Two more suppressions for pylint:

 - line-too-long: Avoid complaining about lines longer than 100ch. We
                  do that all the time and this new linter-default makes
                  newer pylints complain all the time.
 - useless-option-value: Newer pylint decided to obsolete old
                         annotations and start complaining that they are
                         obsolete. We can either stop supporting old
                         pylints are disable those warnings on newer
                         pylints. I opted for the latter.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-09-13 16:21:14 +02:00
Simon de Vlieger
7d8b2302c0 git: ignore isort commit 2022-09-12 13:32:51 +02:00
Simon de Vlieger
ea6085fae6 osbuild: run isort on all files 2022-09-12 13:32:51 +02:00
Simon de Vlieger
98daf1a87d osbuild: setup isort autochecking
The `test-src` makefile target now also runs isort against all source
files and reports errors.
2022-09-12 13:32:51 +02:00
Simon de Vlieger
a5be1cc4d2 linting: use-implicit-booleaness-not-comparison
Newer warning from pylint, also consistent with how we do things
elsewhere. Note that this only applies to one file in the tests but
disabling it would be very weird for such a small fix.
2022-09-12 10:52:09 +02:00
Simon de Vlieger
321587ad41 linting: fix use-dict-literal
Use the dict literal `{}` instead of `dict()`, this is a warning in
newer pylints and its consistent with what we do elsewhere.
2022-09-12 10:52:09 +02:00
Simon de Vlieger
873a071d43 osbuild: share terminal formats between files 2022-09-09 21:43:56 +02:00
Simon de Vlieger
5cb2da55f1 test: run mypy in test-src not in GH actions 2022-09-09 18:51:57 +02:00
Simon de Vlieger
e330e82cf0 lint: appease autopep8 2022-09-09 15:33:29 +02:00
Simon de Vlieger
b07aca5d86 modules: explicit encodings for open() 2022-09-09 15:33:29 +02:00
Simon de Vlieger
38d2ab685c test: explicit encodings for open() 2022-09-09 15:33:29 +02:00
Simon de Vlieger
3703328751 osbuild: explicit encodings for open()
Provides explicit encodings for all calls to `open()`, this is a newer
pylint warning but also just makes sense to do.
2022-09-09 15:33:29 +02:00
Ygal Blum
42552e0436 osbuild-mpp: Add url option to mpp-embed
Allow the user to pass a URL to be embeded as org.osbuild.curl input

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2022-09-06 14:28:06 +03:00
Alexander Larsson
f4bfce05e3 org.osbuild.oci-archive: Support setting Entrypoint
This allows setting Entrypoint (as well as Cmd) in the oci image,
as per the spec:

  https://github.com/opencontainers/image-spec/blob/main/config.md

Note: These two are not equivalent, the Cmd part is replaced by the
argument on the `docker run` commandline, whereas the entrypoint is
kept from the config, so it is important to expose both of these.
2022-09-05 13:10:47 +02:00
Simon Steinbeiss
bc72803c9a packit: Enable Bodhi updates workflow 2022-09-01 15:22:22 +02:00
Achilleas Koutsou
4bc6e226ea rpmbuild: add fedora-37 2022-09-01 11:31:58 +02:00
Achilleas Koutsou
f699720dbd sources/curl: quote URL paths before downloading
Some package versions [1] can contain carets and other characters that
curl doesn't like.  These need to be URL encoded.

Interestingly, the documented way of replacing components in a parsed
URL from urllib in Python is by calling the (seemingly private)
`_replace()` method [2].

[1] https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_snapshots
[2] https://docs.python.org/3/library/urllib.parse.html#url-parsing
2022-08-31 22:28:54 +01:00
schutzbot
1782f2fea9 Post release version bump
[skip ci]
2022-08-31 08:16:19 +00:00
Thomas Lavocat
f38ddb5f20 test: manifests testing on each PR
On each PR test that osbuild don't break the image generation by testing
against the manifest-db that the produced image-infos are still the same
as the one stored.
2022-08-30 14:42:13 +02:00
schutzbot
d467e88f99 Post release version bump
[skip ci]
2022-08-26 17:11:12 +00:00
Christian Kellner
ba218f781d pipeline: include mounts in stage checksum
When calculating the checksum of the stage, the mount options were
not included. This was maybe deliberate, because if the mounts of
a stage change, it is very likely that previous stages change too.
But the introduction of non-device mounts, like ostree.deployment,
have changed the setting, since the content of the tree will be
different if that mount is applied or not. And even for the device
based mounts it will change the tree if e.g. a device is mounted
at at different path but otherwise is formatted with the very same
options. In the worst case we miss a few cache hits due to changes
in the mount setup that don't lead to tree changes, but that will
rarely happen in practice.
2022-08-23 19:29:33 +01:00
Sayan Paul
28854f452a Add greenboot configuration management via osbuild
The script will update /etc/greenboot/greenboot.conf if user passes
the parameter in the config. Right now this only tweaks one config but
it will/can be expanded if other use cases come.

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2022-08-23 16:53:55 +02:00
Achilleas Koutsou
b87eaf6032 stages/ostree.remotes: support contenturl
OSTree remotes can be configured with a contenturl that is separate from
the metadata url.  When specified, the contenturl is used for content
and the url is used only for metadata.
Updated the description of the url property for clarity.
2022-08-22 20:17:40 +02:00
Achilleas Koutsou
2bff83364b stages/ostree.remotes: support gpgkeypath
OSTree remotes can be configured to import keys from a file on disk or a
directory containing multiple keys.

When specified, explicitly enables gpg-verify=true.
2022-08-22 20:17:40 +02:00
Ondřej Budai
135b20a487 runners: add fedora38
It's that time of the year again.
2022-08-18 14:22:44 +01:00
schutzbot
cf8ebb46b2 Post release version bump
[skip ci]
2022-08-17 08:17:53 +00:00
Christian Kellner
07d3605385 manifests: set db path in ostree commit
rpm-ostree is setting the database path to /usr/share/rpm during
the build. Do so as well.
2022-08-15 18:22:59 +02:00
Christian Kellner
a967c61d17 stages/rpm: ability to set database path
Add a new option `dbpath` that controls the database path of the
rpm database.
2022-08-15 18:22:59 +02:00
Christian Kellner
8c00907461 stages/rpm.macros: new-line terminate values
Needed if we want to specify multiple values and even for the
single value use case this is the right thing to do.
2022-08-15 18:22:59 +02:00
Christian Kellner
b33f178a11 stages/rpm.macros: allow setting of _dbpath
Allow setting the database path via the `_dbpath` variable.
2022-08-15 18:22:59 +02:00
Christian Kellner
c28269f8d9 manifests: enable cloud-init services in commit
It is instabled, but not a enabled via presets so we have to
explicitly enable it.
2022-08-13 19:21:52 +01:00
Christian Kellner
5570e2a92e manifests: upgrade ostree commit, image to F36
Fedora 34 is end of life and we ought to be testing with newer
releases so that we catch issues like the authselect one, that
is detailed in "stages/rpm: support marking install as ostree".
2022-08-13 19:21:52 +01:00
Christian Kellner
899fdcd5d9 manifests: set rpm/ostree_booted for commit
See "stages/rpm: support marking install as ostree" for more
information why this is needed on Fedora 36 and newer.
2022-08-13 19:21:52 +01:00
Christian Kellner
10255dbdcc test/manifests: base ostree image on commit
Instead of re-defining the ostree-commit in the ostree-image.mpp
file, import the needed pipelines to build the commit and use
that.
2022-08-13 19:21:52 +01:00
Christian Kellner
d2bcaffbdc test/manifests: add update repos in ostree-commit
Include modular and updates repositories for ostree commit and the
new build manifest.
2022-08-13 19:21:52 +01:00