Skip to content

feat: add agent-navigation feature flag and uiplugin field#1107

Open
alanconway wants to merge 1 commit into
rhobs:mainfrom
alanconway:agent-navigation-feature
Open

feat: add agent-navigation feature flag and uiplugin field#1107
alanconway wants to merge 1 commit into
rhobs:mainfrom
alanconway:agent-navigation-feature

Conversation

@alanconway
Copy link
Copy Markdown
Contributor

uiplugin.enableFeatureNavigation bool - set via resource
--features "agent-navigation" - set via command line

@openshift-ci openshift-ci Bot requested review from jgbernalp and simonpasquier May 29, 2026 15:39
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Review Change Stack

Warning

Review limit reached

@alanconway, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 55 minutes and 36 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 043d8007-e999-4154-bc00-abdb86ccd8bf

📥 Commits

Reviewing files that changed from the base of the PR and between 0bcaa6b and 7e871bf.

📒 Files selected for processing (7)
  • bundle/manifests/observability-operator.clusterserviceversion.yaml
  • bundle/manifests/observability.openshift.io_uiplugins.yaml
  • deploy/crds/common/observability.openshift.io_uiplugins.yaml
  • docs/api.md
  • pkg/apis/uiplugin/v1alpha1/types.go
  • pkg/controllers/uiplugin/troubleshooting_panel.go
  • pkg/controllers/uiplugin/troubleshooting_panel_test.go
📝 Walkthrough

Walkthrough

This PR adds support for an enableAgentNavigation boolean configuration field to the UIPlugin troubleshooting panel. The change extends the CRD schema in both bundle and deployment manifests, introduces the corresponding Go API type with kubebuilder annotations, implements conditional feature flag logic in the controller to include "agent-navigation" in the plugin configuration when enabled, and provides comprehensive test coverage verifying feature presence, nil handling, and related proxy configuration behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding an agent-navigation feature flag and a corresponding uiplugin field (enableAgentNavigation) to control AI agent navigation.
Description check ✅ Passed The description relates to the changeset by referencing the enableFeatureNavigation field and agent-navigation feature flag, though it uses a field name slightly different from the actual implementation (enableAgentNavigation).
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Comment thread pkg/controllers/uiplugin/troubleshooting_panel_test.go Outdated
Comment thread bundle/manifests/observability-operator.clusterserviceversion.yaml
Copy link
Copy Markdown

@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: 3

🧹 Nitpick comments (1)
pkg/controllers/uiplugin/troubleshooting_panel.go (1)

37-39: ⚡ Quick win

Clone and dedupe features before appending.

This mutates the caller-owned slice and can also emit agent-navigation twice when the CLI already enabled it. Build a local copy and only append when the feature is not already present.

Proposed fix
-	if plugin.Spec.TroubleshootingPanel != nil && plugin.Spec.TroubleshootingPanel.EnableAgentNavigation {
-		features = append(features, "agent-navigation")
-	}
+	mergedFeatures := append([]string(nil), features...)
+	if plugin.Spec.TroubleshootingPanel != nil && plugin.Spec.TroubleshootingPanel.EnableAgentNavigation {
+		alreadyEnabled := false
+		for _, feature := range mergedFeatures {
+			if feature == "agent-navigation" {
+				alreadyEnabled = true
+				break
+			}
+		}
+		if !alreadyEnabled {
+			mergedFeatures = append(mergedFeatures, "agent-navigation")
+		}
+	}
-	if len(features) > 0 {
-		extraArgs = append(extraArgs, fmt.Sprintf("-features=%s", strings.Join(features, ",")))
+	if len(mergedFeatures) > 0 {
+		extraArgs = append(extraArgs, fmt.Sprintf("-features=%s", strings.Join(mergedFeatures, ",")))
 	}
🤖 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/controllers/uiplugin/troubleshooting_panel.go` around lines 37 - 39, The
code currently mutates the caller-owned features slice and can duplicate
"agent-navigation"; instead, create a local copy of features (e.g., newFeatures
:= append([]string{}, features...>) and then check for presence of
"agent-navigation" before appending when plugin.Spec.TroubleshootingPanel != nil
&& plugin.Spec.TroubleshootingPanel.EnableAgentNavigation; finally, assign or
return the deduped newFeatures so the original caller slice is not mutated and
duplicates are avoided (refer to the features variable and
plugin.Spec.TroubleshootingPanel.EnableAgentNavigation).
🤖 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 `@bundle/manifests/observability-operator.clusterserviceversion.yaml`:
- Line 62: The CSV currently sets its identity to
"observability-operator.v0.0.0-dev" which regresses the bundle version and can
break OLM upgrades; update the CSV identity/version string to a forward semver
suitable for a published channel (e.g., bump to a release like
"observability-operator.v1.4.0" or higher) and apply the same change to the
other occurrence of the dev version in the manifest so both entries match;
retain "0.0.0-dev" only in local/dev-only artifacts and ensure the manifest's
CSV version fields are monotonic with prior published releases.

In `@deploy/olm/kustomization.yaml`:
- Around line 15-16: The kustomization entries newName and newTag currently
point to a personal dev image; update them to reference the project-owned
release image or a CI-templated variable instead (replace newName/newTag values
in deploy/olm/kustomization.yaml so newName uses the organization/release
repository and newTag uses a real release tag or a CI-injected variable like
RELEASE_IMAGE or IMAGE_TAG); ensure the replacement uses the canonical
registry/repo used by releases so distributable OLM overlays are reproducible
and not tied to a personal dev image.

In `@deploy/package-operator/operator/kustomization.yaml`:
- Around line 6-7: The overlay currently pins newName and newTag to a dev image
(newName: quay.io/alanconway/observability-operator and newTag: 0.0.0-dev);
remove this unsafe dev override and align with the project release-image
strategy by either deleting the newTag/newName overrides or replacing newTag
with the release variable/token used by your CI/CD (e.g. ${RELEASE_TAG} or the
canonical production tag) and ensuring newName points to the project-owned image
repository; update references to newName/newTag in the kustomization so shared
packaging manifests do not contain hard-coded dev images.

---

Nitpick comments:
In `@pkg/controllers/uiplugin/troubleshooting_panel.go`:
- Around line 37-39: The code currently mutates the caller-owned features slice
and can duplicate "agent-navigation"; instead, create a local copy of features
(e.g., newFeatures := append([]string{}, features...>) and then check for
presence of "agent-navigation" before appending when
plugin.Spec.TroubleshootingPanel != nil &&
plugin.Spec.TroubleshootingPanel.EnableAgentNavigation; finally, assign or
return the deduped newFeatures so the original caller slice is not mutated and
duplicates are avoided (refer to the features variable and
plugin.Spec.TroubleshootingPanel.EnableAgentNavigation).
🪄 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), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 40d13924-36a4-44b6-ae00-7ac909571f2b

📥 Commits

Reviewing files that changed from the base of the PR and between aca6dec and d05f22c.

📒 Files selected for processing (9)
  • bundle/manifests/observability-operator.clusterserviceversion.yaml
  • bundle/manifests/observability.openshift.io_uiplugins.yaml
  • deploy/crds/common/observability.openshift.io_uiplugins.yaml
  • deploy/olm/kustomization.yaml
  • deploy/package-operator/operator/kustomization.yaml
  • docs/api.md
  • pkg/apis/uiplugin/v1alpha1/types.go
  • pkg/controllers/uiplugin/troubleshooting_panel.go
  • pkg/controllers/uiplugin/troubleshooting_panel_test.go

Comment thread bundle/manifests/observability-operator.clusterserviceversion.yaml Outdated
Comment thread deploy/olm/kustomization.yaml Outdated
Comment thread deploy/package-operator/operator/kustomization.yaml Outdated
@alanconway alanconway force-pushed the agent-navigation-feature branch 3 times, most recently from 3abab8c to 1e6ace6 Compare May 29, 2026 16:18
@alanconway alanconway changed the title feat: add agent-navigation feature flag and uiplugin field. feat: add agent-navigation feature flag and uiplugin field May 29, 2026
@alanconway alanconway force-pushed the agent-navigation-feature branch from 1e6ace6 to 0bcaa6b Compare May 29, 2026 19:33
uiplugin.enableFeatureNavigation bool - set via resource
--features "agent-navigation" - set via command line
@alanconway alanconway force-pushed the agent-navigation-feature branch from 0bcaa6b to 7e871bf Compare May 29, 2026 19:38
@PeterYurkovich
Copy link
Copy Markdown
Member

/lgtm

@PeterYurkovich
Copy link
Copy Markdown
Member

/approve

@openshift-ci openshift-ci Bot added the lgtm label May 30, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 30, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alanconway, PeterYurkovich

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:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants