Skip to content

Conversation

ruivieira
Copy link
Member

@ruivieira ruivieira commented Jul 28, 2025

Description

ADR: opendatahub-io/architecture-decision-records#100

This PR adds TrustyAI configuration support to the DataScienceCluster (DSC) resource, enabling control of TrustyAI component settings directly through the DSC. This addresses the current limitation where TrustyAI configuration requires manual patching of operator ConfigMaps and operator re-deployment to change global (admin level) TrustyAI settings.

New Feature

The PR introduces a new configuration structure for TrustyAI in the DSC:

apiVersion: datasciencecluster.opendatahub.io/v1
kind: DataScienceCluster
spec:
  components:
    trustyai:
      managementState: Managed
      eval:
        lmeval:
          allowCodeExecution: true   # Controls code execution during evaluations
          allowOnline: false         # Controls network access during evaluations
      devFlags:
        manifests:
          - uri: "https://..."

Implementation Details

  1. New API Types: Added TrustyAIEvalSpec and TrustyAILMEvalSpec to support LMEval configuration
  2. Controller: Added createConfigMap action to the TrustyAI reconciliation chain
  3. ConfigMap: Automatically creates trustyai-dsc-config ConfigMap in the applications namespace
  4. Defaults: All configuration fields are properly initialised with defaults (false)
  5. Backward Compatibility: Existing TrustyAI deployments without DSC configuration continue to work

See RHOAIENG-30795.

How Has This Been Tested?

Unit Tests

  • Unit tests for the createConfigMap function
  • Verified ConfigMap creation, data mapping, and labels/annotations

Integration Testing

  • Tested the reconciliation from DSC to ConfigMap creation
  • Confirmed that the generated ConfigMap contains the expected configuration keys

Manual Testing

  • Applied DSC configuration with TrustyAI settings and verified ConfigMap creation

Code Generation

  • Verified that make generate produces correct CRDs with the new configuration schema
  • Confirmed that both TrustyAI and DSC CRDs include the new configuration fields

Screenshot or short clip

N/A

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

Testing Instructions

Testing Instructions

To test this new TrustyAI configuration feature:

  1. Build and deploy the operator:

    cd opendatahub-operator
    make generate
    make build
    make image-build
    make deploy IMG=quay.io/ruimvieira/opendatahub-operator:dev-2.33.0
  2. Create DSCInitialization:

    apiVersion: dscinitialization.opendatahub.io/v1
    kind: DSCInitialization
    metadata:
      name: default-dsci
    spec:
      applicationsNamespace: opendatahub
      monitoring:
        managementState: Managed
      serviceMesh:
        managementState: Managed
      trustedCABundle:
        managementState: Managed
  3. Apply DSC with TrustyAI configuration:

    apiVersion: datasciencecluster.opendatahub.io/v1
    kind: DataScienceCluster
    metadata:
      name: default-dsc
    spec:
      components:
        modelmeshserving:
          managementState: Managed
        trustyai:
          managementState: Managed
          eval:
            lmeval:
              allowCodeExecution: true
              allowOnline: false
  4. Verify the configuration:

    # Check ConfigMap creation
    kubectl get configmap trustyai-dsc-config -n opendatahub -o yaml
    
    # Verify configuration values
    kubectl get configmap trustyai-dsc-config -n opendatahub -o jsonpath='{.data.eval\.lmeval\.allowCodeExecution}'
    kubectl get configmap trustyai-dsc-config -n opendatahub -o jsonpath='{.data.eval\.lmeval\.allowOnline}'
  5. Test configuration updates:

    kubectl patch dsc default-dsc --type='merge' -p='{"spec":{"components":{"trustyai":{"eval":{"lmeval":{"allowOnline":true}}}}}}'
    kubectl get configmap trustyai-dsc-config -n opendatahub -o jsonpath='{.data.eval\.lmeval\.allowOnline}'

Summary by CodeRabbit

  • New Features

    • Added evaluation configuration for TrustyAI (LM evaluation) with options to permit code execution and online access; applied via cluster configuration and an auto-created ConfigMap.
  • Documentation

    • Updated API docs and CRD schemas to include new eval/lmeval fields and their defaults.
  • Tests

    • Added tests to validate ConfigMap creation for full, partial, and default evaluation settings.

Copy link

openshift-ci bot commented Jul 28, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link

openshift-ci bot commented Jul 28, 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 carlkyrillos for approval. For more information see the Code Review Process.

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

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 bot commented Jul 28, 2025

Walkthrough

Adds an optional eval configuration to TrustyAI: new API types and deep-copy methods, CRD schema and docs updates, controller action to create a ConfigMap from spec.eval values, and unit tests validating ConfigMap generation. All changes are additive.

Changes

Cohort / File(s) Change Summary
API types & spec
api/components/v1alpha1/trustyai_types.go
Adds TrustyAIEvalSpec and TrustyAILMEvalSpec structs; extends TrustyAICommonSpec with optional Eval field.
DeepCopy methods
api/components/v1alpha1/zz_generated.deepcopy.go
Adds autogenerated DeepCopyInto/DeepCopy for TrustyAIEvalSpec and TrustyAILMEvalSpec; updates TrustyAICommonSpec.DeepCopyInto to copy Eval.
TrustyAI CRD
config/crd/bases/components.platform.opendatahub.io_trustyais.yaml
Extends TrustyAI CRD schema with optional spec.eval.lmeval containing permitCodeExecution and permitOnline booleans (default: false).
DataScienceCluster CRD
config/crd/bases/datasciencecluster.opendatahub.io_datascienceclusters.yaml
Adds optional trustyai.eval.lmeval schema with permitCodeExecution and permitOnline booleans (default: false) to DataScienceCluster component config.
Docs
docs/api-overview.md
Documents new eval field and TrustyAIEvalSpec / TrustyAILMEvalSpec types across TrustyAI specs, statuses, and lists.
Controller flow
internal/controller/components/trustyai/trustyai_controller.go
Inserts new reconciliation action createConfigMap after devFlags and before releases action in TrustyAI reconciler sequence.
ConfigMap creation
internal/controller/components/trustyai/trustyai_controller_actions.go
Adds createConfigMap(ctx, rr) which builds a trustyai-dsc-config ConfigMap in the DSC applications namespace with keys eval.lmeval.permitCodeExecution and eval.lmeval.permitOnline derived from CR.
Tests
internal/controller/components/trustyai/trustyai_test.go
Adds TestCreateConfigMap (full/none/partial scenarios), test helpers to create DSCI and TrustyAI CRs, and assertions verifying ConfigMap presence and data values; updates imports/usages.

Sequence Diagram(s)

sequenceDiagram
    rect rgb(240,248,255)
    participant Reconciler
    participant TrustyAI_CR as TrustyAI CR
    participant DSC as DSCInit (namespace)
    participant K8s as ConfigMap (K8s)
    end
    Note over Reconciler,TrustyAI_CR: Reconciliation run for TrustyAI component
    Reconciler->>TrustyAI_CR: Read spec.eval.lmeval.permitCodeExecution\nand spec.eval.lmeval.permitOnline
    alt eval present or defaults
        Reconciler->>DSC: Determine ApplicationsNamespace
        Reconciler->>K8s: Create/Update `trustyai-dsc-config`\nset data keys "eval.lmeval.permitCodeExecution" and "eval.lmeval.permitOnline"
        K8s-->>Reconciler: ACK / Created
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly describes the primary feature addition—configuration support for TrustyAI in the DataScienceCluster (DSC) component—which aligns directly with the main changes in the pull request. It follows the conventional “feat” prefix and issue key format used by the team, making it contextually clear. The phrasing is concise and avoids unnecessary details while conveying the essential purpose of the update. This clarity ensures that anyone scanning the project history will immediately grasp the core intent of the changes.

Poem

A rabbit nibbled bytes and spec,
Added eval where flags connect.
ConfigMaps sprout in namespace rows,
Tests hop in to check the shows.
Small changes, tidy—off it goes! 🐇✨

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5c4f5e5 and b9915f8.

📒 Files selected for processing (1)
  • internal/controller/components/trustyai/trustyai_test.go (8 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/controller/components/trustyai/trustyai_test.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build/push catalog image
  • GitHub Check: golangci-lint
  • GitHub Check: Run tests and collect coverage on internal and pkg
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@ruivieira ruivieira marked this pull request as ready for review July 28, 2025 21:58
@ruivieira ruivieira changed the title feat(RHOAIENG-30795): Add configuration support to TrustyAI DSC component [WIP] feat(RHOAIENG-30795): Add configuration support to TrustyAI DSC component Jul 28, 2025
Copy link
Contributor

This PR can't be merged just yet 😢

Please run make generate manifests api-docs and commit the changes.

For more info: https://github.com/opendatahub-io/opendatahub-operator/actions/runs/16581270657

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: 0

🧹 Nitpick comments (4)
docs/api-overview.md (3)

560-563: Clarify optionality & defaults for the new eval field

Please state explicitly that the eval block is optional and that, when omitted, all nested flags default to false. This matches the controller logic and avoids any ambiguity for API consumers.


2004-2008: Duplicate description – keep one authoritative source

eval is documented both here (TrustyAICommonSpec) and in DSCTrustyAI. If you keep both, make sure the wording is identical; otherwise delete the duplicate to avoid drift.


2027-2060: Provide a concrete YAML example for the new structs

Readers benefit from a minimal YAML snippet illustrating correct usage:

spec:
  trustyai:
    eval:
      lmeval:
        allowCodeExecution: true
        allowOnline: false

Adding this right after the tables will greatly improve discoverability.

internal/controller/components/trustyai/trustyai_test.go (1)

95-200: Consider adding test for ConfigMap updates.

While the current tests cover creation scenarios well, consider adding a test case that verifies ConfigMap updates when the configuration changes. This would ensure the reconciliation logic handles updates correctly.

Here's an example test case to add:

t.Run("should update ConfigMap when configuration changes", func(t *testing.T) {
    g := NewWithT(t)
    ctx := context.Background()

    // Create initial ConfigMap
    trustyai := createTrustyAICRWithConfig(true, false)
    dsc := createDSCWithTrustyAI(operatorv1.Managed)
    dsciObj := createDSCI("test-namespace")

    cli, err := fakeclient.New(fakeclient.WithObjects(dsc, dsciObj))
    g.Expect(err).ShouldNot(HaveOccurred())

    rr := &types.ReconciliationRequest{
        Client:   cli,
        Instance: trustyai,
        DSCI:     dsciObj,
    }

    err = createConfigMap(ctx, rr)
    g.Expect(err).ShouldNot(HaveOccurred())

    // Update configuration
    trustyai.Spec.Eval.LMEval.AllowOnline = &[]bool{true}[0]
    rr.Instance = trustyai

    err = createConfigMap(ctx, rr)
    g.Expect(err).ShouldNot(HaveOccurred())

    // Verify ConfigMap was updated
    configMap := &corev1.ConfigMap{}
    err = cli.Get(ctx, client.ObjectKey{
        Name:      "trustyai-dsc-config",
        Namespace: "test-namespace",
    }, configMap)
    g.Expect(err).ShouldNot(HaveOccurred())
    g.Expect(configMap.Data["eval.lmeval.allowOnline"]).Should(Equal("true"))
})
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between acac94d and bf26f04.

📒 Files selected for processing (8)
  • api/components/v1alpha1/trustyai_types.go (1 hunks)
  • api/components/v1alpha1/zz_generated.deepcopy.go (2 hunks)
  • config/crd/bases/components.platform.opendatahub.io_trustyais.yaml (1 hunks)
  • config/crd/bases/datasciencecluster.opendatahub.io_datascienceclusters.yaml (1 hunks)
  • docs/api-overview.md (4 hunks)
  • internal/controller/components/trustyai/trustyai_controller.go (1 hunks)
  • internal/controller/components/trustyai/trustyai_controller_actions.go (3 hunks)
  • internal/controller/components/trustyai/trustyai_test.go (4 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
api/components/v1alpha1/trustyai_types.go (1)
api/common/types.go (1)
  • DevFlagsSpec (36-40)
api/components/v1alpha1/zz_generated.deepcopy.go (1)
api/components/v1alpha1/trustyai_types.go (2)
  • TrustyAIEvalSpec (58-61)
  • TrustyAILMEvalSpec (64-71)
internal/controller/components/trustyai/trustyai_controller_actions.go (4)
pkg/controller/types/types.go (1)
  • ReconciliationRequest (75-112)
api/components/v1alpha1/trustyai_types.go (1)
  • TrustyAI (44-50)
pkg/cluster/gvk/gvk.go (1)
  • Namespace (24-28)
pkg/metadata/labels/types.go (3)
  • ODH (26-34)
  • True (12-12)
  • K8SCommon (19-23)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build/push catalog image
  • GitHub Check: golangci-lint
  • GitHub Check: Run tests and collect coverage on internal and pkg
🔇 Additional comments (14)
internal/controller/components/trustyai/trustyai_controller.go (1)

71-71: LGTM! Clean integration of ConfigMap creation action.

The new createConfigMap action is appropriately positioned in the reconciliation chain after devFlags and before releases.NewAction(), ensuring configuration is established at the right stage of the reconciliation process.

config/crd/bases/components.platform.opendatahub.io_trustyais.yaml (1)

77-94: LGTM! Well-structured CRD schema extension.

The new eval field and nested lmeval configuration are properly defined with:

  • Clear descriptions for all fields
  • Appropriate default values (false for security-sensitive settings)
  • Consistent naming conventions
  • Extensible structure for future evaluation configurations
config/crd/bases/datasciencecluster.opendatahub.io_datascienceclusters.yaml (1)

738-755: LGTM! Consistent schema extension across CRDs.

The eval field structure in the DataScienceCluster CRD correctly mirrors the TrustyAI component CRD schema, maintaining API consistency. The placement within the trustyai component configuration section is appropriate.

api/components/v1alpha1/trustyai_types.go (1)

57-77: LGTM! Well-designed API type definitions.

The new evaluation configuration types are properly structured:

  • Pointer types (*bool) enable differentiation between unset and false values
  • Kubebuilder default annotations align with CRD schema
  • Extensible design allows for future evaluation configuration types
  • Integration into TrustyAICommonSpec makes configuration accessible at both component and DSC levels
internal/controller/components/trustyai/trustyai_controller_actions.go (1)

81-127: LGTM! Well-implemented ConfigMap creation function.

The createConfigMap function demonstrates good practices:

  • Proper type assertion with error handling
  • Efficient early return when no configuration is specified
  • Well-structured ConfigMap with appropriate labels and annotations
  • Conditional data population only for non-nil configuration values
  • Correct use of client.Apply with ForceOwnership for idempotent operations

The hierarchical data key format (eval.lmeval.allowCodeExecution) provides clear configuration structure.

api/components/v1alpha1/zz_generated.deepcopy.go (3)

2138-2138: LGTM! Proper deep copy implementation for new Eval field.

The addition of in.Eval.DeepCopyInto(&out.Eval) correctly ensures the new evaluation configuration field is deep copied when TrustyAICommonSpec is copied.


2167-2181: LGTM! Standard deep copy implementation for TrustyAIEvalSpec.

The deep copy methods correctly implement the Kubernetes pattern, ensuring the nested LMEval field is recursively deep copied and proper nil handling is in place.


2183-2206: LGTM! Correct deep copy implementation for pointer fields.

The deep copy methods properly handle the optional boolean pointer fields (AllowCodeExecution and AllowOnline) with appropriate nil checks and pointer allocation, following Kubernetes deep copy best practices.

internal/controller/components/trustyai/trustyai_test.go (6)

11-11: LGTM! Appropriate imports added for the new test functionality.

The new imports are correctly added to support the ConfigMap testing functionality:

  • corev1 for ConfigMap API objects
  • client for client operations in tests
  • dsci for DSCInitialization resources

Also applies to: 13-13, 18-18


95-135: Comprehensive test coverage for ConfigMap creation with full configuration.

The test properly validates:

  • ConfigMap creation with both evaluation settings
  • Correct data mapping to dot-notation keys
  • Proper labels and annotations for component identification
  • Error handling for successful operations

The test structure is well-organized and follows good testing practices.


137-165: Good test coverage for the no-configuration scenario.

The test correctly verifies that when no evaluation configuration is provided, the ConfigMap is not created, which aligns with the expected behavior of skipping ConfigMap creation when there's nothing to configure.


167-200: Excellent test for partial configuration handling.

This test validates an important edge case where only some configuration fields are set. The assertion on line 198 correctly checks for an empty string rather than checking for absence, which is appropriate for ConfigMap data fields.


300-306: Well-designed helper function for DSCI creation.

The createDSCI helper function is clean and focused, properly setting up a DSCInitialization object with the necessary fields for testing.


332-343: Helper functions provide good test data setup.

Both createTrustyAICRWithConfig and createTrustyAICRWithPartialConfig are well-designed:

  • They reuse the existing createTrustyAICR function for consistency
  • They properly set pointer fields for the evaluation configuration
  • They handle both full and partial configuration scenarios appropriately

@zdtsw
Copy link
Member

zdtsw commented Jul 29, 2025

is this planned for 2.24?

@zdtsw
Copy link
Member

zdtsw commented Jul 31, 2025

according to refinement doc, the new field need rename to permitCodeExecution and permitOnline, right?

@zdtsw zdtsw added the odh-2.33 label Aug 4, 2025
@ruivieira ruivieira marked this pull request as draft August 8, 2025 15:56
@ruivieira ruivieira marked this pull request as ready for review September 9, 2025 22:16
@ruivieira ruivieira changed the title [WIP] feat(RHOAIENG-30795): Add configuration support to TrustyAI DSC component feat(RHOAIENG-30795): Add configuration support to TrustyAI DSC component Sep 9, 2025
@ruivieira
Copy link
Member Author

cc @lburgazzoli can re-request a review? thanks!

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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
internal/controller/components/trustyai/trustyai_test.go (2)

4-12: Missing import for context package (build break).

context.Background() is used but "context" isn’t imported.

Apply this diff to add the import:

 import (
+	"context"
 	"encoding/json"
 	"testing"

295-301: Replace wrong alias in trustyai_test.go
Change types.ReconciliationRequest to odhtypes.ReconciliationRequest to match the import.

--- a/internal/controller/components/trustyai/trustyai_test.go
+++ b/internal/controller/components/trustyai/trustyai_test.go
@@ -295,7 +295,7 @@
-	cs, err := handler.UpdateDSCStatus(ctx, &types.ReconciliationRequest{
+	cs, err := handler.UpdateDSCStatus(ctx, &odhtypes.ReconciliationRequest{
 		Client:     cli,
 		Instance:   dsc,
 		Conditions: conditions.NewManager(dsc, ReadyConditionType),

</blockquote></details>

</blockquote></details>
🧹 Nitpick comments (2)
internal/controller/components/trustyai/trustyai_test.go (2)

93-198: Strengthen ConfigMap tests; prefer t.Context() and assert GVK/metadata.

  • Use t.Context() (available in recent Go) for consistency with other subtests and automatic cancellation.
  • Also assert Kind/APIVersion and (if set by createConfigMap) expected labels/annotations to guard regressions.

Apply this diff to switch to t.Context():

-		ctx := context.Background()
+		ctx := t.Context()
@@
-		ctx := context.Background()
+		ctx := t.Context()
@@
-		ctx := context.Background()
+		ctx := t.Context()

Optionally extend assertions (example):

 		configMapResource := rr.Resources[0]
 		g.Expect(configMapResource.GetName()).Should(Equal("trustyai-dsc-config"))
 		g.Expect(configMapResource.GetNamespace()).Should(Equal("test-namespace"))
+		g.Expect(configMapResource.GetKind()).Should(Equal("ConfigMap"))
+		g.Expect(configMapResource.GetAPIVersion()).Should(Equal("v1"))
+		// If labels/annotations are set by createConfigMap, assert them too:
+		// g.Expect(configMapResource.GetLabels()["app.kubernetes.io/managed-by"]).Should(Equal("opendatahub-operator"))

358-369: Align helper param names with new API (“permit”).*

Rename allowCodeExecution param to permitCodeExecution for consistency with fields and test keys.

Apply this diff:

-func createTrustyAICRWithPartialConfig(allowCodeExecution bool) *componentApi.TrustyAI {
+func createTrustyAICRWithPartialConfig(permitCodeExecution bool) *componentApi.TrustyAI {
 	c := createTrustyAICR(true)
-	c.Spec.Eval.LMEval.PermitCodeExecution = allowCodeExecution
+	c.Spec.Eval.LMEval.PermitCodeExecution = permitCodeExecution
 	return c
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5c04a30 and 5c4f5e5.

📒 Files selected for processing (4)
  • config/crd/bases/components.platform.opendatahub.io_trustyais.yaml (1 hunks)
  • config/crd/bases/datasciencecluster.opendatahub.io_datascienceclusters.yaml (1 hunks)
  • docs/api-overview.md (4 hunks)
  • internal/controller/components/trustyai/trustyai_test.go (7 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • config/crd/bases/components.platform.opendatahub.io_trustyais.yaml
  • config/crd/bases/datasciencecluster.opendatahub.io_datascienceclusters.yaml
  • docs/api-overview.md
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-26T07:45:31.294Z
Learnt from: lburgazzoli
PR: opendatahub-io/opendatahub-operator#2010
File: internal/controller/services/servicemesh/servicemesh_controller_actions.go:308-318
Timestamp: 2025-08-26T07:45:31.294Z
Learning: In the opendatahub-operator reconciliation framework, the DSCI (DSCInitialization) field in ReconciliationRequest is guaranteed to be non-nil when action functions are executed. The reconciler fetches DSCI via cluster.GetDSCI() and sets rr.DSCI = dsci.DeepCopy() before executing any actions, so nil guards for rr.DSCI are unnecessary in ServiceMesh controller action functions.

Applied to files:

  • internal/controller/components/trustyai/trustyai_test.go
📚 Learning: 2025-08-26T07:45:31.294Z
Learnt from: lburgazzoli
PR: opendatahub-io/opendatahub-operator#2010
File: internal/controller/services/servicemesh/servicemesh_controller_actions.go:308-318
Timestamp: 2025-08-26T07:45:31.294Z
Learning: In the opendatahub-operator reconciliation framework, the DSCI (DSCInitialization) field in ReconciliationRequest is guaranteed to be non-nil when used in ServiceMesh controller actions. The reconciler ensures DSCI is populated before invoking action functions, so nil guards for rr.DSCI are unnecessary in this context.

Applied to files:

  • internal/controller/components/trustyai/trustyai_test.go
🧬 Code graph analysis (1)
internal/controller/components/trustyai/trustyai_test.go (2)
pkg/utils/test/fakeclient/fakeclient.go (1)
  • WithObjects (30-34)
pkg/controller/types/types.go (1)
  • ReconciliationRequest (75-112)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Build/push catalog image
  • GitHub Check: Run tests and collect coverage on tests/integration
  • GitHub Check: Run tests and collect coverage on internal and pkg
  • GitHub Check: golangci-lint
🔇 Additional comments (4)
internal/controller/components/trustyai/trustyai_test.go (4)

213-218: Alias switch to odhtypes is correct.

Good migration to odhtypes.ReconciliationRequest.


241-246: Alias switch to odhtypes is correct.

Consistent with the updated import.


268-273: Alias switch to odhtypes is correct.

Consistent usage across tests.


326-333: Helper to create DSCI looks good.

Correct GVK and namespace wiring; keeps tests focused.

Copy link

openshift-ci bot commented Sep 10, 2025

@ruivieira: 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/opendatahub-operator-e2e b9915f8 link true /test opendatahub-operator-e2e

Full PR test history. Your PR dashboard.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

3 participants