Skip to content

CNTRLPLANE-3054: auto-run migration scripts on Konflux task version bumps#8054

Draft
celebdor wants to merge 2 commits into
openshift:mainfrom
celebdor:CNTRLPLANE-3054-auto-migrations
Draft

CNTRLPLANE-3054: auto-run migration scripts on Konflux task version bumps#8054
celebdor wants to merge 2 commits into
openshift:mainfrom
celebdor:CNTRLPLANE-3054-auto-migrations

Conversation

@celebdor

@celebdor celebdor commented Mar 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds automatic migration script detection and execution to update_trusted_task_bundles.py when upgrading Tekton tasks across versions
  • Prevents pipeline breakage caused by version bumps that remove/rename parameters or results (as happened with the init task 0.2→0.4 upgrade in CNTRLPLANE-3054)
  • Migrations run by default with --upgrade-versions and can be skipped with --skip-migrations; in dry-run mode, pending migrations are listed without execution
  • Updates the /update-konflux-tasks Claude command docs to reflect the new behavior and pmt requirement

How it works

When a task version bump is detected (e.g., init 0.2 → 0.4), the script:

  1. Computes intermediate versions (0.3, 0.4)
  2. Checks for migration scripts at https://raw.githubusercontent.com/konflux-ci/build-definitions/main/task/{name}/{version}/migrations/{version}.sh
  3. Downloads and runs each available migration script on affected pipeline files using pmt (pipeline-migration-tool)

Test plan

  • Run update_trusted_task_bundles.py .tekton/pipelines/*.yaml --dry-run --upgrade-versions and verify migration scripts are listed
  • Run without --dry-run on a test branch and verify migrations are applied correctly
  • Verify --skip-migrations flag prevents migration execution

Ref: CNTRLPLANE-3054

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Migration scripts now automatically detect and execute during version updates.
    • Added --skip-migrations CLI flag to optionally bypass migration execution.
  • Documentation

    • Updated workflow documentation to clarify automatic migration behavior and tool requirements.

The update_trusted_task_bundles.py script now automatically detects and
runs migration scripts from konflux-ci/build-definitions when upgrading
tasks across versions. This prevents pipeline breakage caused by
version bumps that remove/rename parameters or results (as happened
with the init task 0.2→0.4 upgrade in CNTRLPLANE-3054).

Migrations run by default with --upgrade-versions and can be skipped
with --skip-migrations. In dry-run mode, pending migrations are listed
without execution.

Ref: CNTRLPLANE-3054

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 24, 2026
@openshift-ci-robot

openshift-ci-robot commented Mar 24, 2026

Copy link
Copy Markdown

@celebdor: This pull request references CNTRLPLANE-3054 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

  • Adds automatic migration script detection and execution to update_trusted_task_bundles.py when upgrading Tekton tasks across versions
  • Prevents pipeline breakage caused by version bumps that remove/rename parameters or results (as happened with the init task 0.2→0.4 upgrade in CNTRLPLANE-3054)
  • Migrations run by default with --upgrade-versions and can be skipped with --skip-migrations; in dry-run mode, pending migrations are listed without execution
  • Updates the /update-konflux-tasks Claude command docs to reflect the new behavior and pmt requirement

How it works

When a task version bump is detected (e.g., init 0.2 → 0.4), the script:

  1. Computes intermediate versions (0.3, 0.4)
  2. Checks for migration scripts at https://raw.githubusercontent.com/konflux-ci/build-definitions/main/task/{name}/{version}/migrations/{version}.sh
  3. Downloads and runs each available migration script on affected pipeline files using pmt (pipeline-migration-tool)

Test plan

  • Run update_trusted_task_bundles.py .tekton/pipelines/*.yaml --dry-run --upgrade-versions and verify migration scripts are listed
  • Run without --dry-run on a test branch and verify migrations are applied correctly
  • Verify --skip-migrations flag prevents migration execution

Ref: CNTRLPLANE-3054

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot

Copy link
Copy Markdown

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot

openshift-ci-robot commented Mar 24, 2026

Copy link
Copy Markdown

@celebdor: This pull request references CNTRLPLANE-3054 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

  • Adds automatic migration script detection and execution to update_trusted_task_bundles.py when upgrading Tekton tasks across versions
  • Prevents pipeline breakage caused by version bumps that remove/rename parameters or results (as happened with the init task 0.2→0.4 upgrade in CNTRLPLANE-3054)
  • Migrations run by default with --upgrade-versions and can be skipped with --skip-migrations; in dry-run mode, pending migrations are listed without execution
  • Updates the /update-konflux-tasks Claude command docs to reflect the new behavior and pmt requirement

How it works

When a task version bump is detected (e.g., init 0.2 → 0.4), the script:

  1. Computes intermediate versions (0.3, 0.4)
  2. Checks for migration scripts at https://raw.githubusercontent.com/konflux-ci/build-definitions/main/task/{name}/{version}/migrations/{version}.sh
  3. Downloads and runs each available migration script on affected pipeline files using pmt (pipeline-migration-tool)

Test plan

  • Run update_trusted_task_bundles.py .tekton/pipelines/*.yaml --dry-run --upgrade-versions and verify migration scripts are listed
  • Run without --dry-run on a test branch and verify migrations are applied correctly
  • Verify --skip-migrations flag prevents migration execution

Ref: CNTRLPLANE-3054

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Excluded labels (none allowed) (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 67e650a2-3b35-4183-9726-1d9cbbf9388e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The changes introduce automated migration script detection and execution into the trusted task bundles update workflow. A new --skip-migrations CLI flag is added to optionally disable this behavior. When a version bump is detected, the system computes intermediate versions between current and target, probes an HTTP endpoint to identify available migration scripts, and executes them sequentially. The documentation is updated to reflect this automation and the new requirement for the pmt (pipeline-migration-tool) tool.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Script as update_trusted_task_bundles.py
    participant HTTP as Migration Scripts Endpoint
    participant FileSystem as Local Pipeline Files
    participant Shell as Migration Scripts

    User->>Script: Run with version bump
    Script->>Script: Detect version bump
    Script->>Script: Compute intermediate versions
    Script->>HTTP: Probe for migration scripts (curl)
    HTTP-->>Script: Return available migration script URLs
    Script->>Script: Generate list of migrations to run
    alt Dry-run mode
        Script-->>User: Print pending migrations
    else Normal mode
        Script->>Shell: Execute migration scripts in sequence
        Shell->>FileSystem: Update pipeline YAML files
        Shell-->>Script: Return execution results
        Script-->>User: Report completed migrations
    end
Loading
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot added area/ai Indicates the PR includes changes related to AI - Claude agents, Cursor rules, etc. area/ci-tooling Indicates the PR includes changes for CI or tooling and removed do-not-merge/needs-area labels Mar 24, 2026
@openshift-ci openshift-ci Bot requested review from jparrill and muraee March 24, 2026 11:04
@openshift-ci-robot

openshift-ci-robot commented Mar 24, 2026

Copy link
Copy Markdown

@celebdor: This pull request references CNTRLPLANE-3054 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

  • Adds automatic migration script detection and execution to update_trusted_task_bundles.py when upgrading Tekton tasks across versions
  • Prevents pipeline breakage caused by version bumps that remove/rename parameters or results (as happened with the init task 0.2→0.4 upgrade in CNTRLPLANE-3054)
  • Migrations run by default with --upgrade-versions and can be skipped with --skip-migrations; in dry-run mode, pending migrations are listed without execution
  • Updates the /update-konflux-tasks Claude command docs to reflect the new behavior and pmt requirement

How it works

When a task version bump is detected (e.g., init 0.2 → 0.4), the script:

  1. Computes intermediate versions (0.3, 0.4)
  2. Checks for migration scripts at https://raw.githubusercontent.com/konflux-ci/build-definitions/main/task/{name}/{version}/migrations/{version}.sh
  3. Downloads and runs each available migration script on affected pipeline files using pmt (pipeline-migration-tool)

Test plan

  • Run update_trusted_task_bundles.py .tekton/pipelines/*.yaml --dry-run --upgrade-versions and verify migration scripts are listed
  • Run without --dry-run on a test branch and verify migrations are applied correctly
  • Verify --skip-migrations flag prevents migration execution

Ref: CNTRLPLANE-3054

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

  • Migration scripts now automatically detect and execute during version updates.

  • Added --skip-migrations CLI flag to optionally bypass migration execution.

  • Documentation

  • Updated workflow documentation to clarify automatic migration behavior and tool requirements.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@celebdor celebdor marked this pull request as draft March 24, 2026 11:11
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 24, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@hack/tools/scripts/update_trusted_task_bundles.py`:
- Around line 564-573: The code collapses distinct version bumps by using
update.task_name as the dict key, causing overwrites and duplicate file entries;
change the keys for version_bumps and bump_files to a tuple of
(update.task_name, update.current_version, update.latest_version) when
collecting from all_results and ensure you deduplicate file paths (e.g., use a
set or check existence before append) so each unique migration tuple maps to a
unique list of files; apply the same tuple-key + dedupe fix to the other
collection block that mirrors this logic (the block using version_bumps and
bump_files later in the file).
- Around line 539-546: The current curl/http-check block (the subprocess.run
call with ["curl", "-fsSL", "-o", "/dev/null", "-w", "%{http_code}", url]
wrapped in try/except for subprocess.CalledProcessError and
subprocess.TimeoutExpired) treats transport/timeouts like "not found" and
swallows execution errors later; change it to treat non-200 non-404 responses
and any exceptions as fatal: explicitly check result.stdout for "200"
(available) and for "404" (treat as not available) but if result.stdout is any
other code or if subprocess.CalledProcessError/TimeoutExpired occurs, raise/exit
with an error so the update aborts; apply the same policy to the download
subprocess.run (the block that actually fetches the migration script) and the
migration execution subprocess.run (the block that runs the script which
currently only logs failures around lines 613-619 and 790-798), and ensure you
don’t write/commit bundle refs until all lookups, downloads, and executions
succeed (or roll back the write on failure) so partial migrations cannot leave
half-updated YAML.
- Around line 495-498: The MIGRATION_SCRIPT_URL currently points at the mutable
"main" branch and the fetched script is executed directly with bash; change
MIGRATION_SCRIPT_URL to reference an immutable ref (commit hash or release tag)
via a new constant or environment variable (e.g., MIGRATION_REF) and update
fetch logic to first download the script to a file, obtain a trusted
checksum/signature (from a pinned metadata URL or bundled allowlist), verify the
downloaded file against that checksum/signature, and only then execute it; also
stop piping remote content straight into bash—use the verified local file path
in the code paths that call the executor (look for MIGRATION_SCRIPT_URL and the
logic that invokes bash) and abort with a clear error if verification fails.
- Around line 530-531: The code uses task_name.removeprefix("task-") which
requires Python 3.9; replace it with a Python 3.8-compatible slice: set
short_name = task_name[len("task-"): ] if task_name.startswith("task-") else
task_name so the "task-" prefix is stripped only when present (locate the
short_name assignment that uses task_name.removeprefix).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 4fe7df0e-a110-44b4-aa73-9f9e62c69ad7

📥 Commits

Reviewing files that changed from the base of the PR and between 8b261b4 and 41e4d21.

📒 Files selected for processing (2)
  • .claude/commands/update-konflux-tasks.md
  • hack/tools/scripts/update_trusted_task_bundles.py

Comment on lines +495 to +498
MIGRATION_SCRIPT_URL = (
"https://raw.githubusercontent.com/konflux-ci/build-definitions/main"
"/task/{task_name}/{version}/migrations/{version}.sh"
)

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.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n 'raw\.githubusercontent\.com/konflux-ci/build-definitions/main|curl", "-fsSL", "-o", script_path|bash", script_path' hack/tools/scripts/update_trusted_task_bundles.py

Repository: openshift/hypershift

Length of output: 274


Pin migration scripts to an immutable ref and verify before execution.

The migration source is resolved from the mutable main branch (line 496), and the downloaded script is executed directly with bash (line 610) without verification. This creates a supply-chain risk: any upstream change or compromise becomes arbitrary code execution in the caller's environment. Additionally, fetching from a mutable branch makes the update non-reproducible.

Use an immutable commit hash or release tag instead of /main/, and verify the downloaded content (e.g., checksum or signature) before invoking bash to execute it.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@hack/tools/scripts/update_trusted_task_bundles.py` around lines 495 - 498,
The MIGRATION_SCRIPT_URL currently points at the mutable "main" branch and the
fetched script is executed directly with bash; change MIGRATION_SCRIPT_URL to
reference an immutable ref (commit hash or release tag) via a new constant or
environment variable (e.g., MIGRATION_REF) and update fetch logic to first
download the script to a file, obtain a trusted checksum/signature (from a
pinned metadata URL or bundled allowlist), verify the downloaded file against
that checksum/signature, and only then execute it; also stop piping remote
content straight into bash—use the verified local file path in the code paths
that call the executor (look for MIGRATION_SCRIPT_URL and the logic that invokes
bash) and abort with a clear error if verification fails.

Comment on lines +530 to +531
# Strip "task-" prefix for the build-definitions repo path
short_name = task_name.removeprefix("task-")

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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n 'Python 3\.8\+|removeprefix\(' hack/tools/scripts/update_trusted_task_bundles.py

Repository: openshift/hypershift

Length of output: 137


removeprefix() requires Python 3.9, contradicting documented Python 3.8+ support.

Line 531 uses str.removeprefix(), which was added in Python 3.9. This breaks compatibility with Python 3.8, which is documented as supported at line 28. Either bump the minimum requirement to Python 3.9+ or use a 3.8-compatible alternative.

Python 3.8-compatible fix
-    short_name = task_name.removeprefix("task-")
+    short_name = task_name[5:] if task_name.startswith("task-") else task_name
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@hack/tools/scripts/update_trusted_task_bundles.py` around lines 530 - 531,
The code uses task_name.removeprefix("task-") which requires Python 3.9; replace
it with a Python 3.8-compatible slice: set short_name = task_name[len("task-"):
] if task_name.startswith("task-") else task_name so the "task-" prefix is
stripped only when present (locate the short_name assignment that uses
task_name.removeprefix).

Comment on lines +539 to +546
result = subprocess.run(
["curl", "-fsSL", "-o", "/dev/null", "-w", "%{http_code}", url],
capture_output=True, text=True, timeout=10
)
if result.stdout.strip() == "200":
available.append((version, url))
except (subprocess.CalledProcessError, subprocess.TimeoutExpired):
continue

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.

⚠️ Potential issue | 🟠 Major

Treat migration lookup and execution failures as fatal.

Lines 539-546 currently treat transport problems the same as “no script exists”, and Lines 613-619 only log execution failures. By the time Lines 790-798 are reached, the bundle refs have already been written, so the command can still exit successfully with half-migrated YAML. Distinguish 404 from lookup failures, and abort or roll back the update on any lookup, download, or execution error.

Also applies to: 613-619, 790-798

🧰 Tools
🪛 Ruff (0.15.6)

[error] 539-539: subprocess call: check for execution of untrusted input

(S603)


[error] 540-540: Starting a process with a partial executable path

(S607)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@hack/tools/scripts/update_trusted_task_bundles.py` around lines 539 - 546,
The current curl/http-check block (the subprocess.run call with ["curl",
"-fsSL", "-o", "/dev/null", "-w", "%{http_code}", url] wrapped in try/except for
subprocess.CalledProcessError and subprocess.TimeoutExpired) treats
transport/timeouts like "not found" and swallows execution errors later; change
it to treat non-200 non-404 responses and any exceptions as fatal: explicitly
check result.stdout for "200" (available) and for "404" (treat as not available)
but if result.stdout is any other code or if
subprocess.CalledProcessError/TimeoutExpired occurs, raise/exit with an error so
the update aborts; apply the same policy to the download subprocess.run (the
block that actually fetches the migration script) and the migration execution
subprocess.run (the block that runs the script which currently only logs
failures around lines 613-619 and 790-798), and ensure you don’t write/commit
bundle refs until all lookups, downloads, and executions succeed (or roll back
the write on failure) so partial migrations cannot leave half-updated YAML.

Comment on lines +564 to +573
# Collect unique version bumps (task_name -> (current, target))
version_bumps: Dict[str, Tuple[str, str]] = {}
bump_files: Dict[str, List[Path]] = {}

for filepath, result in all_results.items():
for update in result.updates:
if update.is_version_bump:
key = update.task_name
version_bumps[key] = (update.current_version, update.latest_version)
bump_files.setdefault(key, []).append(filepath)

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.

⚠️ Potential issue | 🟠 Major

Don't collapse different bumps under task_name.

Lines 565-573 and 624-632 key migrations only by task name. If two files bump the same task from different starting versions, the later entry overwrites the earlier one; and if the same task appears multiple times in one file, that file is added repeatedly. The result is skipped intermediate migrations for some files or duplicate runs for others. Key this by (task_name, current_version, latest_version) and dedupe the file list.

Also applies to: 624-632

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@hack/tools/scripts/update_trusted_task_bundles.py` around lines 564 - 573,
The code collapses distinct version bumps by using update.task_name as the dict
key, causing overwrites and duplicate file entries; change the keys for
version_bumps and bump_files to a tuple of (update.task_name,
update.current_version, update.latest_version) when collecting from all_results
and ensure you deduplicate file paths (e.g., use a set or check existence before
append) so each unique migration tuple maps to a unique list of files; apply the
same tuple-key + dedupe fix to the other collection block that mirrors this
logic (the block using version_bumps and bump_files later in the file).

@bryan-cox

Copy link
Copy Markdown
Member

/approve

@openshift-ci

openshift-ci Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bryan-cox, celebdor

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

The pull request process is described 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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 24, 2026
Replace the separate "Check Migration Notes" and "Update Pipeline Files"
steps with a combined "Apply Updates and Handle Migrations" step that:
- Runs update_trusted_task_bundles.py --upgrade-versions to apply all
  updates (digest and version bumps) with automatic migrations in one shot
- Then has the agent check for manual migration instructions in MIGRATION.md
  that the script can't handle automatically

This eliminates the redundant manual file editing step since the script
already handles bundle reference updates and migration scripts.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@jparrill

jparrill commented May 5, 2026

Copy link
Copy Markdown
Contributor

/retest-required

Hey @celebdor the PR LGTM, looks like Konflux pipeline is failing, I will tag it after it’s passing.

@openshift-ci

openshift-ci Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

@celebdor: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci

openshift-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Stale PRs are closed after 21d of inactivity.

If this PR is still relevant, comment to refresh it or remove the stale label.
Mark the PR as fresh by commenting /remove-lifecycle stale.

If this PR is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci Bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 11, 2026
@hypershift-jira-solve-ci

hypershift-jira-solve-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown

I now have the complete picture. Here is the analysis:

Test Failure Analysis Complete

Job Information

Test Failure Analysis

Error

invalid result reference in pipeline task "clone-repository": "build" is not a named result returned by pipeline task "init"

Summary

The Konflux pipeline failed at validation time before any task executed. The PR branch (last pushed 2026-03-25) contains a stale .tekton/pipelines/common-operator-build.yaml that references a $(tasks.init.results.build) result in the clone-repository task's when expression. This result was removed from the init task in the 0.2→0.4 version bump (specifically the 0.3 migration removed the build result, image-url, rebuild, and skip-checks params). A fix commit (a14c0e73) was merged to main roughly 4 hours after this check run, but PR #8054 has never been rebased to pick it up.

Root Cause

The root cause is a stale branch that predates a breaking Tekton task migration.

Here is the timeline:

  1. 2026-03-23: PR NO-JIRA: chore(ci): update Konflux Tekton tasks to latest versions #8048 bumped the init task from 0.2 to 0.4 on main, but did not apply the required 0.3 migration script. This left stale when conditions ($(tasks.init.results.build)) and params (image-url, rebuild, skip-checks) in the pipeline YAML that referenced results/params removed in init 0.3.

  2. 2026-03-24 11:04Z: PR CNTRLPLANE-3054: auto-run migration scripts on Konflux task version bumps #8054 was created, branching from main at a point that already contained the broken pipeline YAML.

  3. 2026-03-25 18:13Z: The Konflux check ran on PR CNTRLPLANE-3054: auto-run migration scripts on Konflux task version bumps #8054's head commit (208c23f) and failed immediately — the Tekton pipeline controller validated the resolved pipeline and found clone-repository references $(tasks.init.results.build), which the init:0.4 task bundle no longer exposes.

  4. 2026-03-25 22:01Z: Fix commit a14c0e73 was merged to main, applying the init 0.3 migration to remove the stale when conditions and obsolete params. This fixed the issue for all PRs based on newer main.

  5. PR CNTRLPLANE-3054: auto-run migration scripts on Konflux task version bumps #8054 was never rebased after the fix landed. Its .tekton/pipelines/common-operator-build.yaml still contains the pre-migration version with the invalid $(tasks.init.results.build) reference.

The PR itself only modifies .claude/commands/update-konflux-tasks.md and hack/tools/scripts/update_trusted_task_bundles.py — it does not touch any .tekton/ files. The pipeline failure is entirely due to the stale base.

Recommendations
  1. Rebase PR CNTRLPLANE-3054: auto-run migration scripts on Konflux task version bumps #8054 onto current main — this will pick up commit a14c0e73 which applied the init 0.3 migration, removing the invalid $(tasks.init.results.build) reference and obsolete params. The Konflux pipeline will pass after rebase.

  2. No code changes needed in PR CNTRLPLANE-3054: auto-run migration scripts on Konflux task version bumps #8054 — the PR only modifies a Claude Code command file and a Python utility script. The pipeline failure is not caused by any change in this PR.

  3. Re-trigger the Konflux check after rebasing by pushing new commits or using /retest if available.

Evidence
Evidence Detail
Error message invalid result reference in pipeline task "clone-repository": "build" is not a named result returned by pipeline task "init"
PR branch pipeline (208c23f) clone-repository has when: [{input: $(tasks.init.results.build), operator: in, values: ["true"]}] — references removed result
PR branch init task digest task-init:0.4@sha256:288f3106... (pre-migration digest)
Main branch pipeline (current) clone-repository has NO when expression — migration applied
Main branch init task digest task-init:0.4@sha256:5a423246... (post-migration digest)
Fix commit a14c0e73 — "fix(konflux): apply init task 0.3 migration to fix broken pipelines" (merged 2026-03-25 22:01Z)
Check run timestamp 2026-03-25 18:13Z — 4 hours before the fix was merged
PR files changed .claude/commands/update-konflux-tasks.md, hack/tools/scripts/update_trusted_task_bundles.py — no .tekton/ files modified
Recent PRs (#8710-8713) All pass hypershift-operator-main-on-pull-request — confirming the fix works on current main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/ai Indicates the PR includes changes related to AI - Claude agents, Cursor rules, etc. area/ci-tooling Indicates the PR includes changes for CI or tooling do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants