Skip to content

Conversation

zdtsw
Copy link
Member

@zdtsw zdtsw commented Jun 5, 2025

  • we init. added LegacyCmponentName when we rename componentName
  • for backwards compatibility, we use Legacy name so the immutiable part in deployment will work
  • for these components, esp newly added one, there is no need to have two variable if componentName is enough
  • also fix the one on kserve, which is copied from modelserving probably

Description

How Has This Been Tested?

Screenshot or short clip

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

Summary by CodeRabbit

  • Refactor
    • Updated all components to use current component names for status reporting and resource labeling, removing legacy component name references.
    • Improved consistency in how components are identified and managed across the platform.
  • Chores
    • Removed deprecated legacy component name constants from internal files.

…wo names

- we init. added LegacyCmponentName when we rename componentName
- for backwards compatibility, we use Legacy name so the immutiable part in deployment will work
- for these components, esp newly added one, there is no need to have two variable if componentName is enough

Signed-off-by: Wen Zhou <[email protected]>
Copy link

coderabbitai bot commented Jun 5, 2025

Walkthrough

This update removes all references to legacy component name constants across multiple controller components, replacing them with the current component name constants. The changes affect status updates, label selectors, and resource labeling in reconciliation logic. Associated legacy constants and comments are deleted from support files, with no changes to public APIs or exported function signatures.

Changes

Files (grouped) Change Summary
.../codeflare/codeflare.go
.../kserve/kserve.go
.../kueue/kueue.go
.../ray/ray.go
.../trainingoperator/trainingoperator.go
.../trustyai/trustyai.go
.../workbenches/workbenches.go
Replaced LegacyComponentName with ComponentName in status updates for installed components.
.../codeflare/codeflare_controller.go
.../kserve/kserve_controller.go
.../kueue/kueue_controller.go
.../ray/ray_controller.go
.../trainingoperator/trainingoperator_controller.go
.../trustyai/trustyai_controller.go
.../workbenches/workbenches_controller.go
Updated label selectors and kustomize action labels to use ComponentName instead of legacy names.
.../codeflare/codeflare_support.go
.../kueue/kueue_support.go
.../ray/ray_support.go
.../trainingoperator/trainingoperator_support.go
.../trustyai/trustyai_support.go
.../workbenches/workbenches_support.go
Removed LegacyComponentName constants and related comments.
.../kserve/kserve.go Removed LegacyComponentName constant and replaced its usage with componentName in status update.
.../kserve/kserve_controller_actions.go Narrowed manifest URI filter to only check for componentName, removing legacy check.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Controller
    participant Kustomize
    participant Cluster

    User->>Controller: Initiate reconciliation
    Controller->>Kustomize: Render manifests with labels (ComponentName)
    Kustomize->>Controller: Return rendered resources
    Controller->>Cluster: Apply resources with labels (ComponentName)
    Controller->>Cluster: Update status using ComponentName
    Cluster-->>Controller: Status updated
Loading

Suggested labels

lgtm, approved

Suggested reviewers

  • ugiordan
  • lburgazzoli

Poem

In the warren of code, old names retire,
New constants hop in, as the teams require.
Labels are fresh, the legacy gone,
Controllers all cheer, for the naming is strong.
The garden is tidy, the carrots aligned—
This bunny approves what the devs have designed! 🥕

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (1.64.8)

Error: you are using a configuration file for golangci-lint v2 with golangci-lint v1: please use golangci-lint v2
Failed executing command with error: you are using a configuration file for golangci-lint v2 with golangci-lint v1: please use golangci-lint v2


📜 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 f67206f and 61ca8b6.

📒 Files selected for processing (7)
  • internal/controller/components/codeflare/codeflare_controller.go (1 hunks)
  • internal/controller/components/kserve/kserve_controller.go (2 hunks)
  • internal/controller/components/kueue/kueue_controller.go (1 hunks)
  • internal/controller/components/ray/ray_controller.go (1 hunks)
  • internal/controller/components/trainingoperator/trainingoperator_controller.go (1 hunks)
  • internal/controller/components/trustyai/trustyai_controller.go (2 hunks)
  • internal/controller/components/workbenches/workbenches_controller.go (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • internal/controller/components/codeflare/codeflare_controller.go
🚧 Files skipped from review as they are similar to previous changes (6)
  • internal/controller/components/ray/ray_controller.go
  • internal/controller/components/kserve/kserve_controller.go
  • internal/controller/components/kueue/kueue_controller.go
  • internal/controller/components/workbenches/workbenches_controller.go
  • internal/controller/components/trustyai/trustyai_controller.go
  • internal/controller/components/trainingoperator/trainingoperator_controller.go
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: golangci-lint
  • GitHub Check: Run tests and collect coverage
✨ Finishing Touches
  • 📝 Generate Docstrings

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 openshift-ci bot requested review from asanzgom and valdar June 5, 2025 15:43
Copy link

openshift-ci bot commented Jun 5, 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 steventobin 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 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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b08881f and f67206f.

📒 Files selected for processing (21)
  • internal/controller/components/codeflare/codeflare.go (1 hunks)
  • internal/controller/components/codeflare/codeflare_controller.go (1 hunks)
  • internal/controller/components/codeflare/codeflare_support.go (0 hunks)
  • internal/controller/components/kserve/kserve.go (1 hunks)
  • internal/controller/components/kserve/kserve_controller.go (2 hunks)
  • internal/controller/components/kserve/kserve_controller_actions.go (1 hunks)
  • internal/controller/components/kueue/kueue.go (1 hunks)
  • internal/controller/components/kueue/kueue_controller.go (1 hunks)
  • internal/controller/components/kueue/kueue_support.go (0 hunks)
  • internal/controller/components/ray/ray.go (1 hunks)
  • internal/controller/components/ray/ray_controller.go (1 hunks)
  • internal/controller/components/ray/ray_support.go (0 hunks)
  • internal/controller/components/trainingoperator/trainingoperator.go (1 hunks)
  • internal/controller/components/trainingoperator/trainingoperator_controller.go (1 hunks)
  • internal/controller/components/trainingoperator/trainingoperator_support.go (0 hunks)
  • internal/controller/components/trustyai/trustyai.go (1 hunks)
  • internal/controller/components/trustyai/trustyai_controller.go (2 hunks)
  • internal/controller/components/trustyai/trustyai_support.go (0 hunks)
  • internal/controller/components/workbenches/workbenches.go (1 hunks)
  • internal/controller/components/workbenches/workbenches_controller.go (2 hunks)
  • internal/controller/components/workbenches/workbenches_support.go (0 hunks)
💤 Files with no reviewable changes (6)
  • internal/controller/components/workbenches/workbenches_support.go
  • internal/controller/components/trustyai/trustyai_support.go
  • internal/controller/components/trainingoperator/trainingoperator_support.go
  • internal/controller/components/kueue/kueue_support.go
  • internal/controller/components/ray/ray_support.go
  • internal/controller/components/codeflare/codeflare_support.go
🧰 Additional context used
🧬 Code Graph Analysis (9)
internal/controller/components/trainingoperator/trainingoperator_controller.go (3)
pkg/controller/predicates/component/component.go (1)
  • ForLabel (10-22)
pkg/metadata/labels/types.go (3)
  • ODH (26-34)
  • True (12-12)
  • K8SCommon (19-23)
internal/controller/components/trainingoperator/trainingoperator_support.go (1)
  • ComponentName (11-11)
internal/controller/components/trustyai/trustyai.go (2)
api/common/types.go (1)
  • Status (132-140)
internal/controller/components/trustyai/trustyai_support.go (2)
  • ComponentName (13-13)
  • ReadyConditionType (15-15)
internal/controller/components/trainingoperator/trainingoperator.go (1)
internal/controller/components/trainingoperator/trainingoperator_support.go (2)
  • ComponentName (11-11)
  • ReadyConditionType (13-13)
internal/controller/components/kueue/kueue.go (1)
internal/controller/components/kueue/kueue_support.go (2)
  • ComponentName (11-11)
  • ReadyConditionType (13-13)
internal/controller/components/kserve/kserve_controller.go (3)
pkg/controller/predicates/component/component.go (1)
  • ForLabel (10-22)
pkg/metadata/labels/types.go (3)
  • ODH (26-34)
  • True (12-12)
  • K8SCommon (19-23)
internal/controller/services/certconfigmapgenerator/certconfigmapgenerator_support.go (1)
  • PartOf (29-29)
internal/controller/components/workbenches/workbenches.go (2)
internal/controller/components/workbenches/workbenches_support.go (2)
  • ComponentName (13-13)
  • ReadyConditionType (15-15)
api/components/v1alpha1/workbenches_types.go (1)
  • WorkbenchesCommonStatus (56-59)
internal/controller/components/trustyai/trustyai_controller.go (3)
pkg/controller/predicates/component/component.go (1)
  • ForLabel (10-22)
pkg/metadata/labels/types.go (3)
  • ODH (26-34)
  • True (12-12)
  • K8SCommon (19-23)
internal/controller/components/trustyai/trustyai_support.go (1)
  • ComponentName (13-13)
internal/controller/components/kueue/kueue_controller.go (3)
pkg/controller/predicates/component/component.go (1)
  • ForLabel (10-22)
pkg/metadata/labels/types.go (3)
  • ODH (26-34)
  • True (12-12)
  • K8SCommon (19-23)
internal/controller/components/kueue/kueue_support.go (1)
  • ComponentName (11-11)
internal/controller/components/codeflare/codeflare.go (1)
internal/controller/components/codeflare/codeflare_support.go (2)
  • ComponentName (13-13)
  • ReadyConditionType (15-15)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Run tests and collect coverage
  • GitHub Check: golangci-lint
🔇 Additional comments (19)
internal/controller/components/trainingoperator/trainingoperator.go (2)

81-81: Replace legacy component name with current ComponentName for status reset
The initial reset now correctly uses the ComponentName constant instead of the removed legacy name.


89-89: Replace legacy component name with current ComponentName when marked managed
Marking the component installed state now uses ComponentName, ensuring consistency with the other status updates.

internal/controller/components/trainingoperator/trainingoperator_controller.go (2)

56-56: Update predicate to use current ComponentName label
The watch predicate now filters on labels.ODH.Component(ComponentName) instead of the legacy constant, aligning with the simplified naming convention.


63-64: Apply current ComponentName in kustomize labels
Rendering action now labels resources with ODH.Component(ComponentName) and K8SCommon.PartOf set to ComponentName, replacing the previous legacy labels.

internal/controller/components/codeflare/codeflare.go (1)

82-82: LGTM! Consistent replacement of legacy component name.

The changes correctly replace LegacyComponentName with ComponentName in the status updates. The logic remains sound - initially marking the component as not installed, then conditionally marking it as installed based on management state.

Also applies to: 90-90

internal/controller/components/codeflare/codeflare_controller.go (1)

64-64: LGTM! Controller setup consistently updated.

The changes correctly update the controller reconciliation setup to use ComponentName instead of LegacyComponentName in:

  • CRD watch predicates (line 64)
  • Kustomize action labels (lines 71-72)

This maintains consistency in component identification throughout the reconciliation logic.

Also applies to: 71-72

internal/controller/components/kueue/kueue_controller.go (2)

82-82: LGTM: Correctly updated component label selector.

The change from LegacyComponentName to ComponentName in the CustomResourceDefinition watch predicate is correct and aligns with the PR objective of removing unnecessary dual naming conventions.


90-91: LGTM: Consistently updated kustomize action labels.

Both label assignments correctly use ComponentName instead of LegacyComponentName for:

  • ODH component labeling (labels.ODH.Component(ComponentName))
  • Kubernetes part-of labeling (labels.K8SCommon.PartOf, ComponentName)

This ensures consistent resource labeling across the kueue component.

internal/controller/components/kueue/kueue.go (2)

82-82: LGTM: Correctly updated status tracking.

The change from LegacyComponentName to ComponentName in the status initialization is correct and maintains the same functionality while using the current component naming convention.


90-90: LGTM: Status update properly aligned with component naming.

The change to use ComponentName for setting the installed component status when management state is Managed is correct and consistent with the initialization on line 82.

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

84-84: LGTM: Consistent replacement of legacy component name in status updates.

The changes correctly replace LegacyComponentName with ComponentName in the InstalledComponents status map, ensuring consistent use of the current component name throughout the status management logic.

Also applies to: 92-92

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

59-59: LGTM: Consistent component naming in reconciler setup.

The changes correctly update the reconciler configuration to use ComponentName instead of LegacyComponentName in:

  • Label predicates for CRD event filtering (line 59)
  • Kustomize action labels for both ODH component and K8S part-of labels (lines 74-75)

This ensures consistent component naming throughout the controller's event handling and resource management.

Also applies to: 74-75

internal/controller/components/workbenches/workbenches.go (1)

92-92: LGTM! Status reporting key updated from legacy to current component name.

The changes correctly replace LegacyComponentName with ComponentName in the status map operations, aligning with the PR objective to simplify naming conventions for components that don't require dual naming.

Also applies to: 100-100

internal/controller/components/workbenches/workbenches_controller.go (1)

62-62:

❓ Verification inconclusive

LGTM! Controller resource selection updated to use current component name.

The changes correctly replace LegacyComponentName with ComponentName in:

  • Label predicate for watching CustomResourceDefinitions (line 62)
  • Kustomize action labels for resource management (lines 73-74)

This ensures the controller now targets and manages resources labeled with the current component name, consistent with the PR objective.

Verify that existing workbench resources in deployed environments use the current component name labels, or ensure proper migration if needed:

Also applies to: 73-74


🏁 Script executed:

#!/bin/bash
# Description: Check for resources labeled with workbenches component names
# Expected: Resources should be labeled with current component name, not legacy

# Search for workbenches-related label usage in manifests
rg -A 2 -B 2 "app\.opendatahub\.io/component.*workbenches" 

# Look for any legacy component name usage that might have been missed
rg -i "legacy.*workbenches|workbenches.*legacy"

Length of output: 110


Verify workbenches component labels in deployed environments

The update correctly replaces LegacyComponentName with ComponentName in:

  • Label predicate for watching CRDs (line 62)
  • Kustomize action labels for resource management (lines 73–74)

However, our search did not find any occurrences of either the current or legacy workbenches labels in the repository manifests. To avoid disruption, please manually verify that existing workbench resources in your clusters are labeled correctly or have been migrated. For example:

# Check for current workbenches label on CRDs
kubectl get customresourcedefinitions \
  -l app.opendatahub.io/component=workbenches \
  --show-labels

# Check for any remaining legacy workbenches labels
kubectl get customresourcedefinitions \
  -l app.opendatahub.io/component=legacy-workbenches \
  --show-labels
internal/controller/components/kserve/kserve_controller_actions.go (1)

119-119:

✅ Verification successful

Verify that no dev flag manifests use the legacy component name.

The filtering condition now only checks for componentName in manifest URIs, removing the previous check for LegacyComponentName. Ensure that all existing dev flag manifests have been updated to use the current component name in their URIs.


🏁 Script executed:

#!/bin/bash
# Description: Search for any manifest files or configurations that might still reference the legacy Kserve component name
# Expected: No references to legacy component names in manifest URIs or dev flag configurations

# Search for potential legacy component name patterns in manifest files
rg -i "kserve.*legacy|legacy.*kserve" --type yaml --type json

# Search for old component naming patterns in dev flag related files  
rg -A 5 -B 5 "LegacyComponentName|legacy.*component" --type go

# Look for any manifest URI configurations that might use old naming
ast-grep --pattern 'URI: $_' | rg -i kserve

Length of output: 31139


🏁 Script executed:

#!/bin/bash
# Locate the defined ComponentName and LegacyComponentName for kserve
rg -Hn "ComponentName" -Hn "LegacyComponentName" internal/controller/components/kserve/*.go

Length of output: 821


🏁 Script executed:

#!/bin/bash
# Search for ComponentName and LegacyComponentName definitions in kserve component files
rg -Hn -e 'ComponentName\s*=' -e 'LegacyComponentName\s*=' internal/controller/components/kserve

Length of output: 98


No legacy component name in KServe component

The KServe component does not define a LegacyComponentName constant, so the dual‐check was never applicable. Removing the legacy check has no impact on existing dev-flag manifests—no manifests need updating.

internal/controller/components/kserve/kserve_controller.go (1)

95-95: LGTM: Consistent use of current component name in reconciler setup.

The changes correctly replace hardcoded legacy component name references with the dynamic componentName variable in:

  • CRD watching predicate (line 95)
  • Kustomize action labels (lines 151-152)

This ensures consistent labeling and filtering based on the current component name throughout the reconciler lifecycle.

Also applies to: 151-152

internal/controller/components/kserve/kserve.go (1)

112-112: LGTM: Status updates use consistent component naming.

The changes correctly update the DataScienceCluster status tracking to use componentName instead of LegacyComponentName. This maintains the same logic for marking component installation status while using consistent naming conventions.

Also applies to: 120-120

internal/controller/components/ray/ray_controller.go (2)

66-67: Approve the kustomize label updates.

The consistent replacement of LegacyComponentName with ComponentName in the kustomize actions ensures uniform labeling across resources.


59-59:

✅ Verification successful

Verify backwards compatibility for the predicate change.

The change from LegacyComponentName to ComponentName in the predicate looks correct, but ensure that existing CustomResourceDefinitions with the legacy component label will still be properly watched.


🏁 Script executed:

#!/bin/bash
# Description: Verify ComponentName is defined and check for any remaining LegacyComponentName references
# Expected: ComponentName constant exists, no LegacyComponentName references remain

# Check if ComponentName is defined in ray component files
echo "=== Checking ComponentName definition ==="
ast-grep --pattern 'const ComponentName = $_'

# Check for any remaining LegacyComponentName references
echo "=== Checking for remaining LegacyComponentName references ==="
rg -n "LegacyComponentName" --type go

# Check existing CRD labels that might use the legacy name
echo "=== Checking for existing Ray CRDs with legacy labels ==="
rg -A 3 -B 3 "ray.*component.*label" --type yaml

Length of output: 5617


No backward‐compatibility concerns for Ray predicate change

I’ve checked internal/controller/components/ray and found no usages of LegacyComponentName, so replacing it with ComponentName in the predicate won’t miss any existing Ray resources. No further action needed.

@@ -79,15 +79,15 @@ func (s *componentHandler) UpdateDSCStatus(ctx context.Context, rr *types.Reconc
return cs, errors.New("failed to convert to DataScienceCluster")
}

dsc.Status.InstalledComponents[LegacyComponentName] = false
dsc.Status.InstalledComponents[ComponentName] = false
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify backwards compatibility for status tracking changes.

The replacement of LegacyComponentName with ComponentName in the InstalledComponents status map ensures consistent component tracking. However, verify that existing DataScienceCluster resources won't be negatively impacted by this change.

Also applies to: 90-90


🏁 Script executed:

#!/bin/bash
# Description: Check existing DataScienceCluster resources for legacy component status entries
# Expected: Understand current usage patterns and potential impact

# Check for existing DataScienceCluster CRDs and instances
echo "=== Checking DataScienceCluster CRD definition ==="
ast-grep --pattern 'type DataScienceCluster struct {
  $$$
}'

# Look for InstalledComponents field definition
echo "=== Checking InstalledComponents field usage ==="
rg -A 5 -B 5 "InstalledComponents" --type go

# Check for any other components that might have similar changes
echo "=== Checking other component status updates ==="
rg -A 2 -B 2 "Status\.InstalledComponents\[.*\]" --type go

Length of output: 41710


Verify backward-compatibility of InstalledComponents key rename

We need to confirm whether migrating from LegacyComponentName to ComponentName will orphan or drop any legacy-named entries, and whether old keys linger or get cleaned up.


🏁 Script executed:

#!/bin/bash
# Locate computeComponentsStatus implementation
echo "=== Finding computeComponentsStatus ==="
rg -n "computeComponentsStatus" --type go

# Show its body to see how InstalledComponents is populated/cleared
echo "=== Dumping computeComponentsStatus implementation ==="
# Adjust path based on the previous rg output
sed -n '1,200p' internal/controller/datasciencecluster/datasciencecluster_controller_actions.go | sed -n '/func computeComponentsStatus/,/}/p'

Length of output: 842


🏁 Script executed:

#!/bin/bash
# Dump the computeComponentsStatus implementation to see how InstalledComponents is managed
echo "=== computeComponentsStatus implementation ==="
sed -n '/func computeComponentsStatus/,/^}$/p' internal/controller/datasciencecluster/datasciencecluster_controller_support.go

Length of output: 1723


Ensure legacy status keys don’t linger after rename

The switch from LegacyComponentName to ComponentName in each component’s UpdateDSCStatus will correctly set the new key, but it does not remove the old key from Status.InstalledComponents. On upgrade of an existing DataScienceCluster, both the legacy and new entries will coexist—potentially confusing users or automation that reads this map.

Please add a migration/cleanup step (e.g., in computeComponentsStatus or at the start of each UpdateDSCStatus) to remove any legacy-named keys once the new key is set:

• File: internal/controller/components/ray/ray.go
Lines: ~82–90

Example cleanup in computeComponentsStatus (in internal/controller/datasciencecluster/datasciencecluster_controller_support.go):

// before iterating components
for legacy := range instance.Status.InstalledComponents {
    if legacy == LegacyComponentName || legacy == LegacyComponentNameUpstream {
        delete(instance.Status.InstalledComponents, legacy)
    }
}

That way, old keys are purged and only the current names remain.

🤖 Prompt for AI Agents
In internal/controller/components/ray/ray.go around lines 82 to 90, after
setting the new InstalledComponents key with ComponentName, add code to delete
any legacy keys such as LegacyComponentName or LegacyComponentNameUpstream from
the Status.InstalledComponents map. This cleanup ensures that old keys do not
linger alongside the new keys, preventing confusion. Implement this either at
the start of the UpdateDSCStatus function or in computeComponentsStatus to
remove legacy keys after setting the new key.

Copy link

codecov bot commented Jun 6, 2025

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 36.04%. Comparing base (b08881f) to head (61ca8b6).
Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
internal/controller/components/kserve/kserve.go 0.00% 2 Missing ⚠️
.../controller/components/kserve/kserve_controller.go 0.00% 1 Missing ⚠️
...ler/components/kserve/kserve_controller_actions.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2017   +/-   ##
=======================================
  Coverage   36.04%   36.04%           
=======================================
  Files          85       85           
  Lines        7708     7708           
=======================================
  Hits         2778     2778           
  Misses       4672     4672           
  Partials      258      258           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-merge-robot
Copy link
Contributor

PR needs rebase.

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.

Copy link

openshift-ci bot commented Aug 11, 2025

@zdtsw: 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 61ca8b6 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.

2 participants