[ULS]: Add --bump mode to update_lt_spec.py for non-rebase spec updates#63
Open
bmastbergen wants to merge 1 commit intomainlinefrom
Open
[ULS]: Add --bump mode to update_lt_spec.py for non-rebase spec updates#63bmastbergen wants to merge 1 commit intomainlinefrom
bmastbergen wants to merge 1 commit intomainlinefrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new “bump” workflow to update_lt_spec.py to support updating kernel.spec when new commits land without a full upstream rebase, along with new/expanded helpers in ciq_helpers.py to parse CIQ tags and manipulate the spec changelog.
Changes:
- Introduces
--bumpmode to increment the CIQ release counter (N), bump%define pkgrelease, reset%define buildidto.1, and prepend a changelog entry based on commits since the last CIQ tag. - Adds optional
--tagbehavior (gated by--commit) to create a newciq_kernel-X.Y.Z-(N+1)tag after a successful bump commit. - Extends
ciq_helpers.pywith CIQ tag parsing and new changelog/spec helpers, and makes changelog replacement/prepend raise on missing%changelog.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| update_lt_spec.py | Adds bump mode, tagging support, and refactors spec read/write + pkgrelease update behavior. |
| ciq_helpers.py | Adds CIQ tag release parsing, changelog prepend helper, and spec %define reader. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds a --bump flag for updating the spec when commits have been added
without rebasing to a new upstream kernel version.
Bump mode (--bump):
- Parses N from the current ciq_kernel-X.Y.Z-N tag and increments it
- Updates %define pkgrelease from N to N+1 and resets %define buildid
to .1, so the tarball name changes (e.g. linux-6.18.21-2.1.el9)
- Prepends a new changelog entry above existing ones using commits
since the last ciq_kernel tag as the log range; the changelog version
uses .1 directly since buildid is always reset to .1 on bump
- Optionally commits (--commit) and creates the new ciq_kernel-X.Y.Z-N+1
tag (--tag); --tag requires --commit, prints a warning if used without
--bump, and is skipped with a warning if --commit made no changes
Rebase mode now also resets %define pkgrelease back to 1%{?buildid} so
the release counter returns to 1 for the new kernel version.
New helpers in ciq_helpers.py:
- parse_ciq_tag_release(): extracts N from ciq_kernel-X.Y.Z-N tags
- parse_kernel_tag(): extended to accept ciq_kernel-X.Y.Z-N format
- prepend_spec_changelog(): inserts a new entry at the top of %changelog
- replace_spec_changelog(), prepend_spec_changelog(): raise ValueError
instead of silently no-oping when %changelog is not found
- read_spec_el_version(): reads %define values from spec lines; delegates
to private _read_spec_define() which builds the regex from name + a
value-capture pattern to avoid duplication
- _set_spec_pkgrelease(): updates the numeric base of a %define pkgrelease
line; shared by update_spec_file() and bump_spec_file()
3e53a57 to
de9399d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a --bump flag for updating the spec when commits have been added without rebasing to a new upstream kernel version.
Bump mode (--bump):
Rebase mode now also resets %define pkgrelease back to 1%{?buildid} so the release counter returns to 1 for the new kernel version.
New helpers in ciq_helpers.py: