Skip to content

Define default URL for chatbot API#3087

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift-assisted:masterfrom
rawagner:chatbot_default_url
Aug 4, 2025
Merged

Define default URL for chatbot API#3087
openshift-merge-bot[bot] merged 1 commit intoopenshift-assisted:masterfrom
rawagner:chatbot_default_url

Conversation

@rawagner
Copy link
Member

@rawagner rawagner commented Aug 4, 2025

Summary by CodeRabbit

  • Chores
    • Added a new environment variable for configuring the chat API URL, with a default value provided.

@openshift-ci openshift-ci bot requested review from batzionb and celdrake August 4, 2025 06:19
@coderabbitai
Copy link

coderabbitai bot commented Aug 4, 2025

Walkthrough

A new environment variable, AIUI_CHAT_API_URL, is now exported in the apps/assisted-ui/deploy/start.sh script with a default value of 'http://localhost:1234' if not already set. This variable is also included in the environment substitution for the nginx configuration template.

Changes

Cohort / File(s) Change Summary
Deployment Script Update
apps/assisted-ui/deploy/start.sh
Added export and default assignment for AIUI_CHAT_API_URL; included it in envsubst for nginx config.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰
A variable hops in, so spry and new,
AIUI_CHAT_API_URL, now in the crew!
With localhost as home, it’s ready to play,
In the nginx conf, it finds its way.
A script refreshed, the deployment’s delight—
All set for the next chat invite!

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@openshift-ci openshift-ci bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 4, 2025
Copy link

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

🧹 Nitpick comments (1)
apps/assisted-ui/deploy/start.sh (1)

5-5: Inner single-quotes become part of the value

The default string is wrapped in single quotes inside the parameter-expansion expression, e.g. the literal value exported will be 'http://localhost:1234' (quotes included).
If the nginx template already adds its own quotes (or no quotes at all) you may end up with double quoting or a syntax error.

-export AIUI_CHAT_API_URL="${AIUI_CHAT_API_URL:-'http://localhost:1234'}"
+export AIUI_CHAT_API_URL="${AIUI_CHAT_API_URL:-http://localhost:1234}"

This matches the typical pattern for default URL values and avoids surprises.
(The same clean-up could be applied to ASSISTED_SERVICE_URL, but that predates this PR.)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83e1963 and efa9629.

📒 Files selected for processing (1)
  • apps/assisted-ui/deploy/start.sh (1 hunks)
🔇 Additional comments (1)
apps/assisted-ui/deploy/start.sh (1)

8-8: Confirm all nginx templates that reference the new variable get it substituted

AIUI_CHAT_API_URL is now included for /deploy/nginx.conf, but envsubst for nginx_ssl.conf (Line 12) does not list it.
If the SSL template ever references $AIUI_CHAT_API_URL, the variable will be left unresolved at runtime.

Action items:

  1. Check deploy/nginx_ssl.conf for any $AIUI_CHAT_API_URL occurrences.
  2. If present, extend Line 12 accordingly:
-envsubst '${HTTPS_CERT_FILE} ${HTTPS_KEY_FILE}' < /deploy/nginx_ssl.conf > "${NGINX_CONF_PATH}"
+envsubst '${HTTPS_CERT_FILE} ${HTTPS_KEY_FILE} ${AIUI_CHAT_API_URL}' < /deploy/nginx_ssl.conf > "${NGINX_CONF_PATH}"

Copy link

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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83e1963 and efa9629.

📒 Files selected for processing (1)
  • apps/assisted-ui/deploy/start.sh (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: lint
  • GitHub Check: tests
  • GitHub Check: translation-files
  • GitHub Check: unit-tests
  • GitHub Check: circular-deps
  • GitHub Check: format
🔇 Additional comments (1)
apps/assisted-ui/deploy/start.sh (1)

8-8: Verify that the nginx template actually contains $AIUI_CHAT_API_URL

envsubst now substitutes the new variable, but if the placeholder is missing in /deploy/nginx.conf, nothing changes and the addition is dead code.
Please double-check the template or add the placeholder where needed.

Copy link

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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83e1963 and efa9629.

📒 Files selected for processing (1)
  • apps/assisted-ui/deploy/start.sh (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: lint
  • GitHub Check: tests
  • GitHub Check: translation-files
  • GitHub Check: unit-tests
  • GitHub Check: circular-deps
  • GitHub Check: format
🔇 Additional comments (2)
apps/assisted-ui/deploy/start.sh (2)

8-8: Good catch adding the new variable to envsubst list

AIUI_CHAT_API_URL is now substituted into nginx.conf, keeping the template rendering deterministic.
Once the quoting issue above is fixed, this invocation is correct.


15-15: Verify whether env.js template also needs the Chat API URL

env.template.js is currently substituted with only $AIUI_OCM_TOKEN.
If the frontend code consumes AIUI_CHAT_API_URL, remember to include it here, e.g.:

envsubst '$AIUI_OCM_TOKEN $AIUI_CHAT_API_URL' < "$NGINX_APP_ROOT/src/env.template.js" > "$NGINX_APP_ROOT/src/env.js"

Double-check the template before merging.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 4, 2025
@openshift-ci
Copy link

openshift-ci bot commented Aug 4, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ammont82, rawagner

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

@openshift-merge-bot openshift-merge-bot bot merged commit 78b5487 into openshift-assisted:master Aug 4, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants