OLS-3236: Reconcile agentic console plugin in lightspeed-operator#1758
OLS-3236: Reconcile agentic console plugin in lightspeed-operator#1758blublinsky wants to merge 1 commit into
Conversation
|
@blublinsky: This pull request references OLS-3236 which is a valid jira issue. DetailsIn response to this:
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. |
📝 WalkthroughWalkthroughThe PR adds shared console-plugin resource helpers, introduces agentic console resource generation and reconciliation wiring, extends image and CRD plumbing, and updates docs and local-development behavior for the new flow. ChangesConsole plugin and agentic console rollout
Sequence Diagram(s)sequenceDiagram
participant OLSConfigReconciler
participant agenticconsole
participant utils
OLSConfigReconciler->>agenticconsole: ReconcileAgenticConsoleUIResources()
agenticconsole->>utils: RunReconcileTasks(...)
OLSConfigReconciler->>agenticconsole: ReconcileAgenticConsoleUIDeploymentAndPlugin()
agenticconsole->>utils: ReconcileConsolePluginDeployment(...)
agenticconsole->>utils: WaitForConsolePluginTLSSecret(...)
agenticconsole->>utils: ActivateConsolePlugin(...)
OLSConfigReconciler->>agenticconsole: RemoveAgenticConsole()
agenticconsole->>utils: RunDeleteTasks(...)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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 @.ai/spec/README.md:
- Line 52: The cross-reference entry for console-ui.md and agentic-console-ui.md
is too narrow because those docs now cover ConsolePlugin lifecycle and cleanup,
not only deployment generation. Update the README cross-reference table near the
existing deployment-generation mapping by splitting the console docs into a
separate entry or adding the reconciliation guide alongside
how/deployment-generation.md, and verify the referenced architecture and command
descriptions against AGENTS.md, ARCHITECTURE.md, and CONTRIBUTING.md.
In `@cmd/main.go`:
- Line 188: The `--agentic-console-image` flag is defined in `main` but not
wired into the operator deployment args, so add it to the container argument
lists used by the OLM bundle and the canonical manager manifest. Update the args
block that currently includes `--console-image`, `--service-image`, and
`--postgres-image` so it also passes `--agentic-console-image`, keeping the
ordering and style consistent with the existing image override flags.
In `@internal/controller/utils/console_plugin_reconciler.go`:
- Around line 35-53: The continueOnError path in RunReconcileTasks is
double-logging task failures and returning only a stringified task list, which
drops the original error chain. Keep a single log per failed task, collect the
task errors in a slice, and return one aggregated error using errors.Join while
preserving each task name via wrapping; also alias the standard errors import
(for example, stderrors) so it does not conflict with
k8s.io/apimachinery/pkg/api/errors.
In `@internal/controller/utils/utils.go`:
- Around line 1000-1002: The GenerateConsolePluginDeployment helper currently
dereferences opts.Resources without a defensive check, which can lead to a nil
pointer panic if the utility is called with missing resource settings. Add a nil
guard in GenerateConsolePluginDeployment before using opts.Resources, and fall
back to DefaultConsolePluginResourceRequirements() when it is nil so the
deployment setup remains safe even for direct callers.
🪄 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: d9b9e113-e1d2-4736-9ab9-24ace63131c5
⛔ Files ignored due to path filters (2)
api/v1alpha1/zz_generated.deepcopy.gois excluded by!**/zz_generated.deepcopy.goconfig/crd/bases/ols.openshift.io_olsconfigs.yamlis excluded by!config/crd/bases/**
📒 Files selected for processing (33)
.ai/spec/README.md.ai/spec/how/project-structure.md.ai/spec/how/reconciliation.md.ai/spec/what/agentic-console-ui.md.ai/spec/what/console-ui.mdAGENTS.mdARCHITECTURE.mdapi/v1alpha1/olsconfig_types.gocmd/main.gointernal/controller/agenticconsole/assets.gointernal/controller/agenticconsole/assets_test.gointernal/controller/agenticconsole/deployment.gointernal/controller/agenticconsole/reconciler.gointernal/controller/agenticconsole/reconciler_test.gointernal/controller/agenticconsole/suite_test.gointernal/controller/appserver/reconciler.gointernal/controller/console/assets.gointernal/controller/console/assets_test.gointernal/controller/console/deployment.gointernal/controller/console/reconciler.gointernal/controller/console/reconciler_test.gointernal/controller/olsconfig_controller.gointernal/controller/olsconfig_helpers.gointernal/controller/reconciler/interface.gointernal/controller/utils/console_plugin_reconciler.gointernal/controller/utils/console_plugin_test.gointernal/controller/utils/constants.gointernal/controller/utils/resource_defaults_test.gointernal/controller/utils/suite_test.gointernal/controller/utils/testing.gointernal/controller/utils/types.gointernal/controller/utils/utils.gointernal/controller/watchers/watchers.go
💤 Files with no reviewable changes (1)
- internal/controller/console/assets_test.go
1d9cced to
7219225
Compare
|
@blublinsky: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Description
Summary
Migrate agentic console plugin reconciliation from lightspeed-agentic-operator into lightspeed-operator (OLS-3236, operator scope).
36 files — 9 added, 27 modified (~3.1k / ~710 lines).
Operator reconciliation
Add internal/controller/agenticconsole/ — Phase 1 (ConfigMap, NetworkPolicy, ServiceAccount) and Phase 2 (Deployment, Service, TLS wait, ConsolePlugin, Console activation), plus RemoveAgenticConsole() finalizer cleanup.
Wire into OLSConfigReconciler: Phase 1/2 steps, AgenticConsolePluginReady, TLS secret watcher, deployment restart mapping.
Add spec.ols.deployment.agenticConsole (Config) to OLSConfig; regenerate config/crd/bases/ols.openshift.io_olsconfigs.yaml.
Add --agentic-console-image in cmd/main.go (default: Konflux lightspeed-agentic-console:main).
Reuse existing resource names for upgrade adoption (lightspeed-agentic-console-plugin, cert lightspeed-agentic-console-plugin-cert, port 9443, container console).
No ConsolePlugin proxy to app-server (unlike chat console).
Shared console plugin refactor
Extract internal/controller/utils/console_plugin_reconciler.go (+ tests).
Refactor internal/controller/console/ to use shared helpers (~400 lines removed).
Local dev fix
Skip reconcileMetricsReaderSecret when LOCAL_DEV_MODE=true (make run) to stop metrics-reader-token reconcile loop. Add agentic console name to make run
Documentation
AGENTS.md, ARCHITECTURE.md
.ai/spec/what/agentic-console-ui.md (new), console-ui.md, README.md, how/project-structure.md, how/reconciliation.md
Intentionally out of scope (follow-up)
OLM bundle/CSV sync (bundle/manifests/, related_images.json, CSV --agentic-console-image)
Type of change
Related Tickets & Documents
https://redhat.atlassian.net/browse/OLS-3349
Checklist before requesting a review
Testing
Summary by CodeRabbit
New Features
Bug Fixes
Documentation