Skip to content

[RHAISTRAT-1064] allow specifying submodules, and mirror status into DSC - #3838

Merged
openshift-merge-bot[bot] merged 13 commits into
opendatahub-io:mainfrom
StevenTobin:submodule_status_reporting
Jul 22, 2026
Merged

openshift-merge-bot[bot] merged 13 commits into
opendatahub-io:mainfrom
StevenTobin:submodule_status_reporting

Conversation

@StevenTobin

@StevenTobin StevenTobin commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

Module submodule status mirroring for DSC

  • Modules can declare submodules (e.g. AIGateway declares ModelsAsAService and BatchGateway) via SubmoduleCondition on ModuleConfig.
  • The orchestrator mirrors submodule conditions from the module CR's .status.conditions into the DSC's .status.conditions, contributing to the ModulesReady aggregate.
  • Each submodule has an IsEnabled check — disabled submodules report Removed (not NotReady); enabled-but-not-yet-reported submodules show AwaitingReadiness.
  • Submodules appear in dsc.status.components with their own managementState (Managed/Removed), using reflection — same pattern as top-level modules.
  • Modules also get their own WriteDSCComponentStatus default (via BaseHandler) so every module's managementState shows in the DSC status automatically.

Tested with AGO latest image to include the status reporting PR from their side.

How Has This Been Tested?

  • Build an operator image from this branch
  • Deploy the image
  • Verify the registered submodule status exists ModelsAsServiceReady and BatchGatewayReady
  • Enable one of the submodules
  • Verify the status mirrors the status from the default-aigateway module cr.
  - lastTransitionTime: "2026-07-20T17:54:08Z"
    message: Submodule ManagementState is set to Removed
    reason: Removed
    severity: Info
    status: "False"
    type: ModelsAsServiceReady
  - lastTransitionTime: "2026-07-20T17:54:53Z"
    message: batchGateway is Managed and deployments are available
    reason: Ready
    status: "True"
    type: BatchGatewayReady
    modelsAsAService:
      managementState: Removed
    batchGateway:
      managementState: Managed

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
  • The developer has run the integration test pipeline and verified that it passed successfully
  • New RELATED_IMAGE mappings are listed in ODH-Build-Config and RHOAI-Build-Config (CI validates names against build-config repos). Include links to build-config PRs in the description.

E2E test suite update requirement

When bringing new changes to the operator code, such changes are by default required to be accompanied by extending and/or updating the E2E test suite accordingly.

To opt-out of this requirement:

  1. Please inspect the opt-out guidelines, to determine if the nature of the PR changes allows for skipping this requirement
  2. If opt-out is applicable, provide justification in the dedicated E2E update requirement opt-out justification section below
  3. Check the checkbox below:
  • Skip requirement to update E2E test suite for this PR
  1. Submit/save these changes to the PR description. This will automatically trigger the check.

E2E update requirement opt-out justification

Covered with unit tests.

Summary by CodeRabbit

  • New Features

    • Added DataScienceCluster status tracking for AIGateway subcomponents, including Models as a Service and Batch Gateway.
    • Mirrored subcomponent readiness, enablement, management state, and release information into cluster status.
    • Added release metadata visibility for supported components.
  • Documentation

    • Updated the API overview with the new component status fields.
  • Tests

    • Added unit and end-to-end coverage for subcomponent conditions, management states, and release mirroring.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds DSC status types for AIGateway submodules, release metadata extraction and propagation, and reflection-based component status updates. Module reconciliation now mirrors submodule conditions, handles disabled, stale, and error states, and updates submodule management states. AIGateway configuration defines ModelsAsAService and BatchGateway mappings. Unit and end-to-end tests cover release mirroring, condition propagation, enablement transitions, and fallback behavior.

Estimated code review effort: 4 (Complex) | ~60 minutes

🚥 Pre-merge checks | ✅ 10
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding submodule specification and mirroring status into DSC.
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.
Contribution Quality And Spam Detection ✅ Passed PASS: broad feature plumbing across API/controller/e2e with focused tests; no concrete CWE-20/CWE-693-style security-theater or code-quality red flags.
No Hardcoded Secrets ✅ Passed No hardcoded credential literals, credentialed URLs, or long base64 secrets found in touched files (CWE-798/CWE-259/CWE-321).
No Weak Cryptography ✅ Passed PASS: Touched files add no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, no custom crypto, and no secret/token comparisons; imports are non-crypto. CWE-327/CWE-208 not triggered.
No Injection Vectors ✅ Passed No CWE-89/CWE-78/CWE-94/CWE-502/CWE-79 sinks found; changes are status/reflection writes and condition mirroring only.
No Privileged Containers ✅ Passed PASS: Diff only touches Go/docs/tests/scripts; no changed manifests, Helm templates, or Dockerfiles, and no privileged/root settings were found (CWE-250).
No Sensitive Data In Logs ✅ Passed No new logging leaks found; touched logs only emit module names, statuses, and generic errors, not secrets or raw bodies (CWE-532).

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
internal/controller/modules/base.go (1)

183-198: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Two identical reflection-based management-state writers. Both resolve a field on dsc.Status.Components by name and set its ManagementState to operatorv1.Managed/Removed; the only difference is the field-name source. Extract a shared helper (e.g. setComponentManagementState(components any, fieldName string, enabled bool)) and call it from both, so the reflection/CanSet logic lives in one place.

  • internal/controller/modules/base.go#L183-L198: have WriteDSCComponentStatus delegate to the shared helper using b.Config.GVK.Kind.
  • internal/controller/modules/modules_controller_actions.go#L692-L711: have writeSubmoduleComponentStatus delegate to the same helper using sm.StatusFieldName (keep the platformCtx.DSC == nil/empty-name guards).
🤖 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 `@internal/controller/modules/base.go` around lines 183 - 198, Extract the
duplicated reflection and ManagementState assignment into a shared
setComponentManagementState helper. In
internal/controller/modules/base.go:183-198, update
BaseHandler.WriteDSCComponentStatus to call it with b.Config.GVK.Kind; in
internal/controller/modules/modules_controller_actions.go:692-711, update
writeSubmoduleComponentStatus to call it with sm.StatusFieldName while
preserving the existing platformCtx.DSC nil and empty-name guards.
🤖 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 `@internal/controller/modules/modules_controller_actions.go`:
- Around line 567-568: The stale-generation path that handles observedGeneration
< generation returns before updating submodule status. Update the relevant
controller flow around mirrorSubmoduleConditions so that branch also writes
Status.Components.{ModelsAsAService,BatchGateway}.ManagementState and DSC
submodule conditions, preferably through a shared helper, while preserving the
existing not-ready behavior and ensuring every return path mirrors submodule
status consistently.

---

Nitpick comments:
In `@internal/controller/modules/base.go`:
- Around line 183-198: Extract the duplicated reflection and ManagementState
assignment into a shared setComponentManagementState helper. In
internal/controller/modules/base.go:183-198, update
BaseHandler.WriteDSCComponentStatus to call it with b.Config.GVK.Kind; in
internal/controller/modules/modules_controller_actions.go:692-711, update
writeSubmoduleComponentStatus to call it with sm.StatusFieldName while
preserving the existing platformCtx.DSC nil and empty-name guards.
🪄 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: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 38e57d32-3b15-412e-8d48-e2c106a345ba

📥 Commits

Reviewing files that changed from the base of the PR and between 2452f9c and f406286.

📒 Files selected for processing (10)
  • api/components/v1alpha1/aigateway_types.go
  • api/components/v1alpha1/zz_generated.deepcopy.go
  • api/datasciencecluster/v2/datasciencecluster_types.go
  • api/datasciencecluster/v2/zz_generated.deepcopy.go
  • internal/controller/modules/aigateway/handler.go
  • internal/controller/modules/base.go
  • internal/controller/modules/export_test.go
  • internal/controller/modules/modules_controller_actions.go
  • internal/controller/modules/submodule_conditions_test.go
  • internal/controller/modules/types.go

Comment thread internal/controller/modules/modules_controller_actions.go
@cgoodfred

Copy link
Copy Markdown
Contributor

checked and verified the status of the submodule comes through with one submodule enabled and another disabled.

cgoodfre@cgoodfre-mac ~ % oc get dsc default-dsc -o jsonpath='{range .status.conditions[*]}{.type}{"\t"}{.status}{"\t"}{.reason}{"\t"}{.lastTransitionTime}{"\t"}{.message}{"\n"}{end}' | grep -E '(^Ready\t|ModulesReady|AIGateway|BatchGateway|ModelsAsService)' | column -t -s $'\t'
Ready                 True   2026-07-21T13:02:11Z
ModulesReady          True   2026-07-21T13:02:11Z
AIGatewayReady        True   2026-07-20T22:29:30Z
BatchGatewayReady     True   Ready                 2026-07-21T13:02:11Z  batchGateway is Managed and deployments are available
ModelsAsServiceReady  False  Removed               2026-07-20T22:28:47Z  Submodule ManagementState is set to Removed

@carlkyrillos carlkyrillos changed the title allow specifying submodules, and mirror status into DSC [RHAISTRAT-1064] allow specifying submodules, and mirror status into DSC Jul 21, 2026
@@ -0,0 +1,26 @@
package modules

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we avoid this test file, and use package modules in internal/controller/modules/submodule_conditions_test.go?

Comment thread internal/controller/modules/aigateway/handler.go Outdated
Comment thread internal/controller/modules/modules_controller_actions.go
Comment thread internal/controller/modules/modules_controller_actions.go Outdated
Comment thread internal/controller/modules/modules_controller_actions.go Outdated
Comment thread internal/controller/modules/base.go
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 2452f9c and 2 for PR HEAD 517648b in total

@openshift-ci openshift-ci Bot removed the lgtm label Jul 21, 2026
WithCustomErrorMsg("ai-gateway-operator Deployment should have APPLICATIONS_NAMESPACE=%s injected", tc.AppsNamespace),
)
}},
{"Validate releases mirrored to DSC", func(t *testing.T) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should we also add a similar test to mcplifecycleoperator?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes sense, I'll add it

@openshift-ci openshift-ci Bot added the lgtm label Jul 22, 2026
@AjayJagan

Copy link
Copy Markdown
Member

@davidebianchi , looks like there are conflicts?

@openshift-ci openshift-ci Bot removed the lgtm label Jul 22, 2026
@Griffin-Sullivan

Copy link
Copy Markdown
Contributor

/retest

@openshift-ci openshift-ci Bot removed the lgtm label Jul 22, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 7659a92 and 2 for PR HEAD 8851eb4 in total

@openshift-ci openshift-ci Bot removed the lgtm label Jul 22, 2026
@openshift-ci openshift-ci Bot added the lgtm label Jul 22, 2026
@openshift-ci

openshift-ci Bot commented Jul 22, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: carlkyrillos, cgoodfred

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [carlkyrillos,cgoodfred]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov

codecov Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.25478% with 31 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@7659a92). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...l/controller/modules/modules_controller_actions.go 82.92% 13 Missing and 1 partial ⚠️
internal/controller/modules/aigateway/handler.go 33.33% 11 Missing and 1 partial ⚠️
internal/controller/modules/base.go 91.22% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3838   +/-   ##
=======================================
  Coverage        ?   58.83%           
=======================================
  Files           ?      224           
  Lines           ?    17703           
  Branches        ?        0           
=======================================
  Hits            ?    10415           
  Misses          ?     6332           
  Partials        ?      956           

☔ View full report in Codecov by Harness.
📢 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-bot
openshift-merge-bot Bot merged commit d4fbaf8 into opendatahub-io:main Jul 22, 2026
35 of 36 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in ODH Platform Planning Jul 22, 2026
@rhods-ci-bot

Copy link
Copy Markdown
Collaborator

/early-gate-build

harshad16 added a commit to harshad16/opendatahub-operator that referenced this pull request Jul 29, 2026
Project workbenchNamespace from the Workbenches module CR onto
status.components.workbenches via an optional workbenches-only writer,
so the dashboard can resolve the legacy notebooks namespace without
changing the generic release/managementState mirroring from opendatahub-io#3838.

Signed-off-by: Harshad Reddy Nalla <hnalla@redhat.com>
harshad16 added a commit to harshad16/opendatahub-operator that referenced this pull request Jul 29, 2026
Project workbenchNamespace onto status.components.workbenches via
an optional workbenches-only writer, so the dashboard can resolve
the legacy notebooks namespace without changing the generic
release/managementState mirroring from opendatahub-io#3838.

Signed-off-by: Harshad Reddy Nalla <hnalla@redhat.com>
harshad16 added a commit to harshad16/opendatahub-operator that referenced this pull request Jul 29, 2026
Project workbenchNamespace onto status.components.workbenches via
an optional workbenches-only writer, so the dashboard can resolve
the legacy notebooks namespace without changing the generic
release/managementState mirroring from opendatahub-io#3838.

Signed-off-by: Harshad Reddy Nalla <hnalla@redhat.com>
harshad16 added a commit to harshad16/opendatahub-operator that referenced this pull request Jul 30, 2026
Project workbenchNamespace onto status.components.workbenches via
an optional workbenches-only writer, so the dashboard can resolve
the legacy notebooks namespace without changing the generic
release/managementState mirroring from opendatahub-io#3838.

Signed-off-by: Harshad Reddy Nalla <hnalla@redhat.com>
openshift-merge-bot Bot pushed a commit that referenced this pull request Jul 30, 2026
Project workbenchNamespace onto status.components.workbenches via
an optional workbenches-only writer, so the dashboard can resolve
the legacy notebooks namespace without changing the generic
release/managementState mirroring from #3838.

Signed-off-by: Harshad Reddy Nalla <hnalla@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants