Skip to content

Centralize pipelines#90

Closed
maorfr wants to merge 2 commits intomainfrom
centralize-pipelines
Closed

Centralize pipelines#90
maorfr wants to merge 2 commits intomainfrom
centralize-pipelines

Conversation

@maorfr
Copy link

@maorfr maorfr commented Jul 3, 2025

part of https://issues.redhat.com/browse/RHOAIENG-28846

this PR is an attempt to experiment with building multi-arch images for this component, to eventually support ARM.

Summary by CodeRabbit

  • New Features

    • Introduced automated pipeline runs triggered by pull request events on the main branch, integrated with OpenShift AppStudio and Pipelines as Code.
  • Refactor

    • Simplified the push pipeline by replacing the inline pipeline definition with a reference to an external Git-based pipeline, enhancing maintainability.

@openshift-ci openshift-ci bot requested review from dimakis and szaher July 3, 2025 09:04
@coderabbitai
Copy link

coderabbitai bot commented Jul 3, 2025

Walkthrough

A new Tekton PipelineRun resource for pull requests was added, and the existing push PipelineRun was refactored to reference an external pipeline definition from a remote Git repository instead of using an inline specification. Parameters and configuration were adjusted to match the new approach, with workspace and service account settings retained.

Changes

File(s) Change Summary
.tekton/odh-codeflare-operator-pull-request.yaml Added new PipelineRun for pull request events, referencing a remote pipeline and configuring parameters.
.tekton/odh-codeflare-operator-push.yaml Replaced inline pipeline spec with pipelineRef to external Git pipeline; simplified parameters and config.

Sequence Diagram(s)

sequenceDiagram
    participant PR_Event as Pull Request Event
    participant Tekton as Tekton Controller
    participant RemoteRepo as Remote Pipeline Repo
    participant Pipeline as PipelineRun

    PR_Event->>Tekton: Triggers PipelineRun (pull-request)
    Tekton->>RemoteRepo: Fetch pipeline definition (container-build.yaml)
    Tekton->>Pipeline: Start PipelineRun with parameters and workspace
    Pipeline-->>Tekton: Executes build steps as defined in remote pipeline
Loading
sequenceDiagram
    participant Push_Event as Push Event
    participant Tekton as Tekton Controller
    participant RemoteRepo as Remote Pipeline Repo
    participant Pipeline as PipelineRun

    Push_Event->>Tekton: Triggers PipelineRun (push)
    Tekton->>RemoteRepo: Fetch pipeline definition (container-build.yaml)
    Tekton->>Pipeline: Start PipelineRun with parameters and workspace
    Pipeline-->>Tekton: Executes build steps as defined in remote pipeline
Loading

Suggested labels

lgtm, approved

Suggested reviewers

  • ChristianZaccaria
  • Fiona-Waters

Poem

A pipeline hops from here to there,
No longer built with specs laid bare.
Now pull or push, the code will flow,
From distant Git, the tasks will grow.
With secrets safe and steps anew,
The rabbits cheer—"Our builds just flew!" 🐇🚀


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@openshift-ci
Copy link

openshift-ci bot commented Jul 3, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign varshaprasad96 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

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🔭 Outside diff range comments (2)
.tekton/odh-codeflare-operator-push.yaml (2)

11-13: Same multiline-string parsing error as in PR pipeline

pipelinesascode.tekton.dev/on-cel-expression is also split, breaking YAML. Apply the same one-line or > fix.


10-11: Branch filter inconsistency

on-target-branch is [test] while the CEL expression expects main. Align them to avoid silent skips.

🧹 Nitpick comments (1)
.tekton/odh-codeflare-operator-pull-request.yaml (1)

28-34: Static tag will overwrite previous PR images

output-image is hard-coded to quay.io/opendatahub/codeflare-operator:pr-v1.16.0.
Every pull-request build will push the same tag, racing with other PRs and making debugging harder.
Consider incorporating the commit SHA or PR number:

-    value: quay.io/opendatahub/codeflare-operator:pr-v1.16.0
+    value: quay.io/opendatahub/codeflare-operator:{{revision}}-{{ pr_number }}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7425d52 and 1f4e5d9.

📒 Files selected for processing (2)
  • .tekton/odh-codeflare-operator-pull-request.yaml (1 hunks)
  • .tekton/odh-codeflare-operator-push.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: precommit
  • GitHub Check: build
🔇 Additional comments (3)
.tekton/odh-codeflare-operator-pull-request.yaml (1)

40-41: Undefined template variable target_branch

The Git resolver’s revision parameter references {{ target_branch }}, but no such placeholder is supplied in params: or annotations processed by PaC.
If the intent is to use the incoming branch, reuse {{revision}} or define the variable explicitly.

.tekton/odh-codeflare-operator-push.yaml (2)

33-41: Missing definition for target_branch in Git resolver

{{ target_branch }} is used but never provided in params.
Either:

-    - name: revision
-      value: '{{ target_branch }}'
+    - name: revision
+      value: '{{ revision }}'

or add a matching param/annotation.


27-32: Consider aligning parameters with PR run

The push PipelineRun omits image-expires-after, which the shared container-build.yaml may require (it is present in the PR definition).
Double-check the remote pipeline’s parameter defaults.

Comment on lines +10 to +11
pipelinesascode.tekton.dev/on-target-branch: "[test]"
pipelinesascode.tekton.dev/on-event: "[pull_request]"
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Target-branch mismatch between filters

on-target-branch is limited to the literal branch test, while the CEL expression filters on main.
This inconsistency will make the run never trigger (or trigger twice if both branches are used). Pick one branch.

🤖 Prompt for AI Agents
In .tekton/odh-codeflare-operator-pull-request.yaml around lines 10 to 11, the
on-target-branch filter is set to "test" while the CEL expression filters on
"main", causing a mismatch that prevents the pipeline from triggering correctly.
To fix this, ensure both filters specify the same branch name by either changing
on-target-branch to "main" or updating the CEL expression to "test", so the
pipeline triggers consistently on the intended branch.

Comment on lines +10 to +13
pipelinesascode.tekton.dev/on-target-branch: "[test]"
pipelinesascode.tekton.dev/on-event: "[pull_request]"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
== "main"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Broken annotation value – YAML will not parse

The pipelinesascode.tekton.dev/on-cel-expression annotation is split across two lines.
YAML treats the newline as the end of the scalar, so == "main" becomes a second key that will be rejected by the API server.

-    pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
-      == "main"
+    pipelinesascode.tekton.dev/on-cel-expression: >
+      event == "pull_request" && target_branch == "main"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pipelinesascode.tekton.dev/on-target-branch: "[test]"
pipelinesascode.tekton.dev/on-event: "[pull_request]"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
== "main"
pipelinesascode.tekton.dev/on-target-branch: "[test]"
pipelinesascode.tekton.dev/on-event: "[pull_request]"
pipelinesascode.tekton.dev/on-cel-expression: >
event == "pull_request" && target_branch == "main"
🤖 Prompt for AI Agents
In .tekton/odh-codeflare-operator-pull-request.yaml around lines 10 to 13, the
annotation pipelinesascode.tekton.dev/on-cel-expression is split across two
lines, causing YAML parsing errors. Fix this by joining the expression into a
single line without a newline, ensuring the entire expression is a valid scalar
value in YAML.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
.tekton/odh-codeflare-operator-pull-request.yaml (2)

10-11: Branch filter mismatch will prevent PR runs from triggering

on-target-branch is still set to "[test]" while the CEL expression below targets the main branch. Pipelines-as-Code evaluates the intersection of all filters, so this configuration makes the PipelineRun un-triggerable (or double-triggered if both branches are pushed). Align the filters:

-    pipelinesascode.tekton.dev/on-target-branch: "[test]"
+    pipelinesascode.tekton.dev/on-target-branch: "[main]"

12-13: Multi-line annotation breaks YAML parsing

The on-cel-expression value is split across two lines, turning == "main" into a new key and causing a validation error. Use a folded scalar:

-    pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
-      == "main"
+    pipelinesascode.tekton.dev/on-cel-expression: >
+      event == "pull_request" && target_branch == "main"
🧹 Nitpick comments (2)
.tekton/odh-codeflare-operator-pull-request.yaml (2)

28-31: Trailing spaces flagged by yamllint

Lines 28 and 31 have trailing whitespace. While harmless at runtime, they fail linters configured in many CI pipelines—worth cleaning.

-  - name: additional-tags
-    value:␠
+  - name: additional-tags
+    value:
...
-  - name: additional-labels
-    value:␠
+  - name: additional-labels
+    value:

48-50: Inconsistent moustache syntax – could lead to substitution miss

Everywhere else variables are {{revision}} / {{target_branch}}, but here a space sneaks in: '{{ target_branch }}'. Some templating engines treat the space literally and won’t substitute. Consider normalising:

-      value: '{{ target_branch }}'
+      value: '{{target_branch}}'
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1f4e5d9 and 32b71b1.

📒 Files selected for processing (1)
  • .tekton/odh-codeflare-operator-pull-request.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.tekton/odh-codeflare-operator-pull-request.yaml

[error] 28-28: trailing spaces

(trailing-spaces)


[error] 31-31: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: precommit
  • GitHub Check: build
  • GitHub Check: precommit
  • GitHub Check: build

Comment on lines 40 to 43
- name: build-source-image
value: true
- name: build-image-index
value: false
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Booleans must be quoted – Tekton params are strings

Tekton treats all Param values as strings. Unquoted true/false become YAML booleans and will be rejected by the webhook.

-  - name: build-source-image
-    value: true
+  - name: build-source-image
+    value: "true"
-  - name: build-image-index
-    value: false
+  - name: build-image-index
+    value: "false"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: build-source-image
value: true
- name: build-image-index
value: false
- name: build-source-image
value: "true"
- name: build-image-index
value: "false"
🤖 Prompt for AI Agents
In .tekton/odh-codeflare-operator-pull-request.yaml around lines 40 to 43, the
boolean values true and false are unquoted, causing them to be interpreted as
YAML booleans instead of strings. To fix this, enclose the values true and false
in double quotes to ensure they are treated as strings by Tekton, for example,
change value: true to value: "true" and value: false to value: "false".

@maorfr
Copy link
Author

maorfr commented Jul 3, 2025

/retest

@maorfr maorfr force-pushed the centralize-pipelines branch from 32b71b1 to 1f4e5d9 Compare July 3, 2025 09:22
@maorfr
Copy link
Author

maorfr commented Jul 3, 2025

/retest

@openshift-ci
Copy link

openshift-ci bot commented Jul 3, 2025

@maorfr: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-odh-cfo 1f4e5d9 link false /test e2e-odh-cfo

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.

@maorfr maorfr closed this Aug 14, 2025
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.

1 participant