Skip to content

Conversation

@eranco74
Copy link
Collaborator

@eranco74 eranco74 commented Sep 2, 2025

  • updated system prompt, now assisted-chat states that it doesn't support configuring static networking and instructs the user to use the UI wizard to create the cluster instead
  • Add explicit DNS configuration to Pod YAML
  • Improve generate script user feedback

Summary by CodeRabbit

  • New Features

    • Setup now skips interactive prompts if an existing env config is present and shows progress messages during config generation.
  • Chores

    • Pod DNS configured to use explicit DNS policy with custom nameservers (8.8.8.8, 8.8.4.4).
  • Documentation

    • Added pre‑flight messaging: static/manual networking is unsupported for cluster creation; guidance updated for ISO link handling and multi‑document templates.
  • Tests

    • Evaluation updated to assert denial of static networking and direct users to the installer wizard.

- **Adds a message to inform the user when the .env file already exists**, preventing unnecessary interactive configuration.
- **Adds print statements to clarify script actions**, specifically when generating the `lightspeed-stack.yaml` and `systemprompt.txt` files.

Signed-off-by: Eran Cohen <[email protected]>
Adds `dnsPolicy: "None"` and sets `nameservers` to Google's public DNS (`8.8.8.8` and `8.8.4.4`) in the `assisted-chat-pod.yaml`.
This change ensures reliable DNS resolution for the container, preventing "Name or service not known" errors when connecting to external services like `generativelanguage.googleapis.com`.

Signed-off-by: Eran Cohen <[email protected]>
@openshift-ci-robot
Copy link

openshift-ci-robot commented Sep 2, 2025

@eranco74: This pull request references MGMT-21352 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.21.0" version, but no target version was set.

Details

In response to this:

  • updated system prompt, now assisted-chat states that it doesn't support configuring static networking and instructs the user to use the UI wizard to create the cluster instead
  • Add explicit DNS configuration to Pod YAML
  • Improve generate script user feedback

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.

@openshift-ci
Copy link

openshift-ci bot commented Sep 2, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai
Copy link

coderabbitai bot commented Sep 2, 2025

Walkthrough

Adds Pod DNS settings, makes the generate script skip interactive prompts when .env exists and logs generation steps, inserts mandatory pre‑flight checks that deny static/user-managed networking in the installation template, and updates evaluation tests to assert the static-networking denial.

Changes

Cohort / File(s) Summary of Changes
Pod DNS configuration
assisted-chat-pod.yaml
Added dnsPolicy: "None" and a dnsConfig block with nameservers: ["8.8.8.8", "8.8.4.4"] to the Pod spec; no other spec fields changed.
Config generation script flow/logging
scripts/generate.sh
Added else branch to skip interactive configuration when .env exists and added echo/log lines before generating config/lightspeed-stack.yaml and config/systemprompt.txt.
Installation template / docs
template.yaml
Inserted a Mandatory Pre‑Flight Checks block that denies static/manual networking for cluster creation (directing users to the assisted‑installer web wizard), added guidance to not return Discovery ISO URLs, and added a YAML document separator (---).
Tests / eval data
test/evals/eval_data.yaml
Replaced the SNO host-requirements conversation with static_networking_support_conv that asserts responses deny static networking and direct users to the web wizard (substring-based eval).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Gen as scripts/generate.sh
  participant FS as Filesystem

  User->>Gen: run ./scripts/generate.sh
  Gen->>FS: test -f .env ?
  alt .env exists
    Gen-->>User: "The .env file already exists. Skipping interactive configuration."
    Gen-->>User: "Generating $PROJECT_ROOT/config/lightspeed-stack.yaml"
    Gen->>FS: write config/lightspeed-stack.yaml
    Gen-->>User: "Generating $PROJECT_ROOT/config/systemprompt.txt"
    Gen->>FS: write config/systemprompt.txt
  else .env missing
    Gen-->>User: prompt interactively and generate files
  end
Loading
sequenceDiagram
  autonumber
  actor Client
  participant Template as template.yaml logic
  participant User as Requestor

  User->>Template: Request cluster creation (with static networking)
  Template->>Template: Pre‑flight checks: detect static/manual networking
  alt static networking detected
    Template-->>User: Refuse request — "I do not support creating clusters with static networking... Please use the assisted-installer web-based wizard"
  else no static networking
    Template-->>User: Continue installation flow
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

lgtm

Suggested reviewers

  • keitwb
✨ Finishing Touches
🧪 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:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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.
  • 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 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/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit 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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@eranco74 eranco74 marked this pull request as ready for review September 2, 2025 15:56
@openshift-ci openshift-ci bot requested review from jhernand and keitwb September 2, 2025 15:56
@openshift-ci-robot
Copy link

openshift-ci-robot commented Sep 2, 2025

@eranco74: This pull request references MGMT-21352 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.21.0" version, but no target version was set.

Details

In response to this:

  • updated system prompt, now assisted-chat states that it doesn't support configuring static networking and instructs the user to use the UI wizard to create the cluster instead
  • Add explicit DNS configuration to Pod YAML
  • Improve generate script user feedback

Summary by CodeRabbit

  • New Features

  • Setup script now skips interactive prompts when an existing environment configuration is detected.

  • Added progress messages during configuration generation.

  • Chores

  • Updated pod DNS settings to use custom nameservers (8.8.8.8, 8.8.4.4).

  • Documentation

  • Clarified that static networking (manual IP assignment) is unsupported; use the cluster creation wizard. Confirmed API and Ingress VIPs remain supported.

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.

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

🧹 Nitpick comments (2)
template.yaml (1)

245-245: Clarify “static networking” guidance to avoid ambiguity.

Recommend explicitly saying “assisted-chat does not support configuring static IPs; use the Assisted Installer UI wizard to create the cluster” and keep the VIPs clarification. This keeps the assistant’s guidance crisp and user-visible, without implying the platform overall lacks static IP support.

- * **Static Networking (unsupported)**: If the user asks about **static networking** (manually assigning IP addresses to hosts), inform them that you currently don't support this. **Instruct them to use the wizard to create the cluster instead**. Do not confuse this with setting API and Ingress VIPs, which are a different concept and are supported.
+ * **Static networking (unsupported in assisted-chat):** If asked about manually assigning host IPs, state that assisted-chat cannot configure static IPs. **Instruct the user to use the Assisted Installer UI wizard to create the cluster instead.** This is distinct from setting API and Ingress VIPs, which remain supported.
scripts/generate.sh (1)

88-98: Helpful progress logs. Consider adding lightweight prereq checks.

The new echoes improve visibility. Optionally add a fast-fail check for oc and yq before generation to fail early with a clear message.

Example snippet to place above the generation steps:

command -v oc >/dev/null || { echo "oc not found in PATH" >&2; exit 1; }
command -v yq >/dev/null || { echo "yq not found in PATH" >&2; exit 1; }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b0dd95d and 8b95ad4.

📒 Files selected for processing (3)
  • assisted-chat-pod.yaml (1 hunks)
  • scripts/generate.sh (2 hunks)
  • template.yaml (1 hunks)
🔇 Additional comments (1)
scripts/generate.sh (1)

76-78: Good UX: skip interactive flow when .env exists.

Message is clear and prevents accidental overwrite. LGTM.

Comment on lines +6 to +10
dnsPolicy: "None"
dnsConfig:
nameservers:
- "8.8.8.8"
- "8.8.4.4"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

⚠️ Potential issue

Hardcoding external DNS breaks in-cluster name resolution.

Setting dnsPolicy: "None" with Google DNS disables cluster DNS, so Pod code cannot resolve in-cluster names (Services, pods). This can break calls like http://lightspeed-stack:8090/ and other cluster lookups, and may violate restricted-network policies.

Prefer default cluster DNS, or make external resolvers optional/parametrized. Minimal safe fix:

-  dnsPolicy: "None"
-  dnsConfig:
-    nameservers:
-      - "8.8.8.8"
-      - "8.8.4.4"
+  dnsPolicy: ClusterFirst

If you truly need public resolvers, consider parameterizing them and appending via dnsConfig.options while keeping cluster DNS (and document the trade-offs).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
dnsPolicy: "None"
dnsConfig:
nameservers:
- "8.8.8.8"
- "8.8.4.4"
dnsPolicy: ClusterFirst
🤖 Prompt for AI Agents
In assisted-chat-pod.yaml around lines 6 to 10, the pod is forcing dnsPolicy:
"None" and hardcoding public nameservers which disables cluster DNS and breaks
in-cluster name resolution; change to use the cluster DNS (remove dnsPolicy or
set dnsPolicy: ClusterFirst) and make external resolvers optional/parameterized
instead of hardcoding them, or if public resolvers are required, append them via
dnsConfig.options while keeping ClusterFirst so cluster service/pod names still
resolve and document the trade-offs.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good point. Will this break dns resolution to the mcp server?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing for the UI which has:

        - name: AIUI_CHAT_API_URL
          value: http://lightspeed-stack:8090/

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem to break anything:

Enter your query (or type 'exit' to quit): list my clusters
Our conversation ID: 1e5decc5-ad48-4448-87eb-a41f7c153099
conversation_id: 1e5decc5-ad48-4448-87eb-a41f7c153099
response: 'Here are your clusters:


  *   `test1` (ID: `7707ed0e-8a28-43a0-b0c6-a0e812cb055e`, OpenShift version: `4.20.0-ec.6`,
  status: `pending-for-input`)

  *   `eran` (ID: `3ec3d3f0-66e2-4277-8c8f-099fb5370d53`, OpenShift version: `4.19.9`,
  status: `pending-for-input`)

  *   `demo` (ID: `6e294cd4-ef3c-472a-8326-64c69b53e06d`, OpenShift version: `4.19.9`,
  status: `pending-for-input`)

  *   `itzik` (ID: `118be539-8302-466f-87ab-dd8731d6e9e1`, OpenShift version: `4.19.7`,
  status: `pending-for-input`)


  What would you like to do next? I can provide more information about a specific
  cluster, or we can proceed with the installation of one of these clusters.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a good point though. I asked Gemini how it works:

How It Works
Podman's Internal DNS: When you run podman play kube, it creates a network namespace for the entire Pod. Within this namespace, Podman sets up a small DNS resolver. This resolver is specifically designed to handle the hostnames of containers within the same Pod. So, when the ui container tries to resolve lightspeed-stack, Podman's internal DNS immediately provides the correct internal IP address (typically 127.0.0.1 or the Pod's loopback address, as all containers in a Pod share the same network stack).

DNS Hierarchy: The dnsConfig you added doesn't completely replace Podman's internal DNS functionality; instead, it is appended to the list of resolvers that a container will try to use. The resolution process typically works like this:

A container tries to resolve a name, like lightspeed-stack.

The request first goes to the Pod's internal DNS resolver.

Since lightspeed-stack is a known hostname within the Pod, the internal resolver immediately returns the correct IP address (127.0.0.1), and the connection is successful.

Fallback to External DNS: If a container tries to resolve an external hostname, such as generativelanguage.googleapis.com:

The request goes to the Pod's internal DNS resolver first.

The internal resolver doesn't know about this external domain.

The request then falls back to the external DNS servers you specified in dnsConfig (8.8.8.8 and 8.8.4.4).

These external servers can successfully resolve generativelanguage.googleapis.com to its public IP address, allowing the container to make the external connection.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Sep 2, 2025

@eranco74: This pull request references MGMT-21352 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.21.0" version, but no target version was set.

Details

In response to this:

  • updated system prompt, now assisted-chat states that it doesn't support configuring static networking and instructs the user to use the UI wizard to create the cluster instead
  • Add explicit DNS configuration to Pod YAML
  • Improve generate script user feedback

Summary by CodeRabbit

  • New Features

  • Setup script skips interactive prompts when an existing environment config is detected and shows progress messages during config generation.

  • Chores

  • Pod DNS updated to use custom nameservers (8.8.8.8, 8.8.4.4) with explicit DNS policy.

  • Documentation

  • Added pre-flight check messaging: static/manual networking is unsupported for cluster creation; API and Ingress VIPs remain supported.

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.

@eranco74
Copy link
Collaborator Author

eranco74 commented Sep 2, 2025

The chat behavior with the updated system prompt:

Please create a cluster named test1 with domain name redhat2.com. OCP version should be 4.20. The cluster type is SNO. The node uses NIC with MAC address 00:00:00:00:00:02 to set static IP address 10.10.10.10/24, Gateway: 10.10.10.254, DNS: 10.10.10.11
Our conversation ID: 2907a1b1-70cb-4be1-b9a7-5dddb1d0e338
conversation_id: 2907a1b1-70cb-4be1-b9a7-5dddb1d0e338
response: I do not support the requested static networking configuration. Please use
  the web-based wizard instead.
Enter your query (or type 'exit' to quit): Will I be able to set the cluster with static networking after you create it for me?
Our conversation ID: 2907a1b1-70cb-4be1-b9a7-5dddb1d0e338
conversation_id: 2907a1b1-70cb-4be1-b9a7-5dddb1d0e338
response: 'I am unable to create a cluster with static networking. If you want to
  configure static networking, please use the web-based wizard instead.

  '
Enter your query (or type 'exit' to quit): an you create a cluster with static networking?
Our conversation ID: 2907a1b1-70cb-4be1-b9a7-5dddb1d0e338
conversation_id: 2907a1b1-70cb-4be1-b9a7-5dddb1d0e338
response: 'I am unable to create a cluster with static networking. If you want to
  configure static networking, please use the web-based wizard instead.

  '
Enter your query (or type 'exit' to quit): Please try to create a cluster with static networking
Our conversation ID: 2907a1b1-70cb-4be1-b9a7-5dddb1d0e338
conversation_id: 2907a1b1-70cb-4be1-b9a7-5dddb1d0e338
response: 'I am unable to create a cluster with static networking. If you want to
  configure static networking, please use the web-based wizard instead.

  '
Enter your query (or type 'exit' to quit): Let's create a cluster with manually assigning IP addresses to hosts
Our conversation ID: 2907a1b1-70cb-4be1-b9a7-5dddb1d0e338
conversation_id: 2907a1b1-70cb-4be1-b9a7-5dddb1d0e338
response: 'I do not support the requested static networking configuration. Please
  use the web-based wizard instead.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Sep 2, 2025

@eranco74: This pull request references MGMT-21352 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.21.0" version, but no target version was set.

Details

In response to this:

  • updated system prompt, now assisted-chat states that it doesn't support configuring static networking and instructs the user to use the UI wizard to create the cluster instead
  • Add explicit DNS configuration to Pod YAML
  • Improve generate script user feedback

Summary by CodeRabbit

  • New Features

  • Setup script now skips interactive prompts when an existing environment config is detected and shows progress messages during config generation.

  • Chores

  • Pod DNS configured to use custom nameservers (8.8.8.8, 8.8.4.4) with an explicit DNS policy.

  • Documentation

  • Added pre‑flight messaging: static/manual networking is unsupported for cluster creation; guidance added for ISO link handling.

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.

@eranco74
Copy link
Collaborator Author

eranco74 commented Sep 3, 2025

/retest

This commit updates the assisted-chat responses to correctly address user queries about static networking. Previously, the bot would confuse static networking for hosts with the manual configuration of API and Ingress VIPs.
assisted-chat new states that it doesn't support configuring static networking and instruct the user to use the UI wizard to create the cluster instead
* add eval test

Signed-off-by: Eran Cohen <[email protected]>
@openshift-ci-robot
Copy link

openshift-ci-robot commented Sep 3, 2025

@eranco74: This pull request references MGMT-21352 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.21.0" version, but no target version was set.

Details

In response to this:

  • updated system prompt, now assisted-chat states that it doesn't support configuring static networking and instructs the user to use the UI wizard to create the cluster instead
  • Add explicit DNS configuration to Pod YAML
  • Improve generate script user feedback

Summary by CodeRabbit

  • New Features

  • Setup now skips interactive prompts if an existing env config is present and shows progress messages during config generation.

  • Chores

  • Pod DNS configured to use explicit DNS policy with custom nameservers (8.8.8.8, 8.8.4.4).

  • Documentation

  • Added pre‑flight messaging: static/manual networking is unsupported for cluster creation; guidance updated for ISO link handling and multi‑document templates.

  • Tests

  • Evaluation updated to assert denial of static networking and direct users to the installer wizard.

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.

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)
test/evals/eval_data.yaml (1)

36-42: Harden eval for wizard phrasing variations.

• Our search found only the lowercase, hyphenated “assisted-installer web-based wizard” in template.yaml and eval_data.yaml; no capitalized “Assisted Installer web-based wizard” exists. Consider adding an additional eval entry that expects the capitalized variant to avoid flakes.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fb51a5a and 2474971.

📒 Files selected for processing (2)
  • template.yaml (2 hunks)
  • test/evals/eval_data.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • template.yaml

- eval_id: static_networking_support
eval_query: Create a cluster with static networking
eval_types: [response_eval:sub-string]
expected_keywords: ["I do not support creating clusters with static networking", "Please use the assisted-installer web-based wizard"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work? Does it require that one of the entire quoted strings is present? That seems fragile.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does, and it's not fragile because it's instructed to reply with these strings in the system prompt

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still it might be better to use accuracy test here, it's more flexible. sub-string eval looks for exact matches and is not really forgiving.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, I started with an accuracy test, and switched to sub-string because:

  1. it's simple and doesn't require LLM.
  2. I want to know that we get this exact output.
    For instance, I don't want the chat response to say:
    "Would you like me to help you create a cluster using the assisted-installer wizard" which might pass the accuracy test.

@openshift-ci
Copy link

openshift-ci bot commented Sep 4, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: carbonin, eranco74

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 f85f588 into rh-ecosystem-edge:main Sep 4, 2025
7 checks passed
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.

4 participants