Skip to content

fix: version mismatch issue handled by replacing devel with correct tags#21385

Open
anithapriyanatarajan wants to merge 1 commit into
openshift-pipelines:release-v1.22.xfrom
anithapriyanatarajan:cherry-pick-version-fix
Open

fix: version mismatch issue handled by replacing devel with correct tags#21385
anithapriyanatarajan wants to merge 1 commit into
openshift-pipelines:release-v1.22.xfrom
anithapriyanatarajan:cherry-pick-version-fix

Conversation

@anithapriyanatarajan
Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: Anitha Natarajan <anataraj@redhat.com>
Copilot AI review requested due to automatic review settings May 15, 2026 10:28
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 15, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: anithapriyanatarajan
Once this PR has been reviewed and has the lgtm label, please assign openshift-pipelines-bot for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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

Updates the payload-fetch/bundle-generation helper script to replace upstream "devel" placeholders with an upstream release tag derived from downstream release configuration, aiming to avoid version-label mismatches in the generated OLM bundle.

Changes:

  • Adds logic to fetch downstream release config and resolve the latest matching upstream tektoncd/operator release tag for the configured upstream release branch.
  • Rewrites "devel" placeholders in bundle manifests and kodata YAMLs (via sed + targeted yq edits).
  • Broadens the CSV VERSION env override to update all matching containers.
Comments suppressed due to low confidence (2)

hack/operator-fetch-payload.sh:53

  • The GitHub releases API call uses the default page size (30). For older upstream minor versions, the desired tag may not be present in the first page, causing UPSTREAM_VERSION_TAG to become empty and the script to fall back to "devel" (reintroducing the mismatch this PR is trying to fix). Consider requesting more results (e.g. ?per_page=100) and/or paging until a matching tag is found, and filtering out draft/prerelease releases so you don’t accidentally pick an RC tag as “latest”.
        UPSTREAM_MINOR_VERSION=$(echo "${UPSTREAM_RELEASE_BRANCH}" | sed -E 's/^release-v([0-9]+\.[0-9]+)\.x$/\1/')
        # Look up the latest release tag for this minor version from tektoncd/operator GitHub releases.
        UPSTREAM_VERSION_TAG=$(curl -fsSL "https://api.github.com/repos/tektoncd/operator/releases" \
            | yq e '.[] | select(.tag_name | test("^v?'"${UPSTREAM_MINOR_VERSION}"'\\.")) | .tag_name' - \
            | sort -V | tail -n1 || true)
        if [[ -z "${UPSTREAM_VERSION_TAG}" ]]; then

hack/operator-fetch-payload.sh:52

  • UPSTREAM_MINOR_VERSION is derived with a sed replace that only works for branches matching release-vX.Y.x. If the value in branches.operator.upstream is something else (e.g. main), the sed command returns the original string, and the subsequent tag lookup regex will never match, forcing a fallback to "devel" after an unnecessary API call. Consider explicitly detecting non-release-v* branches and short-circuiting to a known behavior (e.g. set UPSTREAM_VERSION_TAG="devel"), or validating the parsed minor version before querying GitHub.
    UPSTREAM_RELEASE_BRANCH=$(echo "${HACK_RELEASE_CONFIG}" | yq e '.branches.operator.upstream' -)
    if [[ -z "${UPSTREAM_RELEASE_BRANCH}" || "${UPSTREAM_RELEASE_BRANCH}" == "null" ]]; then
        echo "WARN: 'branches.operator.upstream' not found in ${HACK_RELEASE_CONFIG_URL}, falling back to 'devel'"
        UPSTREAM_VERSION_TAG="devel"
    else
        UPSTREAM_MINOR_VERSION=$(echo "${UPSTREAM_RELEASE_BRANCH}" | sed -E 's/^release-v([0-9]+\.[0-9]+)\.x$/\1/')
        # Look up the latest release tag for this minor version from tektoncd/operator GitHub releases.
        UPSTREAM_VERSION_TAG=$(curl -fsSL "https://api.github.com/repos/tektoncd/operator/releases" \
            | yq e '.[] | select(.tag_name | test("^v?'"${UPSTREAM_MINOR_VERSION}"'\\.")) | .tag_name' - \
            | sort -V | tail -n1 || true)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +37 to +56
echo "Fetching downstream release config from ${HACK_RELEASE_CONFIG_URL}..."
HACK_RELEASE_CONFIG=$(curl -fsSL "${HACK_RELEASE_CONFIG_URL}" || true)
if [[ -z "${HACK_RELEASE_CONFIG}" ]]; then
echo "WARN: Failed to fetch ${HACK_RELEASE_CONFIG_URL}, falling back to 'devel'"
UPSTREAM_VERSION_TAG="devel"
else
UPSTREAM_RELEASE_BRANCH=$(echo "${HACK_RELEASE_CONFIG}" | yq e '.branches.operator.upstream' -)
if [[ -z "${UPSTREAM_RELEASE_BRANCH}" || "${UPSTREAM_RELEASE_BRANCH}" == "null" ]]; then
echo "WARN: 'branches.operator.upstream' not found in ${HACK_RELEASE_CONFIG_URL}, falling back to 'devel'"
UPSTREAM_VERSION_TAG="devel"
else
UPSTREAM_MINOR_VERSION=$(echo "${UPSTREAM_RELEASE_BRANCH}" | sed -E 's/^release-v([0-9]+\.[0-9]+)\.x$/\1/')
# Look up the latest release tag for this minor version from tektoncd/operator GitHub releases.
UPSTREAM_VERSION_TAG=$(curl -fsSL "https://api.github.com/repos/tektoncd/operator/releases" \
| yq e '.[] | select(.tag_name | test("^v?'"${UPSTREAM_MINOR_VERSION}"'\\.")) | .tag_name' - \
| sort -V | tail -n1 || true)
if [[ -z "${UPSTREAM_VERSION_TAG}" ]]; then
echo "WARN: No upstream tag found for minor version ${UPSTREAM_MINOR_VERSION} in tektoncd/operator releases, falling back to 'devel'"
UPSTREAM_VERSION_TAG="devel"
fi
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.

2 participants