Skip to content

fix: expose perchAgent url#551

Merged
yashodgayashan merged 1 commit into
openchoreo:mainfrom
yashodgayashan:perch-ai-agent
May 15, 2026
Merged

fix: expose perchAgent url#551
yashodgayashan merged 1 commit into
openchoreo:mainfrom
yashodgayashan:perch-ai-agent

Conversation

@yashodgayashan
Copy link
Copy Markdown
Contributor

@yashodgayashan yashodgayashan commented May 15, 2026

Purpose

perchAgent url was commented out causing the call failed.

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

Summary by CodeRabbit

  • Chores
    • Enabled Perch Agent URL configuration in both production and default settings to source from environment variables.

Review Change Stack

Signed-off-by: yashodgayashan <yashodgayashan@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

📝 Walkthrough

Walkthrough

This PR enables the Perch Agent URL configuration by uncommenting and activating the openchoreo.perchAgentUrl setting in both the base application configuration and production configuration files. Both configurations are wired to the OPENCHOREO_PERCH_AGENT_URL environment variable.

Changes

Perch Agent Configuration Activation

Layer / File(s) Summary
Enable Perch Agent URL in app configurations
app-config.yaml, app-config.production.yaml
Both configuration files uncomment and activate the openchoreo.perchAgentUrl key to read from the OPENCHOREO_PERCH_AGENT_URL environment variable instead of being commented out.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A rabbit hops through config lines,
Uncomments where the Perch Agent shines,
From darkness into light they leap,
Environment secrets now run deep. 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is largely incomplete. Only the Purpose section is filled with meaningful content; all other required sections contain only placeholder text or are empty. Complete essential sections including Goals, Approach, Release note, and Security checks. At minimum, provide context on testing, security validation, and expected behavior after the fix.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: uncommenting and enabling the perchAgent URL configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
app-config.yaml (1)

168-178: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Update comments to match the new configuration behavior.

The comments (lines 168-174) explicitly state: "Optional — leave commented to keep the plugin disabled by default. Uncomment AND set OPENCHOREO_PERCH_AGENT_URL only when the assistant feature is enabled."

However, this PR uncomments the configuration unconditionally. Either:

  1. The comments should be updated to reflect that perchAgentUrl is now always active (controlled solely by whether the env var is set during deployment), or
  2. The configuration should remain commented and be uncommented only in environments where the assistant feature is deployed.

The current state creates confusion about the intended deployment pattern.

📝 Suggested comment update

If the new intended pattern is to control this via environment variable presence (set by Helm only when assistant is enabled):

-  # Upstream URL the openchoreo-perch-backend plugin forwards to (Perch
-  # AI assistant). Optional — leave commented to keep the plugin disabled
-  # by default. Uncomment AND set OPENCHOREO_PERCH_AGENT_URL only when
-  # the assistant feature is enabled
-  # (openchoreo.features.assistant.enabled = true) and the perch-agent
-  # service is deployed.
+  # Upstream URL the openchoreo-perch-backend plugin forwards to (Perch
+  # AI assistant). The plugin uses this URL when the assistant feature
+  # is enabled (openchoreo.features.assistant.enabled = true).
+  # Set OPENCHOREO_PERCH_AGENT_URL via Helm when the perch-agent service
+  # is deployed. If unset, the plugin should gracefully disable itself.
   #
   # For local k3d via port-forward: http://localhost:8088
   # For in-cluster Backstage: http://perch-agent.openchoreo-control-plane.svc.cluster.local:8080
-  # For external access: configure via OPENCHOREO_PERCH_AGENT_URL env var.
   perchAgentUrl: ${OPENCHOREO_PERCH_AGENT_URL}
🤖 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 `@app-config.yaml` around lines 168 - 178, Update the explanatory comments
around the perchAgentUrl setting to reflect the new behavior: state that
perchAgentUrl is now set unconditionally from the OPENCHOREO_PERCH_AGENT_URL
environment variable (so the plugin is controlled by whether the env var is
provided at deploy time), and remove the guidance about "uncommenting" to
enable; alternatively, if you intend to keep the previous deployment pattern,
revert to keeping perchAgentUrl commented and document that it should be
uncommented only when openchoreo.features.assistant.enabled is true. Reference
the perchAgentUrl key, the OPENCHOREO_PERCH_AGENT_URL env var, and the
openchoreo.features.assistant.enabled flag when making the comment changes.
app-config.production.yaml (1)

172-178: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Configuration contradicts the documented self-disable pattern.

The comment on line 176 states: "The perch-backend plugin self-disables when this key is absent, matching the thunder.token pattern."

However:

  1. The thunder.token pattern (line 226) keeps the configuration commented when optional
  2. This PR uncomments perchAgentUrl, making the key always present
  3. If OPENCHOREO_PERCH_AGENT_URL is undefined, the key is still present (not absent), which may prevent the self-disable mechanism from working correctly

This creates the same runtime risk as in app-config.yaml: if the environment variable is not set, the behavior is undefined and may not follow the intended self-disable pattern.

🔧 Suggested fix to maintain self-disable pattern

Option 1: Keep the configuration commented and document that it should be uncommented in deployment overlays:

-  # Upstream URL the openchoreo-perch-backend plugin forwards to (Perch
-  # AI assistant). Optional — uncomment only when the assistant feature
-  # is enabled (openchoreo.features.assistant.enabled = true) and the
-  # perch-agent service is deployed. The perch-backend plugin self-
-  # disables when this key is absent, matching the thunder.token pattern.
-  # OPENCHOREO_PERCH_AGENT_URL: e.g. http://perch-agent.openchoreo-control-plane.svc.cluster.local:8080
-  perchAgentUrl: ${OPENCHOREO_PERCH_AGENT_URL}
+  # Upstream URL the openchoreo-perch-backend plugin forwards to (Perch
+  # AI assistant). Optional — uncomment only when the assistant feature
+  # is enabled (openchoreo.features.assistant.enabled = true) and the
+  # perch-agent service is deployed. The perch-backend plugin self-
+  # disables when this key is absent, matching the thunder.token pattern.
+  # OPENCHOREO_PERCH_AGENT_URL: e.g. http://perch-agent.openchoreo-control-plane.svc.cluster.local:8080
+  # perchAgentUrl: ${OPENCHOREO_PERCH_AGENT_URL}

Option 2: Update comments to clarify the plugin handles undefined values gracefully (if verified):

   # Upstream URL the openchoreo-perch-backend plugin forwards to (Perch
-  # AI assistant). Optional — uncomment only when the assistant feature
-  # is enabled (openchoreo.features.assistant.enabled = true) and the
-  # perch-agent service is deployed. The perch-backend plugin self-
-  # disables when this key is absent, matching the thunder.token pattern.
-  # OPENCHOREO_PERCH_AGENT_URL: e.g. http://perch-agent.openchoreo-control-plane.svc.cluster.local:8080
+  # AI assistant). Set OPENCHOREO_PERCH_AGENT_URL only when the assistant
+  # feature is enabled (openchoreo.features.assistant.enabled = true) and
+  # the perch-agent service is deployed. The plugin gracefully handles
+  # undefined values by disabling itself.
+  # Example: http://perch-agent.openchoreo-control-plane.svc.cluster.local:8080
   perchAgentUrl: ${OPENCHOREO_PERCH_AGENT_URL}
🤖 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 `@app-config.production.yaml` around lines 172 - 178, The config uncomments
perchAgentUrl which breaks the documented self-disable pattern: ensure the key
is absent unless intentionally enabled by either 1) reverting to a commented-out
entry for perchAgentUrl (so deploy overlays uncomment when enabling) matching
the thunder.token pattern used elsewhere (e.g. app-config.yaml), or 2) if you
intend to keep the key present, update the plugin and docs to handle
undefined/empty OPENCHOREO_PERCH_AGENT_URL gracefully (verify perch-backend
reads EMPTY/undefined and self-disables) and adjust the comment to reflect that
behavior; reference perchAgentUrl and OPENCHOREO_PERCH_AGENT_URL in your change
set.
🤖 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.

Outside diff comments:
In `@app-config.production.yaml`:
- Around line 172-178: The config uncomments perchAgentUrl which breaks the
documented self-disable pattern: ensure the key is absent unless intentionally
enabled by either 1) reverting to a commented-out entry for perchAgentUrl (so
deploy overlays uncomment when enabling) matching the thunder.token pattern used
elsewhere (e.g. app-config.yaml), or 2) if you intend to keep the key present,
update the plugin and docs to handle undefined/empty OPENCHOREO_PERCH_AGENT_URL
gracefully (verify perch-backend reads EMPTY/undefined and self-disables) and
adjust the comment to reflect that behavior; reference perchAgentUrl and
OPENCHOREO_PERCH_AGENT_URL in your change set.

In `@app-config.yaml`:
- Around line 168-178: Update the explanatory comments around the perchAgentUrl
setting to reflect the new behavior: state that perchAgentUrl is now set
unconditionally from the OPENCHOREO_PERCH_AGENT_URL environment variable (so the
plugin is controlled by whether the env var is provided at deploy time), and
remove the guidance about "uncommenting" to enable; alternatively, if you intend
to keep the previous deployment pattern, revert to keeping perchAgentUrl
commented and document that it should be uncommented only when
openchoreo.features.assistant.enabled is true. Reference the perchAgentUrl key,
the OPENCHOREO_PERCH_AGENT_URL env var, and the
openchoreo.features.assistant.enabled flag when making the comment changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 22ece0a5-a251-4d5e-a189-b6645bea44bb

📥 Commits

Reviewing files that changed from the base of the PR and between 9339c9a and 831926f.

📒 Files selected for processing (2)
  • app-config.production.yaml
  • app-config.yaml

@yashodgayashan yashodgayashan merged commit b8e55b9 into openchoreo:main May 15, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants