Skip to content

fix: release job isn't respecting minor latest streams#3405

Open
xstefank wants to merge 1 commit into
operator-framework:mainfrom
xstefank:5.x-release-jobs
Open

fix: release job isn't respecting minor latest streams#3405
xstefank wants to merge 1 commit into
operator-framework:mainfrom
xstefank:5.x-release-jobs

Conversation

@xstefank

@xstefank xstefank commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

This is why 5.2.4 was wrongfully released from main and not from 5.2.x. I will release 5.2.5 after this PR is merged.

Fixes #3402

Copilot AI review requested due to automatic review settings June 9, 2026 09:26
@openshift-ci openshift-ci Bot requested review from csviri and metacosm June 9, 2026 09:26

Copilot AI 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.

Pull request overview

This PR fixes the GitHub Actions release workflow so that v5 patch releases are built from the correct maintenance branch (e.g., 5.2.x) rather than incorrectly releasing from main, which caused the 5.2.4 artifact mismatch reported in #3402.

Changes:

  • Derives the release major.minor from the release tag and compares it to main’s pom.xml version to decide whether to release from main or ${major.minor}.x.
  • Updates the v5 branch-selection logic in the release workflow to support “latest minor stream” releases correctly.

Comment on lines +38 to +40
# getting this version from POM would require pulling the whole repo
MAIN_POM_VERSION=$(curl -s "https://raw.githubusercontent.com/${{ github.repository }}/main/pom.xml" | grep -oPm1 '(?<=<version>)[^<]+')
MAIN_MAJOR_MINOR=$(echo "$MAIN_POM_VERSION" | cut -d. -f1-2)
Comment on lines +45 to +49
if [ "$RELEASE_MAJOR_MINOR" = "$MAIN_MAJOR_MINOR" ]; then
echo "tmp_version_branch=main" >> "$GITHUB_ENV"
else
echo "tmp_version_branch=${RELEASE_MAJOR_MINOR}.x" >> "$GITHUB_ENV"
fi

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Logging which target branch is selected would indeed be useful.

Comment on lines +45 to +49
if [ "$RELEASE_MAJOR_MINOR" = "$MAIN_MAJOR_MINOR" ]; then
echo "tmp_version_branch=main" >> "$GITHUB_ENV"
else
echo "tmp_version_branch=${RELEASE_MAJOR_MINOR}.x" >> "$GITHUB_ENV"
fi

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Logging which target branch is selected would indeed be useful.

Signed-off-by: xstefank <xstefank122@gmail.com>
@xstefank xstefank force-pushed the 5.x-release-jobs branch from 3def2b8 to 2eb3d7f Compare June 9, 2026 11:39
@xstefank xstefank requested a review from metacosm June 9, 2026 11:41
RELEASE_MAJOR_MINOR=$(echo "$RELEASE_VERSION" | cut -d. -f1-2)

# getting this version from POM would require pulling the whole repo
MAIN_POM_VERSION=$(curl -fsSL "https://raw.githubusercontent.com/${{ github.repository }}/main/pom.xml" | python3 -c "

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Using a python script for this is way overkill. The previous solution was better, imo. Or we could use something as simple as yq '.project.version' pom.xml

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.

5.2.4 artifacts contain classes not present in v5.2.4 tag

3 participants