Skip to content

feat: Static release bumped during dist-git generation#54

Open
Tonisal-byte wants to merge 2 commits intomicrosoft:mainfrom
Tonisal-byte:asalinas/bumpStaticRelease
Open

feat: Static release bumped during dist-git generation#54
Tonisal-byte wants to merge 2 commits intomicrosoft:mainfrom
Tonisal-byte:asalinas/bumpStaticRelease

Conversation

@Tonisal-byte
Copy link
Copy Markdown
Contributor

This PR allows azldev to automatically update the static release number for spec which do not use %autorelease. The new release number is calculated by taking the original release number and adding the number of synthetic commits (from the project repo). This behavior can only be observed when creating synthetic dist-git using the --with-git flag on either prepare-sources or build commands.

image

Copilot AI review requested due to automatic review settings April 1, 2026 16:51
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

Enables automatic bumping of static RPM Release: values during synthetic dist-git generation (--with-git), so releases remain unique per synthetic commit when %autorelease is not used.

Changes:

  • Add logic to detect %autorelease vs static Release: values and bump static releases by the number of synthetic commits.
  • Invoke the static release bump as part of synthetic history preparation before staging changes.
  • Add unit tests for release detection, bumping, and Release tag extraction.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
internal/app/azldev/core/sources/sourceprep.go Calls the new static release bump step during synthetic history creation.
internal/app/azldev/core/sources/releaseoverlay.go Introduces helpers to read Release: from spec, detect %autorelease, bump static releases, and apply an overlay.
internal/app/azldev/core/sources/releaseoverlay_test.go Adds tests covering %autorelease detection, static bumping, and Release tag parsing behavior.

func BumpStaticRelease(releaseValue string, commitCount int) (string, error) {
matches := staticReleasePattern.FindStringSubmatch(releaseValue)
if matches == nil {
return "", fmt.Errorf("release value %#q does not start with an integer", releaseValue)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We know we'll find specs that don't use autorelease and don't have a standard integer followed by %{?dist}.

Example: https://src.fedoraproject.org/rpms/kernel/blob/rawhide/f/kernel.spec

For these, we'll want some way to avoid this being a fatal error. From Dan's "3 categories", this would be that 3rd case.

For those it would be okay for us to manually manage their Release values, but we'd need a way to do so. We can use an overlay to set the Release tag's value, but would then also need a way to disable this logic from running (and failing).

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