Commit graph

91 commits

Author SHA1 Message Date
Tomáš Hozza
538e6c1a7d Many: stop building and shipping osbuild-image-tests binary
Remove the binary from the Makefile and the SPEC file.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-08-07 10:22:55 +02:00
Achilleas Koutsou
b3d1e4cf13 Makefile: bump GOLANGCI_LINT_VERSION to v1.61
v1.60 seems to have some issues [1] with something in our dependency
chain.  Update to v1.61 and fix all new issues.

New issues are all instances of potential integer overflow from int ->
uint conversions.  Added guards where appropriate and disabled the check
when when it's not needed.

[1] https://github.com/osbuild/osbuild-composer/actions/runs/16624417387/job/47037518471
2025-07-31 12:34:24 +02:00
Sanne Raymaekers
7dea1bcd01 many: remove jobsite code
This was replaced by `cmd/osbuild-worker-executor`.
2025-06-25 03:01:59 +02:00
Brian C. Lane
06bc5d4d59 Makefile: Run golangci-lint config verify
This more closely matches the behavior of the github action.

In the .golangci.yml config file move the exclude-dirs list under issues
where it belongs.
2025-02-24 04:20:42 -08:00
Brian C. Lane
2dad1a965e Makefile: Move to golangci-lint v1.60
Version 1.56 pulls in 1.22.0 which is too low for our go.mod version of
1.22.6 and v1.59 pulls in go v1.22.5

So move to 1.60 which pulls in 1.23, which should work fine after some
new linting complaints are addressed.
2025-02-24 04:20:42 -08:00
Tomáš Hozza
d781b8de6d Makefile: bump golangci-lint to v1.56 for golang 1.22
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-02-03 19:58:37 +01:00
Florian Schüller
a7119a4d0f osbuild-service-maintenance/aws: support aws credential file
Support running the maintenance locally with a valid
`~/aws/credentials` file. HMS-3632
2024-12-10 11:43:51 +01:00
Florian Schüller
a3ef2b4a3c Makefile: add tools/prepare-source.sh to make lint
The idea is that at least `go fmt` is called on
`make lint`. It's recommended to run `make push-check`
before any push, still.
2024-11-19 13:55:38 +01:00
Florian Schüller
007f2989d3 Makefile: implement shellcheck as part of make lint 2024-11-06 15:16:42 +01:00
Florian Schüller
bed22e1d9a Makefile: document make db-tests 2024-11-06 15:16:42 +01:00
Florian Schüller
c742e6457e Makefile: add hint that this just compiles the binaries
It does not run the tests because of to the "-c" flag
2024-11-06 15:16:42 +01:00
Florian Schüller
00d3f07d08 Makefile: implement make db-tests
enables the option to run the DB tests locally
that are executed in the github actions
2024-11-06 15:16:42 +01:00
Florian Schüller
69525b7ce6 Makefile: clean golangci-lint cache on make clean
To speedup `make lint` we use a local cache.
It seems that there is no sane way to check and just
update the cache, so we'll just provide an option to wipe it.

Using the cache does reduce the time of `make lint` from
1 minute 15sec to 1 sec on my PC. So for consecutive runs,
the cache still makes sense.
2024-11-04 18:53:21 +01:00
Florian Schüller
e448fc8665 Makefile: remove old remnant package filter 2024-08-28 16:41:07 +02:00
Florian Schüller
210cfafdd6 Makefile: implement a target to create coverage-report 2024-08-28 16:41:07 +02:00
Florian Schüller
11f707d277 workflows: include splunk_logger sub module in tests 2024-08-28 16:41:07 +02:00
Florian Schüller
0a68fe3005 Makefile: implement helper to process OpenShift templates
just for manual checks if the template syntax is fine
and align with the github action to use the same code
2024-08-02 04:01:02 +02:00
Florian Schüller
4e1ab4cbb5 Makefile: add comment where to see golint-golang mapping 2024-07-05 12:49:26 +02:00
Florian Schüller
1a24aa7d8a Makefile: bump golint version
followup of PR #4241
2024-07-05 12:49:26 +02:00
Florian Schüller
c36367d4cc makefile: implement make lint 2024-07-04 17:52:44 +02:00
Sanne Raymaekers
01cfb93956 osbuild-worker-executor: integrate into build system/spec files
Add the osbuild-worker-executor to the build system and add it
to the spec file.
2024-06-05 18:26:08 +02:00
Achilleas Koutsou
1fa98e4253 Makefile: remove installation of dnf-json 2024-04-18 12:49:01 +02:00
Sanne Raymaekers
b4e361e093 osbuild-jobsite-builder: unpack source tarball in populate 2024-03-19 17:07:30 +01:00
Florian Schüller
bb4ee36cdc Makefile: remove dnfjson tests COMPOSER-2068 2024-02-22 15:22:52 +01:00
Florian Schüller
e31ec13c87 Makefile: implement push-check
Tries to replicate github actions as close as possible
2024-02-22 15:22:52 +01:00
Florian Schüller
8e98884bff Makefile: implement support for BUILDDIR in "build"
also document "build" and implement the corresponding "clean"
2024-02-22 15:22:52 +01:00
Tomáš Hozza
17ad9c1165 Makefile/rpm: always copy over SPEC file
Any changes done to the SPEC file were not reflected in the
`rpmbuild/SPECS` directory across runs of `make rpm`. One had to delete
the SPEC file manually to be updated and used for the RPM build.

Mark the target as PHONY to ensure that the SPEC is always updated.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-01-26 11:32:34 +01:00
Tomáš Hozza
1943732f73 Delete cmd/osbuild-pipeline
This command was used by the original Python scripts used to generate
test manifests. These scripts were deleted, thus there is no need to
keep this command around any more.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-01-26 11:32:34 +01:00
Paweł Poławski
c1fae1ef7a Makefile: Fix typo in printed project name 2023-12-06 11:38:01 +01:00
Tomáš Hozza
3df67e9adb Makefile: add unit-tests target
Add Makefile target to run all unit tests.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-10-20 18:59:00 +02:00
Achilleas Koutsou
3bbcc8a7cc Remove test that depends on removed code from images
Manifest tests can no longer run and also aren't needed.
All image type manifests are generated and built in the obsuild/images
CI tests and the test function in images
(distro_test_common.TestDistro_Manifest()) has been removed.
2023-07-21 12:05:00 +02:00
Sanne Raymaekers
d9bd19404d osbuild-service-maintenance: Move maintenance queries out of jobqueue 2022-07-04 15:37:28 +02:00
Ygal Blum
534625fa38 Fedora - Use vendor instead of rpm dependencies
RPM Spec
--------
Remove all Go dependecies
Add Start and End marker comments for bundling information
Add '-k' to goprep to preserve the vendor directory

tools
-----
Add script to update the RPM spec file to generate the indication lines
based on vendor/modules.txt

Packit
------
Run the new script as a post-upstream-clone hook

Makefile
--------
Run the new script on the generated spec file before generating the RPM

mockbuild.sh
------------
Run the new script before creating the RPM
2022-06-23 18:02:09 +02:00
Ygal Blum
bee14bf392 OSBuild - add support for generic S3 services
jobimpl-osbuild
---------------
Add GenericS3Creds to struct
Add method to create AWS with Endpoint for Generic S3 (with its own credentials file)
Move uploading to S3 and result handling to a separate method (along with the special VMDK handling)
adjust the AWS S3 case to the new method
Implement a new case for uploading to a generic S3 service

awscloud
--------
Add wrapper methods for endpoint support
Set the endpoint to the AWS session
Set s3ForcePathStyle to true if endpoint was set

Target
------
Define a new target type for the GenericS3Target and Options
Handle unmarshaling of the target options and result for the Generic S3

Weldr
-----
Add support for only uploading to AWS S3
Define new structures for AWS S3 and Generic S3 (based on AWS S3)
Handle unmarshaling of the providers settings' upload settings

main
----
Add a section in the main config for the Generic S3 service for credentials
If provided pass the credentials file name to the osbuild job implementation

Upload Utility
--------------
Add upload-generic-s3 utility

Makefile
------
Do not fail if the bin directory already exists

Tests
-----
Add test cases for both AWS and a generic S3 server
Add a generic s3_test.sh file for both test cases and add it to the tests RPM spec
Adjust the libvirt test case script to support already created images
GitLabCI - Extend the libvirt test case to include the two new tests
2022-04-07 15:01:01 +02:00
Roy Golan
bee932e222 Add support for OCI upload provider
Signed-off-by: Roy Golan <rgolan@redhat.com>
2022-01-28 15:16:47 +01:00
sanne
c43ad2b22a osbuild-service-maintenance: Clean up expired images 2021-12-03 00:14:09 +00:00
Tomas Hozza
c5a4946135 Test all manifests with depsolved package sets
Generated image test case manifests for all supported distros, arches and
image-types are being tested as part of distro unit tests. However due
to time constrains, the unit test does not depsolve the image's default
package sets and thus does not check if they changed in the internal
osbuild-composer's representation, compared to the generated image test
case.

Extend the `TestDistro_Manifest()` function used by the unit test to
allow depsolving image's package sets.

Introduce a new test case binary `osbuild-composer-manifest-tests`
allowing to check the manifests generated by composer for all supported
combinations of images against generated manifests, including depsolving
image's default package sets.

Introduce a new CI test case `manifest_tests.sh` executing the
`osbuild-composer-manifest-tests` binary and testing all existing image
test cases. Run it in CI on RHEL-9 runner.

Modify SPEC file to ship the newly added test case.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-11-19 19:50:25 +01:00
Simon Steinbeiss
dcb5220329 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.

Consequently, we also drop the docs/news folder and its content and
adjust the PR template.
2021-10-27 13:03:53 +02:00
sanne
4a057bf3d5 auth: OpenID/OAUth2 middleware
2 configurations for the listeners are now possible:
- enableJWT=false with client ssl auth
- enableJWT=true with https

Actual verification of the tokens is handled by
https://github.com/openshift-online/ocm-sdk-go.

An authentication handler is run as the top level handler, before any
routing is done. Routes which do not require authentication should be
listed as exceptions.

Authentication can be restricted using an ACL file which allows
filtering based on JWT claims. For more information see the inline
comments in ocm-sdk/authentication.

As an added quirk the `-v` flag for the osbuild-composer executable was
changed to `-verbose` to avoid flag collision with glog which declares
the `-v` flag in the package `init()` function. The ocm-sdk depends on
glog and pulls it in.
2021-09-04 02:48:52 +02:00
Brian C. Lane
097eb9f04f Makefile: Add scratch build target
Sometimes you want to build an rpm without the tests and without running
%check
2021-08-16 13:16:53 +02:00
Lars Karlitski
9c2c92f729 jobqueue: Introduce jobqueue backed by a postgres database
Co-authored-by: sanne <sanne.raymaekers@gmail.com>
2021-07-28 21:52:31 +01:00
Tomas Hozza
87d82e529d Makefile: build osbuild-upload-gcp as part of build target
Build `cmd/osbuild-upload-gcp` as part of the `build` make target,
similar to other cloud providers.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-03-12 12:17:02 +01:00
Lars Karlitski
b7367e2519 Makefile: define commit on make (s)rpm
Prepending the definition to the spec file feels brittle. Stop doing
that – pass --define to rpmbuild instead.

Keep copying the spec file from git though, so that it's always using
the one from the last commit, and not the current checkout.
2020-11-17 08:56:17 +00:00
Lars Karlitski
f3b56cc305 master → main 2020-11-13 14:09:01 +01:00
Ondřej Budai
8e34cef1ec makefile: always use the same specfile name
rpmlint doesn't like SRPMs built from specfiles with a filename different
than what it's in the Name field inside the spec. This commit removes
the renaming. Now, the specfile is always named osbuild-composer.spec.
2020-11-12 12:57:53 +01:00
Ondřej Budai
073f9dc79a test/koji: move the koji test to schutzbot
The Koji test in Github actions was always a bit quick and dirty solution.
I think it's much nicer solution to run it on Schutzbot.

Therefore, this commit moves the koji_test.go to a new osbuild-koji-tests
executable. This new test isn't run in the base test suite as one would
anticipate but inside the koji.sh test. This is needed because
osbuild-koji-tests requires a running koji instance. This might change
in the future but I think it works for now.
2020-11-02 19:59:28 +01:00
Ondřej Budai
f43cc695ae spec: remove the old spec file
We decided to stop releasing into Fedora 31 therefore we don't need the old
spec file anyway.
2020-10-16 15:51:26 +02:00
Lars Karlitski
b25a350502 osbuild-composer: merge cloud API into main binary
This removes the osbuild-composer-cloud package, binary, systemd units,
the (unused) test binary, and the (only-run-on-RHEL) test in aws.sh.

Instead, move the cloud API into the main package, using the same
socket as the koji API, osbuild-composer-api.socket. Expose it next to
the koji API on route `/api/composer/v1`.

This is a backwards incompatible change, but only of the -cloud parts,
which have been marked as subject to change.
2020-10-16 09:37:04 +02:00
Ondřej Budai
2db4938a57 make: put all binaries into bin directory
Currently, we have osbuild-image-tests binary committed in the master branch.
IMHO the root cause is that we don't have it in .gitignore. Actually, I think
that it is pretty hard keep .gitignore in sync with the build target.

This commit solves the situation by putting all the built binaries into bin
directory and adding this directory into .gitignore. This way, it's much
harder to actually commit a new Go binary into repository.

This commit doesn't remove the binary as #1017 already does that.
2020-10-14 13:01:52 +02:00
Tom Gundersen
9d18c3bfa2 tests: rename composer-cli tests
These had the generic name osbulid-tests, rename the binary to more
closely describe what is under test: weldr API as composed by
composer-cli.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-10-06 13:08:26 +02:00