Skip to content

Add koji-helper.py: a Python script to list source packages from a Koji tag and updates - #835

Merged
rzr merged 7 commits into
masterfrom
pcoval/scripts/koji/review/master
Sep 1, 2026
Merged

rzr merged 7 commits into
masterfrom
pcoval/scripts/koji/review/master

Conversation

@rzr

@rzr rzr commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

This script is used to generated versions updates:

uv run scripts/koji/koji-helper.py \
   list-update v8.3-ci \
   v8.3-testing v8.3-candidates v8.3-updates v8.3-base \
    | sed -e 's|\([^:]*\)\(.*\)|* `\1`\2|g' -e 's|UNKNOWN -> ||g'

It produces this kind of output (sed format to markdown):

  • amd-microcode: 20251203-1.1.xcpng8.3 -> 20260519-1.1.xcpng8.3
  • perl-Archive-Tar: 1.92-3.el7

@rzr
rzr requested a review from a team as a code owner August 6, 2026 12:29
@rzr
rzr force-pushed the pcoval/scripts/koji/review/master branch 2 times, most recently from 6562692 to 1ad4102 Compare August 6, 2026 12:40
@rzr
rzr marked this pull request as draft August 6, 2026 13:53
@rzr
rzr force-pushed the pcoval/scripts/koji/review/master branch 2 times, most recently from 96e6b54 to 632b933 Compare August 6, 2026 15:16
@rzr
rzr marked this pull request as ready for review August 6, 2026 15:35
Comment thread scripts/koji/koji-helper.py
Comment thread scripts/koji/koji-helper.py
Comment thread scripts/koji/koji-helper.py Outdated
@rzr
rzr force-pushed the pcoval/scripts/koji/review/master branch 3 times, most recently from 8cea328 to b8f18d5 Compare August 12, 2026 15:46
@rzr
rzr requested a review from glehmann August 13, 2026 12:11
@rzr
rzr force-pushed the pcoval/scripts/koji/review/master branch from b8f18d5 to 019e512 Compare August 14, 2026 16:21
@rzr
rzr requested a review from a team September 1, 2026 06:59

@vxgmichel vxgmichel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the PR description you mentioned this sed:

[...] | sed -e 's|\([^:]*\)\(.*\)|* `\1`\2|g' -e 's|UNKNOWN -> ||g'

Shouldn't this formatting be part of script instead?

LGTM otherwise 👍

Comment thread scripts/koji/koji-helper.py Outdated
rzr added 7 commits September 1, 2026 10:32
…Koji tag.

Features:
- Uses python-koji library for Koji CLI API access
- Supports SSL verification toggle and debug mode
- Configurable server and web URLs

Signed-off-by: Philippe Coval <philippe.coval@vates.tech>
…upport

Adds:
- list_update_source_packages() function to find updated packages between tags
- Reuse list_source_packages() for both tag lookups
- list-update CLI command with old_nvr -> new_nvr output format

Signed-off-by: Philippe Coval <philippe.coval@vates.tech>
- Add version and release to list_source_packages results
- Update list-update output to show version-release format
- Include base_version and base_release for comparison

Signed-off-by: Philippe Coval <philippe.coval@vates.tech>
This script is used to generated versions updates:

    uv run koji-helper.py --no-verify-ssl list-update v8.3-ci v8.3-updates \
    | sed -e 's|\([^:]*\)\(.*\)|* \1\2|g'

It produces this kind of output:

    * `xen`: 4.17.6-9.3.1.xcpng8.3 -> 4.17.6-12.2.xcpng8.3

Signed-off-by: Philippe Coval <philippe.coval@vates.tech>
Example:

    uv run koji-helper.py --no-verify-ssl list-update v8.3-ci \
      v8.3-testing v8.3-candidates v8.3-updates v8.3-base \
      | sed -e 's|UNKNOWN -> ||g'

Output:

    perl-Archive-Tar: 1.92-3.el7
    zlib: 1.2.7-17.el7 -> 1.2.7-17.1.xcpng8.3

Signed-off-by: Philippe Coval <philippe.coval@vates.tech>
Introduce PackageInfo TypedDict for all package data structures

Replace all dict[str, dict[str, Any]] with dict[str, PackageInfo]
and use PackageInfo | None for base_version throughout the file.

Introduce Packages type alias for dict[str, PackageInfo]

Replace all dict[str, PackageInfo] occurrences with the new
Packages type alias for shorter, cleaner annotations.

Fix flake8 E501 line-too-long errors

- Split long print() call across multiple lines
- Split long lines.append() call across multiple lines
- Split do_list_update() def signature across two lines

Signed-off-by: Philippe Coval <philippe.coval@vates.tech>
Signed-off-by: Philippe Coval <philippe.coval@vates.tech>
@rzr
rzr force-pushed the pcoval/scripts/koji/review/master branch from 019e512 to 51a766d Compare September 1, 2026 08:33
@rzr

rzr commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Ok let's merge, the reformatting can be done in later PR if there is a need for.

@rzr
rzr merged commit 00c2ca2 into master Sep 1, 2026
3 checks passed
@rzr
rzr deleted the pcoval/scripts/koji/review/master branch September 1, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants