This commit adds integration for the ostree options. It is modelled
loosely after weldr-client/composer-cli and the
```
start-ostree --{ref,parent,url}
```
and uses
```
--ostree-{ref,parent,url}
```
A simple smoke test is provided that uses fedora-iot. Ideas welcome
for an easier way :)
When depsolve is run it returns a list of packageSpecs and the
matching repository config. This repo config is different/distinct
from the repository config that is passed into depsolve via the
package sets or the repositories that are loaded via the
reporegistry and needs to be passed into `manifest.Serialize()`.
The key different is that the depsovle `repoConfig` contains
the repo.Id that match the packageSpec.RepoId. With those two
matching IDs we can use librepo (see osbuild PR#1974) to infere
what mirror to use for what package.
This commit now passes the correct repoConfig into
preManifest.Serialize() now.
No test (sorry!) as this is really hard to test in isolation, there
is nothing observable today from repoConfig and it is impossible
to add a "witness" pipelien that could check that the right argument
is passed in `pipeline.serializeStart()`. So until we refactor
images you will have to take my word for this (sorry again).
For releases this does not change anything, as the version
in the spec file is the same as the git tag. For
intermediate/tainted versions packer seems to patch the spec
file to the version given in `.packit.yaml`
(which is the latest git-tag), then the filename and version
would be inconsistent.
The package crashes during check with:
```
golangci-lint............................................................Failed
- hook id: golangci-lint
- exit code: 3
level=warning msg="[runner] Can't run linter goanalysis_metalinter: buildir: failed to load package gpgme: could not load export data: no export data for \"github.com/proglottis/gpgme\""
level=error msg="Running error: can't run linter goanalysis_metalinter\nbuildir: failed to load package gpgme: could not load export data: no export data for \"github.com/proglottis/gpgme\""
```
which is not helpful
With the new build-in repos this test is no longer relevant. We
need to look into a different way to test overrides but just
providing an empty datadir will no longer work so drop that.
This commit switches the default repositories to use the build-in
ones from images PR#1112. It is still possible to override using
`/etc/image-builder` and `/usr/share/image-builder` or `--datadir`.
This is implicitly tested via the container test that no longer
includes the files from osbuild-composer in the container.
This commit adds the pr-best-practices check, which prevents pull
requests without descriptions being merged and which allows developers
to quickly create Jira Tasks based on the /jira-epic command in pull
request descriptions or comments.
RPM tooling expects the source tarball to match the name of the
package, suffixed with the version in the SPEC file. Modify the Makefile
to comply with this expectation.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
FWIW, I never get || and && correctly in Bash for the first time :D
Also handle the case then the repository does not contain any version
tags yet by defaulting to "1".
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Packit needs golang to be installed when we build SRPM, because we need
to vendor code to generate the archive.
Moreover, we need to vendor code to be able to modify SPEC port upstream
clone to include bundled code.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Provide a spec file for `image-builder-cli`. The spec file is based on
`osbuild-composer`'s spec file except it is simplified as (some)
usecases would currently cloud the intent of the specfile. We can add
back RHEL conditionals when/if we start shipping and building for RHEL.
Some tools from `osbuild-composer` are also included; most notably the
one that generates bundled dependencies from vendored modules.
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
As we've now vendored our dependencies let's enable dependabot in the
same way we use it in our other Go projects.
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
This commit adds the missing `merge_group` to the pytest and go
test workflows.
Note that I added `types: [ "checks_requested" ]` (just like we
have for the container.yaml) but I'm not actually sure about it,
the GH docs are a bit unclear to me here, it seems they suggest
to keep this generic but then the example explicitly uses `type`
(I'm probably overthinking this fwiw).
[1] https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#merge_group
This commit follows a suggestion from Ondrej to add a better
default for `--store`: /var/cache/image-builder/store.
This is nice as it will give users automatic caching and makes
the container also nicer.
This commit moves the smoke test from fedora-41 to centos-9. The
reason is that it seems the fedora mirrors in general are a bit
more flaky so /hopefully/ the centos one will help.
The real fix of course is to retry different mirrors on failure,
we will need to look into librepo integration in osbuild (again)
for this (hopefully soon!).
The original `go.yml` got added via some GH automation. But we
are not MSDOS and we can affort more than 3 chars for a file
extension - so this commit renames all .yml to .yaml which is
what we use everywhere else.
This commit creates a temporary directory for the defaultDepvolver()
if no cacheDir is given. This ensures that we do not clutter the
current working directory with `platform:foo` cache directories
that `solver.Depvolve()` creates.
Note that this is only tested indirectly via the integration test
in `test_container.py:test_container_builds_image()` that checks
that the output directory is clean.
This commit adds a new workflow that runs the new `pytest` based
integration tests inside GH actions. It also extracts a common
`testdeps.yml` reusable workflow so that we do not duplicate the
package list of test dependencies.
This commit adds a smoke test that builds the ibcli container
and runs a fedora-41 raw-minimal build to double check that
the container based building actually works.
Thanks to Ondrej for suggesting this.