[OTA-1975] pass products-data cincinnati endpoint to plcc#1429
[OTA-1975] pass products-data cincinnati endpoint to plcc#1429ankitathomas wants to merge 1 commit into
Conversation
Signed-off-by: Ankita Thomas <ankithom@redhat.com>
WalkthroughAgentic-run synchronization now passes a typed Kubernetes client through discovery, resolves an optional Cincinnati Route URL, and includes it in generated requests. Tests cover discovery failures, URL inclusion, omission, and updated helper signatures. ChangesAgentic Run Cincinnati URL Integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Sync
participant getAgenticRun
participant KubernetesClient
participant buildRequest
Sync->>getAgenticRun: pass typed client and context
getAgenticRun->>KubernetesClient: discover Cincinnati Service and Route
KubernetesClient-->>getAgenticRun: return Route host or error
getAgenticRun->>buildRequest: provide Cincinnati URL or empty value
buildRequest-->>getAgenticRun: return generated request text
Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (13 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ankitathomas 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: 2
🧹 Nitpick comments (1)
pkg/agenticrun/controller.go (1)
561-564: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueNamespace string duplicated.
"openshift-update-service"is repeated for both the Service and Route lists. Extracting it to a package-level constant would avoid drift if it's ever changed.Also applies to: 585-586
🤖 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 `@pkg/agenticrun/controller.go` around lines 561 - 564, The namespace string is duplicated across the service and route listing logic. Define a package-level constant for "openshift-update-service" and update the Service list and Route list calls in the controller to use that constant instead of repeating the literal.
🤖 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 `@pkg/agenticrun/controller.go`:
- Around line 438-449: Move the single `discoverCincinnatiURL` call from
`getAgenticRun` into `getAgenticRuns`, then pass its resolved URL into each
`getAgenticRun` invocation. Update `getAgenticRun` to accept a `cincinnatiURL
string` parameter, remove its unused `client` parameter and discovery block, and
preserve the existing error fallback and request construction behavior.
- Around line 438-449: Guard the discoverCincinnatiURL call in the agentic run
request flow against a nil client before invoking it, preserving the empty
cincinnatiURL fallback and allowing request construction to continue. Use the
existing client variable and keep normal discovery and error logging behavior
unchanged for non-nil clients.
---
Nitpick comments:
In `@pkg/agenticrun/controller.go`:
- Around line 561-564: The namespace string is duplicated across the service and
route listing logic. Define a package-level constant for
"openshift-update-service" and update the Service list and Route list calls in
the controller to use that constant instead of repeating the literal.
🪄 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: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: ce315c75-1ea9-4939-b8b4-d7b1616242d5
📒 Files selected for processing (2)
pkg/agenticrun/controller.gopkg/agenticrun/controller_test.go
|
@ankitathomas: The following tests failed, say
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. |
Follow-on work to support openshift/cincinnati#1072 and openshift/cincinnati-operator#270
Summary by CodeRabbit
New Features
Bug Fixes