Commit Graph
102 Commits
Author SHA1 Message Date
Andrii Sultanov c9818743b2 fixup! koji_build: Add --source-build subcommand
Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
2026-07-07 15:14:04 +00:00
Andrii Sultanov 361910432b koji_build: Add --source-build subcommand
This allows building straight from source, without generating patches and
modifying the specfile manually.

The script will replace the current tarball with the one generated from the
git hash in the source repository. It will also increment the release tag
(following the rules for --test-build), with the commit hash used as a unique
reference.

Note that the new tarball might conflict with the patches generated on top
of the current tarball, or require new dependencies etc., so this is not a
catch-all solution, just a usability improvement for some simpler cases.

Like --pre-build or --test-build, the subcommand takes an additional
argument - the hash of the commit in source repository to generate the
tarball from. It can be called from rpms-xsconsole like this, for example:

    koji_build.py --source-build 6f7d91f8 v8.3-u-asultanov2 .

I've specified two automatic spec->source mappings for xapi and
xsconsole in this commit, this can be expanded in the future.
For other repositories, --source-repo has to be specified manually:

    koji_build.py --source-build 4e0cae33f7 --source-repo xapi-project/varstored v8.3-u-asultanov2 .

Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
2026-07-07 14:05:50 +00:00
Samuel Verschelde 32916e864c Merge pull request #791 from xcp-ng/gln/fix-koji-release-number-pyvm
Fix non-incremented release when using test builds
2026-07-03 12:47:00 +02:00
Yann Sionneau 318815e122 Update README.md
Add missing python3-rpm dependency

Signed-off-by: Yann Sionneau <yann.sionneau@vates.tech>
2026-05-19 12:23:23 +02:00
Gaëtan Lehmann 7d780fe01a Fix non-incremented release when using test builds
Some packages don't include the .xcpng8.3 at the end.
This is adjusting the regex used to match with or without that suffix.

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2026-03-12 18:30:30 +01:00
Gaëtan Lehmann 21a36bf11c Require 8.3 branch for 8.3 targets and master for 9.0 targets
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2026-03-11 11:38:25 +01:00
Pau Ruiz Safont 6f2af6d025 koji_build: recognise more types of git remote
Now remotes of the shape github.com:user/repo are successfully converted
to koji urls. Previously this was only done if it was prepended by git@

Signed-off-by: Pau Ruiz Safont <pau.safont@vates.tech>
2026-01-28 11:18:22 +00:00
Philippe CovalandYann Dirson 558290d1c2 koji: Allow multiple branches per target (eg: {master, 8.3})
Prepares the switch to a future "8.3" branch in each rpms repo by
allowing it in addition to "master" for a transitional period.

Fix redefined-builtin mistake on hash (BTW I noticed similar mistakes
elsewhere to be fixed in later PR that pylint the script)

More checks and logs provided to help user

Relate-to: https://github.com/xcp-ng/xcp/pull/774#discussion_r2564325461
Co-authored-by: Yann Dirson <yann.dirson@vates.tech>
Signed-off-by: Philippe Coval <philippe.coval@vates.tech>
2025-11-28 16:25:32 +01:00
Samuel Verschelde 9797666d3b Merge pull request #757 from xcp-ng/stormi/wait-repo
koji_build.py: wait for the internal repo to be up to date
2025-10-24 13:04:16 +02:00
Nathanaël HANNEBERT 63d60f3c6c Remove duplicated scripts
Some scripts were commited in two repos, I removed them from this
one to have only one repo being single souce of thruth which is
an internal repo.
Signed-off-by: Nathanaël HANNEBERT <nathanael.hannebert@vates.tech>
2025-10-16 15:16:27 +02:00
Samuel Verschelde e2ad5e5eba Merge pull request #764 from xcp-ng/stormi/allow-test-build-to-lab-tag
koji_build.py: fix XCP-ng release detection for test builds
2025-10-02 16:21:09 +02:00
Samuel Verschelde c7b458d07c koji_build.py: fix XCP-ng release detection for test builds
The current code assumes we're in a vX.Y-u- tag, but we can also do test
builds in v8.3-lab.

Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
2025-09-24 10:41:36 +02:00
Gaëtan Lehmann 844e4dd512 Fix update_vendor_tags.py
For the unknown DEVNULL and for various linter errors.

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-09-23 23:28:00 +02:00
Gaëtan Lehmann 8a91723465 Only clean old branches when using --pre-build or --test-build
This is to prevent koji_build to write to the repository while it wouldn't
need to for a standard build.

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-09-10 10:02:57 +02:00
Samuel Verschelde a2fdd21aa5 koji_build.py: wait for the internal repo to be up to date
Add `--wait-repo` to `koji build` so that it starts the task with a
waitrepo subtask which ensures that the internal repository for the
build tag is up to date.

Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
2025-09-05 19:16:49 +02:00
Yann Dirson d981b4acde build_koji: don't break when starting on a detached head
Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
2025-08-29 16:27:00 +02:00
Gaëtan Lehmann 64e7edfb3e Require using --pre-build or --test-build when building with a user target
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-08-11 16:23:16 +02:00
Samuel Verschelde 60dcc93fa1 scripts/koji/koji_import_rpms.py: fix python3 execution
Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
2025-08-07 19:21:19 +02:00
Pau Ruiz Safont 319ad7f9d4 scripts/koji: add more informative error messages for koji_build
Signed-off-by: Pau Ruiz Safont <pau.safont@vates.tech>
2025-08-01 14:56:26 +01:00
Pau Ruiz Safont 2346ac3cf7 scripts/koji: fix ruff errors
Signed-off-by: Pau Ruiz Safont <pau.safont@vates.tech>
2025-08-01 14:56:23 +01:00
Yann Dirson dcc338523b Merge pull request #728 from xcp-ng/gln/build-last-commit-protected-uzyx
Ensure to build the last commit of the expected branch for protected targets
2025-07-17 16:42:13 +02:00
Samuel Verschelde 16d437b291 Adapt two more koji-related python scripts to python 3
Just updating the shebang and removing the print_function import.

Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
2025-07-16 15:29:35 +02:00
Samuel Verschelde 4649ecf872 Make koji scripts compatible with python 3
Following the upgrade of the koji server, we can at last convert the
scripts to python 3.

Some scripts not re-enabled yet on the server might need to be ported
too.

Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
2025-07-16 11:43:58 +02:00
Gaëtan Lehmann 4ba9c1e25a Build protected targets from the latest commit of their intended branch
Ensures that packages for protected targets (e.g., v8.3-incoming from
master, v8.2-incoming from 8.2) are built directly from the latest
commit of their respective target branch.

This prevent from building a package from sources that may not be in
the intended branch.

This prevents another common issue where a PR is merged into the target
branch but the build uses the PR branch's commit. Such builds omit the
merge commit, leading to the PR appearing in subsequent build reports
despite being effectively integrated.

A --force option is added to bypass these checks, for the few cases
for which it is valid to not build the last commit of the intended
branch.

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-07-02 10:48:35 +02:00
Gaëtan Lehmann 57931235fb koji: explicitly require the specfile python package
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-05-13 13:40:56 +02:00
Gaëtan Lehmann b100a8864d Merge pull request #699 from xcp-ng/gln/remove-old-branches-qzok 2025-04-30 18:23:00 +02:00
Gaëtan Lehmann 3baeea514f use git ls-remote to search the old branches to remove
git branch can't be used with these flags on the old version of git that comes
with centos 7

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-04-29 09:23:09 +02:00
Gaëtan Lehmann a24751cec6 check the commit is remotely available
before asking koji to pull a commit it may not be able to retrieve.
The check is only done when not using a pre/test build commit. In that
case we are already assured that the commit is on the remote repository.

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-04-25 15:05:47 +02:00
Gaëtan Lehmann c3115661f3 add --pre-build option
to make a build with a tag smaller than the one currently in the spec file

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-04-16 08:47:19 +02:00
Gaëtan Lehmann 1dd902c502 style fixes
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-04-16 08:47:19 +02:00
Gaëtan Lehmann 0ffaecd661 only check test_build format when the --test-build option in used
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-04-10 11:04:18 +02:00
Samuel Verschelde 783bec15e9 Merge pull request #687 from xcp-ng/stormi/create-user-target
scripts/koji: add create_user_target.py
2025-04-09 14:40:57 +02:00
Gaëtan Lehmann a6392b34fd nicer error message when the specfile module can't be imported
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-04-07 16:15:40 +02:00
Gaëtan Lehmann 20989aa214 search for the next test build number only in the targeted xcpng version
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-04-07 16:15:40 +02:00
Gaëtan Lehmann 0cb38d3710 restrict possible test build identifier
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-04-07 16:15:40 +02:00
Gaëtan Lehmann a72ad67844 use a detached branch instead of creating a temporary branch
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-04-07 16:15:40 +02:00
Gaëtan Lehmann b5436fc1ec clean old branches even when not using --test-build
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-04-07 16:15:40 +02:00
Gaëtan Lehmann c0c83c7986 avoid collision with already existing package names
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-04-07 16:15:40 +02:00
Gaëtan Lehmann 938de74300 use the date in the date in the branch name and clean the old branches
koji needs a branch that point to our commit to be able to fetch it, so we keep
the branches for 3 hours and remove the old branches when a new test run is run

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-04-07 16:15:40 +02:00
Gaëtan Lehmann d64555bc0a make --test-build work with chained builds
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-04-07 16:15:40 +02:00
Gaëtan Lehmann 0c52903723 add --test-build option
for non chain build for now

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-04-07 16:15:40 +02:00
Gaëtan Lehmann 43a4adfaae use print instead of calling echo
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-04-07 16:15:40 +02:00
Gaëtan Lehmann 1be07f407d use a context manager to switch dir
we'll need it later to safely recover from failures and to work with
multiple git command calls

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2025-04-07 16:15:40 +02:00
Samuel Verschelde 6022529d8e scripts/koji: add create_user_target.py
Simple utility script to create a new tag for a user, as well as the
associated build target.

Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
2025-04-03 18:52:09 +02:00
Samuel Verschelde deb7268763 sync_repo_from_koji.py: add metadata_expire=0 for user repos
Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
2025-01-22 14:57:19 +01:00
Samuel Verschelde 7477f2c621 sync_repo_from_koji.py: generate a repofile for user tags
Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
2025-01-20 19:36:23 +01:00
Samuel Verschelde f03239ee15 sync_repo_from_koji.py: generate offline repos for some tags
Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
2024-11-19 17:43:27 +01:00
Samuel Verschelde dad685cf3b sync_repo_from_koji.py: generate offline update tarballs
Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
2024-10-14 17:17:06 +02:00
Samuel Verschelde 8a1095d8db sync_repo_from_koji.py: promote 8.3 to stable
Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
2024-10-07 15:27:44 +02:00
Samuel Verschelde 8e33ec01ec Add --noprogress to koji download
This is better for logged output

Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
2024-09-03 18:45:22 +02:00