Skip to content

[ULS]: Add --bump mode to update_lt_spec.py for non-rebase spec updates#63

Open
bmastbergen wants to merge 1 commit intomainlinefrom
update-lt-spec-for-non-rebase
Open

[ULS]: Add --bump mode to update_lt_spec.py for non-rebase spec updates#63
bmastbergen wants to merge 1 commit intomainlinefrom
update-lt-spec-for-non-rebase

Conversation

@bmastbergen
Copy link
Copy Markdown
Collaborator

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()

Copilot AI review requested due to automatic review settings April 14, 2026 14:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 --bump mode to increment the CIQ release counter (N), bump %define pkgrelease, reset %define buildid to .1, and prepend a changelog entry based on commits since the last CIQ tag.
  • Adds optional --tag behavior (gated by --commit) to create a new ciq_kernel-X.Y.Z-(N+1) tag after a successful bump commit.
  • Extends ciq_helpers.py with 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.

Comment thread update_lt_spec.py Outdated
Comment thread ciq_helpers.py Outdated
Comment thread update_lt_spec.py Outdated
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants