Skip to content

OLS-3189: add agentic workflow CRDs with sync tool#1695

Open
raptorsun wants to merge 1 commit into
openshift:mainfrom
raptorsun:agentic-crd
Open

OLS-3189: add agentic workflow CRDs with sync tool#1695
raptorsun wants to merge 1 commit into
openshift:mainfrom
raptorsun:agentic-crd

Conversation

@raptorsun
Copy link
Copy Markdown
Contributor

@raptorsun raptorsun commented Jun 4, 2026

Description

This PR adds the CRDs required by the agentic workflow and a tool script to synchronize from the lightspeed-agentic-operator repository.

The CRDs are synchronized when calling make bundle.

To sync agentic CRDs and samples from the pinned ref (defaults to main) without regenerating the bundle:

make sync-agentic-crds

To sync from a specific tag or commit:

make sync-agentic-crds AGENTIC_OPERATOR_REF=v0.1.0

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up dependent library

Related Tickets & Documents

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

Summary by CodeRabbit

  • New Features

    • Added support for agentic workflow custom resources (Agent, LLMProvider, Proposal, ApprovalPolicy, ProposalApproval) and result-tracking resources (AnalysisResult, ExecutionResult, VerificationResult, EscalationResult).
    • Agentic CRDs are now fetched and included automatically when building the operator bundle.
  • Documentation

    • New guidance on syncing agentic CRDs and overriding the pinned repository/ref for bundle generation.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 4, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Jun 4, 2026

@raptorsun: This pull request references OLS-3189 which is a valid jira issue.

Details

In response to this:

Description

This PR adds the CRDs required by the agentic workflow and a tool script to synchronize from the lightspeed-agentic-operator repository.

The CRDs are synchronized when calling make bundle.

To sync agentic CRDs and samples from the pinned ref (defaults to main) without regenerating the bundle:

make sync-agentic-crds

To sync from a specific tag or commit:

make sync-agentic-crds AGENTIC_OPERATOR_REF=v0.1.0

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up dependent library

Related Tickets & Documents

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

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
Copy link
Copy Markdown

coderabbitai Bot commented Jun 4, 2026

Warning

Review limit reached

@raptorsun, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 33 minutes and 2 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: be06b834-bd51-465c-9bce-dc1808695303

📥 Commits

Reviewing files that changed from the base of the PR and between f2af5b6 and 2778fe5.

⛔ Files ignored due to path filters (9)
  • config/crd/bases/agentic.openshift.io_agents.yaml is excluded by !config/crd/bases/**
  • config/crd/bases/agentic.openshift.io_analysisresults.yaml is excluded by !config/crd/bases/**
  • config/crd/bases/agentic.openshift.io_approvalpolicies.yaml is excluded by !config/crd/bases/**
  • config/crd/bases/agentic.openshift.io_escalationresults.yaml is excluded by !config/crd/bases/**
  • config/crd/bases/agentic.openshift.io_executionresults.yaml is excluded by !config/crd/bases/**
  • config/crd/bases/agentic.openshift.io_llmproviders.yaml is excluded by !config/crd/bases/**
  • config/crd/bases/agentic.openshift.io_proposalapprovals.yaml is excluded by !config/crd/bases/**
  • config/crd/bases/agentic.openshift.io_proposals.yaml is excluded by !config/crd/bases/**
  • config/crd/bases/agentic.openshift.io_verificationresults.yaml is excluded by !config/crd/bases/**
📒 Files selected for processing (25)
  • Makefile
  • README.md
  • bundle/manifests/agentic.openshift.io_agents.yaml
  • bundle/manifests/agentic.openshift.io_analysisresults.yaml
  • bundle/manifests/agentic.openshift.io_approvalpolicies.yaml
  • bundle/manifests/agentic.openshift.io_escalationresults.yaml
  • bundle/manifests/agentic.openshift.io_executionresults.yaml
  • bundle/manifests/agentic.openshift.io_llmproviders.yaml
  • bundle/manifests/agentic.openshift.io_proposalapprovals.yaml
  • bundle/manifests/agentic.openshift.io_proposals.yaml
  • bundle/manifests/agentic.openshift.io_verificationresults.yaml
  • bundle/manifests/lightspeed-operator.clusterserviceversion.yaml
  • config/crd/kustomization.yaml
  • config/manifests/bases/lightspeed-operator.clusterserviceversion.yaml
  • config/samples/agentic_v1alpha1_agent.yaml
  • config/samples/agentic_v1alpha1_analysisresult.yaml
  • config/samples/agentic_v1alpha1_approvalpolicy.yaml
  • config/samples/agentic_v1alpha1_escalationresult.yaml
  • config/samples/agentic_v1alpha1_executionresult.yaml
  • config/samples/agentic_v1alpha1_llmprovider.yaml
  • config/samples/agentic_v1alpha1_proposal.yaml
  • config/samples/agentic_v1alpha1_proposalapproval.yaml
  • config/samples/agentic_v1alpha1_verificationresult.yaml
  • config/samples/kustomization.yaml
  • hack/sync_agentic_crds.sh
📝 Walkthrough

Walkthrough

Adds Makefile-driven synchronization of agentic operator CRDs and samples (via a new script and Make target), introduces multiple agentic CustomResourceDefinitions with detailed OpenAPI validation, adds sample manifests and kustomization entries, and updates the operator bundle/CSV to own the new resources.

Changes

Agentic Operator Integration

Layer / File(s) Summary
Build infrastructure and CRD synchronization
Makefile, hack/sync_agentic_crds.sh, README.md
Makefile variables for the agentic repo/ref/CRD dir, sync-agentic-crds target, and a new bash script that shallow-fetches the external repo, copies agentic.openshift.io_*.yaml CRDs and agentic_*.yaml samples into the workspace, and updates config/crd/kustomization.yaml and config/samples/kustomization.yaml. README documents usage and overriding the pinned ref.
Agent CRD and kustomize entry
bundle/manifests/agentic.openshift.io_agents.yaml, config/crd/kustomization.yaml
Adds cluster-scoped Agent CRD with OpenAPI v3 spec and status schemas, printer columns, status subresource, and registers new agentic CRD bases in CRD kustomization.
Agentic resource type definitions
bundle/manifests/agentic.openshift.io_*.yaml
Adds CRDs for AnalysisResult, EscalationResult, ExecutionResult, VerificationResult, ApprovalPolicy, ProposalApproval, and LLMProvider with comprehensive validation schemas, conditional rules, immutability validations, printer columns, and status subresources.
Operator metadata updates
bundle/manifests/lightspeed-operator.clusterserviceversion.yaml, config/manifests/bases/lightspeed-operator.clusterserviceversion.yaml
Replaces alm-examples with agentic workflow examples, extends spec.customresourcedefinitions.owned to include the new agentic CRDs, updates bundle createdAt timestamp, and a minor CSV doc formatting change.
Sample resource manifests
config/samples/agentic_v1alpha1_*.yaml, config/samples/kustomization.yaml
Adds sample manifests demonstrating the agentic workflow (Agent, LLMProvider, Proposal, ApprovalPolicy, ProposalApproval, AnalysisResult, EscalationResult, ExecutionResult, VerificationResult) and registers them in samples kustomization.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'OLS-3189: add agentic workflow CRDs with sync tool' directly and clearly summarizes the main changes: adding agentic workflow CRDs and a synchronization tool, which are the primary objectives of this pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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

@openshift-ci openshift-ci Bot requested review from joshuawilson and xrajesh June 4, 2026 08:23
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jun 4, 2026

[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 xrajesh 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

@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: 4

🧹 Nitpick comments (2)
bundle/manifests/lightspeed-operator.clusterserviceversion.yaml (2)

98-120: 💤 Low value

Consider including all referenced agents in the examples.

The Proposal example references three agent names ("smart" for analysis, "default" for execution, "fast" for verification), but the Agent example (lines 7-20) only defines "default". While this technically works, showing all three agents in the alm-examples would provide a more complete and self-contained demonstration of the workflow.

📋 Suggested additional Agent examples

Consider adding these additional agents to the alm-examples array (after the existing Agent at line 20):

       }
     },
+    {
+      "apiVersion": "agentic.openshift.io/v1alpha1",
+      "kind": "Agent",
+      "metadata": {
+        "name": "smart"
+      },
+      "spec": {
+        "llmProvider": {
+          "name": "vertex-ai"
+        },
+        "maxTurns": 200,
+        "model": "claude-opus-4-6"
+      }
+    },
+    {
+      "apiVersion": "agentic.openshift.io/v1alpha1",
+      "kind": "Agent",
+      "metadata": {
+        "name": "fast"
+      },
+      "spec": {
+        "llmProvider": {
+          "name": "vertex-ai"
+        },
+        "maxTurns": 100,
+        "model": "claude-sonnet-4-6"
+      }
+    },
     {
       "apiVersion": "agentic.openshift.io/v1alpha1",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bundle/manifests/lightspeed-operator.clusterserviceversion.yaml` around lines
98 - 120, The Proposal example uses three agent names (spec.analysis.agent
"smart", spec.execution.agent "default", spec.verification.agent "fast") but the
alm-examples only defines the "default" Agent; add Agent resources for the
"smart" and "fast" agents to the alm-examples array so the CSV is
self-contained—create two additional objects with "apiVersion":
"agentic.openshift.io/v1alpha1", "kind": "Agent", metadata.name "smart" and
"fast" and include plausible spec fields matching the existing "default" Agent
example.

212-229: ⚖️ Poor tradeoff

New agentic CRDs lack UI metadata descriptors.

The nine newly-added agentic CRDs (Agent, AnalysisResult, ApprovalPolicy, EscalationResult, ExecutionResult, LLMProvider, Proposal, ProposalApproval, VerificationResult) are missing displayName, description, specDescriptors, and statusDescriptors fields, unlike the OLSConfig CRD (lines 230-626). This means the OpenShift Console UI won't provide helpful field descriptions, display names, or input hints when users create or edit these resources.

Since these CRDs are synchronized from the external lightspeed-agentic-operator repository (per PR description), this may be intentional. However, consider whether enhanced Console integration is desired for end users.

Also applies to: 627-635

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bundle/manifests/lightspeed-operator.clusterserviceversion.yaml` around lines
212 - 229, The new agentic CRDs (kinds: Agent, AnalysisResult, ApprovalPolicy,
EscalationResult, ExecutionResult, LLMProvider, Proposal, ProposalApproval,
VerificationResult) in the CSV lack Console UI metadata; add displayName and
description and provide specDescriptors and statusDescriptors blocks for each
CRD in the CSV manifest to match the pattern used by OLSConfig (use its
displayName/description/specDescriptors/statusDescriptors as the template),
ensuring each field/attribute has a human-readable label, description, and
appropriate path/type so the OpenShift Console shows helpful UI hints when
creating or editing these resources.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@config/samples/agentic_v1alpha1_proposal.yaml`:
- Around line 10-15: The sample YAML references non-existent agents: update the
analysis.agent and verification.agent values (currently "smart" and "fast") to
use the shipped sample agent name "default" (matching execution.agent), or
alternatively add Agent sample definitions named "smart" and "fast" to the
samples; locate the keys analysis.agent and verification.agent in the proposal
sample and either change their values to "default" or add corresponding Agent
resources with those names.

In `@hack/sync_agentic_crds.sh`:
- Around line 40-46: The script currently deletes and reinserts entries around
the scaffold marker SCAFFOLD_LINE but doesn't verify the marker exists, so
removals can proceed without reinsertion; update the logic that handles
SCAFFOLD_LINE (and the analogous block later around lines 54-62) to first check
that the marker string exists in the target file referenced by KUSTOMIZATION
(e.g., grep or a test on sed -n) and if not, echo a clear error and exit
non‑zero immediately (fail fast) before performing the deletion/loop; ensure the
check references the SCAFFOLD_LINE variable and the same KUSTOMIZATION file and
apply the same guard in both the first loop (for f in
"${DEST}"/agentic.openshift.io_*.yaml) and the second similar block so you don’t
proceed when scaffold markers are missing.
- Around line 23-46: The script currently copies new CRDs into ${DEST} but never
removes deleted upstream CRDs; before copying, remove any existing files
matching "${DEST}/agentic.openshift.io_*.yaml" so deleted CRDs are purged, then
proceed to copy from ${SRC} and rebuild the KUSTOMIZATION at ${KUSTOMIZATION} as
you already do: remove lines matching '^- bases/agentic\.openshift\.io_'
(SCAFFOLD_LINE handling stays) and re-insert ENTRY lines for each remaining file
in ${DEST}; ensure the count logic still fails when no files are present and
that the loop that produces ENTRY uses the files in ${DEST} (not ${SRC}) so only
current files are added.

In `@Makefile`:
- Line 9: AGENTIC_OPERATOR_REF is currently defaulting to the mutable branch
name "main"; change the Makefile so AGENTIC_OPERATOR_REF defaults to an
immutable release reference (e.g., a specific tag or commit hash) instead of
"main". Locate the AGENTIC_OPERATOR_REF variable in the Makefile and replace the
value "main" with a fixed tag or commit (or a clearly documented placeholder
like a stable version string) so running make bundle is reproducible and
upstream changes won’t alter shipped CRDs.

---

Nitpick comments:
In `@bundle/manifests/lightspeed-operator.clusterserviceversion.yaml`:
- Around line 98-120: The Proposal example uses three agent names
(spec.analysis.agent "smart", spec.execution.agent "default",
spec.verification.agent "fast") but the alm-examples only defines the "default"
Agent; add Agent resources for the "smart" and "fast" agents to the alm-examples
array so the CSV is self-contained—create two additional objects with
"apiVersion": "agentic.openshift.io/v1alpha1", "kind": "Agent", metadata.name
"smart" and "fast" and include plausible spec fields matching the existing
"default" Agent example.
- Around line 212-229: The new agentic CRDs (kinds: Agent, AnalysisResult,
ApprovalPolicy, EscalationResult, ExecutionResult, LLMProvider, Proposal,
ProposalApproval, VerificationResult) in the CSV lack Console UI metadata; add
displayName and description and provide specDescriptors and statusDescriptors
blocks for each CRD in the CSV manifest to match the pattern used by OLSConfig
(use its displayName/description/specDescriptors/statusDescriptors as the
template), ensuring each field/attribute has a human-readable label,
description, and appropriate path/type so the OpenShift Console shows helpful UI
hints when creating or editing these resources.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a586078d-67d6-450b-a58e-79c925cfa358

📥 Commits

Reviewing files that changed from the base of the PR and between a4843f9 and 1241b5a.

⛔ Files ignored due to path filters (9)
  • config/crd/bases/agentic.openshift.io_agents.yaml is excluded by !config/crd/bases/**
  • config/crd/bases/agentic.openshift.io_analysisresults.yaml is excluded by !config/crd/bases/**
  • config/crd/bases/agentic.openshift.io_approvalpolicies.yaml is excluded by !config/crd/bases/**
  • config/crd/bases/agentic.openshift.io_escalationresults.yaml is excluded by !config/crd/bases/**
  • config/crd/bases/agentic.openshift.io_executionresults.yaml is excluded by !config/crd/bases/**
  • config/crd/bases/agentic.openshift.io_llmproviders.yaml is excluded by !config/crd/bases/**
  • config/crd/bases/agentic.openshift.io_proposalapprovals.yaml is excluded by !config/crd/bases/**
  • config/crd/bases/agentic.openshift.io_proposals.yaml is excluded by !config/crd/bases/**
  • config/crd/bases/agentic.openshift.io_verificationresults.yaml is excluded by !config/crd/bases/**
📒 Files selected for processing (25)
  • Makefile
  • README.md
  • bundle/manifests/agentic.openshift.io_agents.yaml
  • bundle/manifests/agentic.openshift.io_analysisresults.yaml
  • bundle/manifests/agentic.openshift.io_approvalpolicies.yaml
  • bundle/manifests/agentic.openshift.io_escalationresults.yaml
  • bundle/manifests/agentic.openshift.io_executionresults.yaml
  • bundle/manifests/agentic.openshift.io_llmproviders.yaml
  • bundle/manifests/agentic.openshift.io_proposalapprovals.yaml
  • bundle/manifests/agentic.openshift.io_proposals.yaml
  • bundle/manifests/agentic.openshift.io_verificationresults.yaml
  • bundle/manifests/lightspeed-operator.clusterserviceversion.yaml
  • config/crd/kustomization.yaml
  • config/manifests/bases/lightspeed-operator.clusterserviceversion.yaml
  • config/samples/agentic_v1alpha1_agent.yaml
  • config/samples/agentic_v1alpha1_analysisresult.yaml
  • config/samples/agentic_v1alpha1_approvalpolicy.yaml
  • config/samples/agentic_v1alpha1_escalationresult.yaml
  • config/samples/agentic_v1alpha1_executionresult.yaml
  • config/samples/agentic_v1alpha1_llmprovider.yaml
  • config/samples/agentic_v1alpha1_proposal.yaml
  • config/samples/agentic_v1alpha1_proposalapproval.yaml
  • config/samples/agentic_v1alpha1_verificationresult.yaml
  • config/samples/kustomization.yaml
  • hack/sync_agentic_crds.sh

Comment on lines +10 to +15
analysis:
agent: smart
execution:
agent: default
verification:
agent: fast
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Align referenced agent names with shipped sample agents.

On Line 11 and Line 15, smart and fast are referenced, while the provided sample flow context only defines default. This makes the sample workflow inconsistent and likely non-reproducible when applied as-is. Prefer using existing sample agent names (or add matching Agent samples).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@config/samples/agentic_v1alpha1_proposal.yaml` around lines 10 - 15, The
sample YAML references non-existent agents: update the analysis.agent and
verification.agent values (currently "smart" and "fast") to use the shipped
sample agent name "default" (matching execution.agent), or alternatively add
Agent sample definitions named "smart" and "fast" to the samples; locate the
keys analysis.agent and verification.agent in the proposal sample and either
change their values to "default" or add corresponding Agent resources with those
names.

Comment thread hack/sync_agentic_crds.sh
Comment thread hack/sync_agentic_crds.sh
Comment on lines +40 to +46
sed -i '/^- bases\/agentic\.openshift\.io_/d' "${KUSTOMIZATION}"
SCAFFOLD_LINE="#+kubebuilder:scaffold:crdkustomizeresource"
for f in "${DEST}"/agentic.openshift.io_*.yaml; do
[ -f "$f" ] || continue
ENTRY="- bases/$(basename "$f")"
sed -i "s|${SCAFFOLD_LINE}|${ENTRY}\n${SCAFFOLD_LINE}|" "${KUSTOMIZATION}"
done
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fail fast if scaffold markers are missing before rewrites.

If a scaffold marker is absent, the delete step still runs but reinsertion never occurs, leaving kustomization missing entries without a hard failure.

Suggested fix
 if [ -f "${KUSTOMIZATION}" ]; then
+    grep -q '^#+kubebuilder:scaffold:crdkustomizeresource$' "${KUSTOMIZATION}" || {
+        echo "ERROR: CRD scaffold marker missing in ${KUSTOMIZATION}" >&2
+        exit 1
+    }
     sed -i '/^- bases\/agentic\.openshift\.io_/d' "${KUSTOMIZATION}"
@@
 if [ -d "${SAMPLES_SRC}" ]; then
+    grep -q '^#+kubebuilder:scaffold:manifestskustomizesamples$' "${SAMPLES_KUSTOMIZATION}" || {
+        echo "ERROR: samples scaffold marker missing in ${SAMPLES_KUSTOMIZATION}" >&2
+        exit 1
+    }
     sed -i '/^- agentic_/d' "${SAMPLES_KUSTOMIZATION}" 2>/dev/null || true

Also applies to: 54-62

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hack/sync_agentic_crds.sh` around lines 40 - 46, The script currently deletes
and reinserts entries around the scaffold marker SCAFFOLD_LINE but doesn't
verify the marker exists, so removals can proceed without reinsertion; update
the logic that handles SCAFFOLD_LINE (and the analogous block later around lines
54-62) to first check that the marker string exists in the target file
referenced by KUSTOMIZATION (e.g., grep or a test on sed -n) and if not, echo a
clear error and exit non‑zero immediately (fail fast) before performing the
deletion/loop; ensure the check references the SCAFFOLD_LINE variable and the
same KUSTOMIZATION file and apply the same guard in both the first loop (for f
in "${DEST}"/agentic.openshift.io_*.yaml) and the second similar block so you
don’t proceed when scaffold markers are missing.

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.

sounds reasonable

Comment thread Makefile
VERSION ?= latest

AGENTIC_OPERATOR_REPO ?= https://github.com/openshift/lightspeed-agentic-operator
AGENTIC_OPERATOR_REF ?= main
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use an immutable default for AGENTIC_OPERATOR_REF.

Using main makes make bundle non-reproducible and allows unreviewed upstream changes to alter shipped CRDs over time.

Suggested fix
-AGENTIC_OPERATOR_REF ?= main
+# Pin to a released tag or commit SHA for reproducible syncs.
+AGENTIC_OPERATOR_REF ?= v0.1.0
📝 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
AGENTIC_OPERATOR_REF ?= main
# Pin to a released tag or commit SHA for reproducible syncs.
AGENTIC_OPERATOR_REF ?= v0.1.0
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` at line 9, AGENTIC_OPERATOR_REF is currently defaulting to the
mutable branch name "main"; change the Makefile so AGENTIC_OPERATOR_REF defaults
to an immutable release reference (e.g., a specific tag or commit hash) instead
of "main". Locate the AGENTIC_OPERATOR_REF variable in the Makefile and replace
the value "main" with a fixed tag or commit (or a clearly documented placeholder
like a stable version string) so running make bundle is reproducible and
upstream changes won’t alter shipped CRDs.

@raptorsun raptorsun force-pushed the agentic-crd branch 2 times, most recently from f2af5b6 to 4ec95f6 Compare June 4, 2026 16:18
Signed-off-by: Haoyu Sun <hasun@redhat.com>
@raptorsun
Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jun 4, 2026

@raptorsun: 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/bundle-e2e-4-21 2778fe5 link true /test bundle-e2e-4-21

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.

Copy link
Copy Markdown
Contributor

@onmete onmete left a comment

Choose a reason for hiding this comment

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

Review — OLS-3189

The core sync mechanism looks good — all 5 Jira ACs are met. One issue to address before merge:

Sample-sync logic references a directory that doesn't exist upstream

hack/sync_agentic_crds.sh lines 51-69 contain logic to sync samples from ${TMPDIR}/config/samples/agentic_*.yaml, but the lightspeed-agentic-operator repo has no config/samples/ directory (samples live under examples/setup/). The if [ -d "${SAMPLES_SRC}" ] guard makes this a silent no-op.

The 9 sample files in this PR were manually created, not synced — which contradicts the README statement "do not hand-edit the agentic CRD or sample files."

Options:

  1. Add a config/samples/ directory to lightspeed-agentic-operator so the sync actually works, or
  2. Remove the sample-sync logic from the script and drop the "don't hand-edit samples" claim from the README (acknowledge samples are manually maintained).

Either way, the current state is inconsistent — the script promises sample sync but can't deliver it.

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

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants