Thanks to visit codestin.com
Credit goes to github.com

Skip to content

LCORE-1472: use single config set#1467

Merged
radofuchs merged 5 commits into
lightspeed-core:mainfrom
radofuchs:LCORE_1472_single_config_set
Apr 7, 2026
Merged

LCORE-1472: use single config set#1467
radofuchs merged 5 commits into
lightspeed-core:mainfrom
radofuchs:LCORE_1472_single_config_set

Conversation

@radofuchs

@radofuchs radofuchs commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Description

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement
  • Benchmarks improvement

Tools used to create PR

Identify any AI code assistants used in this PR (for transparency and review context)

  • Assisted-by: (e.g., Claude, CodeRabbit, Ollama, etc., N/A if not used)
  • Generated by: (e.g., tool name and version; N/A if not used)

Related Tickets & Documents

  • Related Issue #Lcore 1472
  • Closes #

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

Summary by CodeRabbit

  • Chores
    • E2E test infra now accepts runtime overrides for the Llama host and port via environment variables.
    • Compose and pipeline scripts create ConfigMaps from explicit repo-root paths for more reliable runs.
  • Tests
    • Consolidated and removed many legacy per-environment test configs; resolution unified to a single config tree.
    • Added test helpers and steps to select and resolve the Lightspeed configuration directory; trimmed test list to a single feature.
  • Documentation
    • Updated E2E docs to reflect the simplified configuration layout.

@coderabbitai

coderabbitai Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@radofuchs has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 43 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 8 minutes and 43 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: e2414adf-6c19-495c-9bc5-5b7eed5d954a

📥 Commits

Reviewing files that changed from the base of the PR and between 1609027 and f141d7a.

📒 Files selected for processing (1)
  • docker-compose.yaml

Walkthrough

Introduce environment-driven LLaMA hostname/port for E2E, remove Prow-specific Lightspeed YAMLs in favor of shared server-mode templates, and consolidate test config resolution and pipeline scripts to use repository-root–anchored config locations and new path helpers.

Changes

Cohort / File(s) Summary
CI workflow
.github/workflows/e2e_tests.yaml
Added job-level env E2E_LLAMA_HOSTNAME with default `${{ vars.E2E_LLAMA_HOSTNAME
Compose & Library Compose
docker-compose.yaml, docker-compose-library.yaml
Added E2E_LLAMA_HOSTNAME (default llama-stack) and E2E_LLAMA_PORT (default 8321) env entries to lightspeed-stack service.
Docs
docs/e2e_testing.md
Removed Prow-specific Lightspeed YAML listings; document a single run.yaml in tests/e2e-prow/configs/.
Removed Prow configs
tests/e2e-prow/rhoai/configs/...
tests/e2e-prow/rhoai/configs/lightspeed-stack*.yaml (multiple)
Deleted ~13 Prow-specific Lightspeed stack YAMLs (auth variants, MCP variants, inline RAG, RBAC, cache, etc.).
Pipeline scripts
tests/e2e-prow/rhoai/pipeline.sh, tests/e2e-prow/rhoai/pipeline-konflux.sh
Switched ConfigMap creation to read config files from explicit $REPO_ROOT/tests/e2e/configuration/... paths instead of relative configs/ paths.
Server-mode configs (updated)
tests/e2e/configuration/server-mode/...
lightspeed-stack*.yaml (multiple)
Replaced hardcoded http://llama-stack:8321 with http://${env.E2E_LLAMA_HOSTNAME}:8321 for service.llama_stack.url across server-mode YAMLs.
E2E path & utils refactor
tests/e2e/features/environment.py, tests/e2e/features/steps/common.py, tests/e2e/utils/utils.py
Consolidated config path mapping to templated repo-relative paths; added repo-root helpers (absolute_repo_path, cluster_lightspeed_config_dir, cluster_lightspeed_config_path); added Behave step to set lightspeed config directory; updated resolution to prefer server-mode/ or library-mode/.
Feature & test list
tests/e2e/features/inline_rag.feature, tests/e2e/test_list.txt
Added Background step to set Lightspeed config directory to tests/e2e/configuration; reduced test_list to only features/faiss.feature.

Sequence Diagram(s)

sequenceDiagram
    participant CI as CI Workflow
    participant Compose as Docker Compose / Container
    participant Tests as E2E Tests (Behave)
    participant Llama as LLaMA Stack

    CI->>Compose: set E2E_LLAMA_HOSTNAME / E2E_LLAMA_PORT env
    CI->>Tests: start E2E pipeline (uses repo-root config paths)
    Compose->>Llama: container runtime exposes hostname/port (env)
    Tests->>Llama: read ${env.E2E_LLAMA_HOSTNAME} -> connect to http://${env.E2E_LLAMA_HOSTNAME}:8321
    Llama-->>Tests: respond to test requests
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'LCORE-1472: use single config set' directly reflects the main objective of consolidating configuration handling into a unified approach, as evidenced by removal of multiple environment-specific config files and centralization of config path logic.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

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

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.

@radofuchs radofuchs marked this pull request as ready for review April 7, 2026 08:53

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docker-compose.yaml`:
- Around line 101-103: The docker-compose env E2E_LLAMA_PORT is being set but
the mounted lightspeed-stack*.yaml still hardcodes llama_stack.url to use port
8321; update the lightspeed-stack*.yaml templates to interpolate the port (e.g.
use ${env.E2E_LLAMA_PORT} when constructing llama_stack.url) so the app's
upstream endpoint and the helper clients use the same port, or remove
E2E_LLAMA_PORT from docker-compose until you add that substitution; look for the
llama_stack.url key in the lightspeed-stack.yaml files and replace the literal
:8321 with an environment variable reference matching E2E_LLAMA_PORT.

In `@tests/e2e-prow/rhoai/pipeline.sh`:
- Around line 198-201: Replace the two raw oc create configmap invocations for
llama-stack-config and lightspeed-stack-config with the same apply pattern used
elsewhere: generate the ConfigMap YAML with --from-file and --dry-run=client -o
yaml and pipe to oc apply -f - so reruns won't fail with AlreadyExists; update
the commands that reference "$REPO_ROOT/tests/e2e-prow/rhoai/configs/run.yaml"
and "$REPO_ROOT/tests/e2e/configuration/server-mode/lightspeed-stack.yaml"
accordingly.

In `@tests/e2e/configuration/server-mode/lightspeed-stack-auth-rh-identity.yaml`:
- Line 11: The URL in the configuration hardcodes port 8321 while the hostname
already uses ${env.E2E_LLAMA_HOSTNAME}; update that URL to also use the
environment variable ${env.E2E_LLAMA_PORT} (i.e., change the url value that
currently uses :8321 to use :${env.E2E_LLAMA_PORT}) so the Llama Stack port is
parameterized consistently with the hostname.

In `@tests/e2e/configuration/server-mode/lightspeed-stack.yaml`:
- Line 12: The url line currently depends on E2E_LLAMA_HOSTNAME with no
fallback; change the env substitution to use the same defaulting pattern used
elsewhere so it won't break when the variable is missing (replace the value for
the url key that uses E2E_LLAMA_HOSTNAME with a default, e.g. use
${env.E2E_LLAMA_HOSTNAME:-localhost} so the url becomes
http://${env.E2E_LLAMA_HOSTNAME:-localhost}:8321).

In `@tests/e2e/features/environment.py`:
- Around line 60-62: _get_config_path currently returns repo-relative paths
which fail in Prow; change it to return absolute paths. Update the function
_get_config_path to resolve the stored _CONFIG_PATHS entry against the
repository root (use Path(__file__).resolve().parents[...] or equivalent) and
return an absolute path (Path(...).resolve().as_posix() or
str(Path(...).resolve())). Ensure callers like before_feature, before_scenario
and switch_config receive the absolute path so Prow/Konflux can locate the
YAMLs; keep the existing formatting with mode_dir when building the path.

In `@tests/e2e/features/steps/common.py`:
- Around line 36-49: The tests leak context.lightspeed_stack_config_directory
across features causing state bleed; update the Behave after_feature(context,
feature) hook to remove this attribute if present (use hasattr(context,
"lightspeed_stack_config_directory") then delattr(context,
"lightspeed_stack_config_directory")) so each feature starts clean; ensure the
existing before_feature/after_feature hooks remain but add this cleanup
alongside them and reference the step function
set_lightspeed_stack_config_directory which sets the attribute.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d0012aa4-3807-40bd-9540-4ef6d6f55717

📥 Commits

Reviewing files that changed from the base of the PR and between b7c6d08 and aebdd41.

📒 Files selected for processing (37)
  • .github/workflows/e2e_tests.yaml
  • docker-compose.yaml
  • docs/e2e_testing.md
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-auth-noop-token.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-auth-rh-identity.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-inline-rag.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-invalid-feedback-storage.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-invalid-mcp-file-auth.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-mcp-client-auth.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-mcp-file-auth.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-mcp-kubernetes-auth.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-mcp-oauth-auth.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-mcp.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-no-cache.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-rbac.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack.yaml
  • tests/e2e-prow/rhoai/pipeline-konflux.sh
  • tests/e2e-prow/rhoai/pipeline.sh
  • tests/e2e/configuration/server-mode/lightspeed-stack-auth-noop-token.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-auth-rh-identity.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-inline-rag.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-invalid-feedback-storage.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-invalid-mcp-file-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-client-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-file-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-kubernetes-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-oauth-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-no-cache.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-no-mcp.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-rbac.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack.yaml
  • tests/e2e/features/environment.py
  • tests/e2e/features/inline_rag.feature
  • tests/e2e/features/steps/common.py
  • tests/e2e/utils/utils.py
💤 Files with no reviewable changes (13)
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-auth-noop-token.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-invalid-feedback-storage.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-no-cache.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-mcp-client-auth.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-mcp-oauth-auth.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-invalid-mcp-file-auth.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-mcp-kubernetes-auth.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-mcp.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-auth-rh-identity.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-inline-rag.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-rbac.yaml
  • tests/e2e-prow/rhoai/configs/lightspeed-stack-mcp-file-auth.yaml
📜 Review details
⏰ 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). (5)
  • GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-on-pull-request
  • GitHub Check: build-pr
  • GitHub Check: E2E: library mode / ci
  • GitHub Check: E2E Tests for Lightspeed Evaluation job
  • GitHub Check: E2E: server mode / ci
🧰 Additional context used
📓 Path-based instructions (2)
tests/e2e/features/**/*.feature

📄 CodeRabbit inference engine (AGENTS.md)

Use behave (BDD) framework with Gherkin feature files for end-to-end tests

Files:

  • tests/e2e/features/inline_rag.feature
tests/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

tests/**/*.py: Use pytest for all unit and integration tests; do not use unittest
Use pytest.mark.asyncio marker for async unit tests

Files:

  • tests/e2e/features/environment.py
  • tests/e2e/utils/utils.py
  • tests/e2e/features/steps/common.py
🧠 Learnings (10)
📚 Learning: 2025-09-02T11:09:40.404Z
Learnt from: radofuchs
Repo: lightspeed-core/lightspeed-stack PR: 485
File: tests/e2e/features/environment.py:87-95
Timestamp: 2025-09-02T11:09:40.404Z
Learning: In the lightspeed-stack e2e tests, noop authentication tests use the default lightspeed-stack.yaml configuration, while noop-with-token tests use the Authorized tag to trigger a config swap to the specialized noop-with-token configuration file.

Applied to files:

  • tests/e2e/configuration/server-mode/lightspeed-stack-auth-rh-identity.yaml
  • tests/e2e/features/inline_rag.feature
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-file-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-auth-noop-token.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-oauth-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-invalid-mcp-file-auth.yaml
📚 Learning: 2025-12-18T10:21:09.038Z
Learnt from: are-ces
Repo: lightspeed-core/lightspeed-stack PR: 935
File: run.yaml:114-115
Timestamp: 2025-12-18T10:21:09.038Z
Learning: In Llama Stack version 0.3.x, telemetry provider configuration is not supported under the `providers` section in run.yaml configuration files. Telemetry can be enabled with just `telemetry.enabled: true` without requiring an explicit provider block.

Applied to files:

  • tests/e2e/configuration/server-mode/lightspeed-stack-auth-rh-identity.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-inline-rag.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-file-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-auth-noop-token.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-oauth-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-no-cache.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-no-mcp.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-rbac.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-invalid-feedback-storage.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-kubernetes-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-client-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-invalid-mcp-file-auth.yaml
📚 Learning: 2026-04-05T12:19:36.009Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-05T12:19:36.009Z
Learning: Place E2E step definitions in `tests/e2e/features/steps/`

Applied to files:

  • tests/e2e/features/inline_rag.feature
  • tests/e2e/features/steps/common.py
📚 Learning: 2026-04-05T12:19:36.009Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-05T12:19:36.009Z
Learning: Applies to tests/e2e/features/**/*.feature : Use behave (BDD) framework with Gherkin feature files for end-to-end tests

Applied to files:

  • tests/e2e/features/inline_rag.feature
📚 Learning: 2025-09-02T11:15:02.411Z
Learnt from: radofuchs
Repo: lightspeed-core/lightspeed-stack PR: 485
File: tests/e2e/test_list.txt:2-3
Timestamp: 2025-09-02T11:15:02.411Z
Learning: In the lightspeed-stack e2e tests, the Authorized tag is intentionally omitted from noop authentication tests because they are designed to test against the default lightspeed-stack.yaml configuration rather than the specialized noop-with-token configuration.

Applied to files:

  • tests/e2e/features/inline_rag.feature
  • tests/e2e/configuration/server-mode/lightspeed-stack-auth-noop-token.yaml
📚 Learning: 2025-09-02T11:09:23.107Z
Learnt from: radofuchs
Repo: lightspeed-core/lightspeed-stack PR: 485
File: tests/e2e/features/authorized_noop.feature:11-11
Timestamp: 2025-09-02T11:09:23.107Z
Learning: The authorized endpoint in the lightspeed-stack project does not use the /v1 API prefix and should be accessed directly as "authorized" rather than "/v1/authorized".

Applied to files:

  • tests/e2e/features/inline_rag.feature
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-auth.yaml
📚 Learning: 2026-04-05T12:19:36.009Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-05T12:19:36.009Z
Learning: Applies to src/**/*.py : Use `from llama_stack_client import AsyncLlamaStackClient` for Llama Stack imports

Applied to files:

  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-file-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-auth-noop-token.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-oauth-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-no-cache.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-no-mcp.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-rbac.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-invalid-feedback-storage.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-kubernetes-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-mcp-client-auth.yaml
  • tests/e2e/configuration/server-mode/lightspeed-stack-invalid-mcp-file-auth.yaml
📚 Learning: 2026-02-19T10:06:58.708Z
Learnt from: radofuchs
Repo: lightspeed-core/lightspeed-stack PR: 1181
File: tests/e2e-prow/rhoai/manifests/lightspeed/mock-jwks.yaml:32-34
Timestamp: 2026-02-19T10:06:58.708Z
Learning: In tests/e2e-prow/rhoai/, ConfigMaps like mock-jwks-script and mcp-mock-server-script are created dynamically by the pipeline.sh deployment script using `oc create configmap` commands, rather than being defined as static ConfigMap resources in the manifest YAML files.

Applied to files:

  • tests/e2e-prow/rhoai/pipeline-konflux.sh
  • tests/e2e-prow/rhoai/pipeline.sh
  • docs/e2e_testing.md
📚 Learning: 2026-04-05T12:19:36.009Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-05T12:19:36.009Z
Learning: Maintain E2E test list in `tests/e2e/test_list.txt`

Applied to files:

  • docs/e2e_testing.md
📚 Learning: 2025-08-25T09:11:38.701Z
Learnt from: radofuchs
Repo: lightspeed-core/lightspeed-stack PR: 445
File: tests/e2e/features/environment.py:0-0
Timestamp: 2025-08-25T09:11:38.701Z
Learning: In the Behave Python testing framework, the Context object is created once for the entire test run and reused across all features and scenarios. Custom attributes added to the context persist until explicitly cleared, so per-scenario state should be reset in hooks to maintain test isolation.

Applied to files:

  • tests/e2e/features/steps/common.py
🔇 Additional comments (15)
tests/e2e/configuration/server-mode/lightspeed-stack-mcp-file-auth.yaml (1)

12-12: Same environment variable pattern as other server-mode configs.

This file uses the same ${env.E2E_LLAMA_HOSTNAME} pattern. The concerns about environment variable fallback behavior and port parameterization raised for lightspeed-stack-auth-rh-identity.yaml apply here as well.

tests/e2e/configuration/server-mode/lightspeed-stack-mcp-oauth-auth.yaml (1)

12-12: Same environment variable pattern as other server-mode configs.

This file follows the same ${env.E2E_LLAMA_HOSTNAME} pattern. See the review comment on lightspeed-stack-auth-rh-identity.yaml for detailed concerns about environment variable handling and port parameterization.

tests/e2e/configuration/server-mode/lightspeed-stack-mcp.yaml (1)

12-12: Same environment variable pattern as other server-mode configs.

This file follows the same ${env.E2E_LLAMA_HOSTNAME} pattern. Refer to the review comment on lightspeed-stack-auth-rh-identity.yaml for the analysis of environment variable handling and port parameterization concerns.

tests/e2e/configuration/server-mode/lightspeed-stack-mcp-auth.yaml (1)

12-12: Same environment variable pattern as other server-mode configs.

This file uses the same ${env.E2E_LLAMA_HOSTNAME} pattern. The environment variable handling and port parameterization concerns discussed in lightspeed-stack-auth-rh-identity.yaml apply equally here.

tests/e2e/configuration/server-mode/lightspeed-stack-rbac.yaml (1)

12-12: Same environment variable pattern as other server-mode configs.

This file follows the same ${env.E2E_LLAMA_HOSTNAME} pattern. The concerns about environment variable fallback and port parameterization raised for lightspeed-stack-auth-rh-identity.yaml apply to this file as well.

docs/e2e_testing.md (1)

78-78: Documentation update correctly reflects the consolidated config approach.

The updated comment accurately describes the new structure where tests/e2e-prow/configs/ contains only the vLLM Llama Stack run.yaml used by the Prow pipeline, aligning with the PR's objective to consolidate Prow-specific configurations.

tests/e2e/features/inline_rag.feature (1)

8-8: 🧹 Nitpick | 🔵 Trivial

Remove the redundant configuration directory step.

The explicit step on line 8 sets the configuration directory to tests/e2e/configuration, which is already the default used by the configure_service step when this directive is omitted. Other feature files (e.g., tls.feature) rely on this default without explicitly setting it. This line adds unnecessary verbosity without changing behavior.

⛔ Skipped due to learnings
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-05T12:19:36.009Z
Learning: Place E2E step definitions in `tests/e2e/features/steps/`
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-05T12:19:36.009Z
Learning: Applies to tests/e2e/features/**/*.feature : Use behave (BDD) framework with Gherkin feature files for end-to-end tests
Learnt from: radofuchs
Repo: lightspeed-core/lightspeed-stack PR: 485
File: tests/e2e/features/environment.py:87-95
Timestamp: 2025-09-02T11:09:40.404Z
Learning: In the lightspeed-stack e2e tests, noop authentication tests use the default lightspeed-stack.yaml configuration, while noop-with-token tests use the Authorized tag to trigger a config swap to the specialized noop-with-token configuration file.
Learnt from: radofuchs
Repo: lightspeed-core/lightspeed-stack PR: 485
File: tests/e2e/test_list.txt:2-3
Timestamp: 2025-09-02T11:15:02.411Z
Learning: In the lightspeed-stack e2e tests, the Authorized tag is intentionally omitted from noop authentication tests because they are designed to test against the default lightspeed-stack.yaml configuration rather than the specialized noop-with-token configuration.
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-05T12:19:36.009Z
Learning: Maintain E2E test list in `tests/e2e/test_list.txt`
Learnt from: onmete
Repo: lightspeed-core/lightspeed-stack PR: 417
File: src/lightspeed_stack.py:60-63
Timestamp: 2025-08-19T08:57:27.714Z
Learning: In the lightspeed-stack project, file permission hardening (chmod 0o600) for stored configuration JSON files is not required as it's not considered a security concern in their deployment environment.
tests/e2e/configuration/server-mode/lightspeed-stack-invalid-mcp-file-auth.yaml (1)

12-12: Same fallback gap as the base server-mode config.

Line 12 has the same missing default for E2E_LLAMA_HOSTNAME; please apply the same fix used for tests/e2e/configuration/server-mode/lightspeed-stack.yaml (Line 12).

tests/e2e/configuration/server-mode/lightspeed-stack-mcp-kubernetes-auth.yaml (1)

12-12: Duplicate of the hostname fallback concern.

Line 12 should mirror the same defaulted env pattern to avoid runner-specific failures.

tests/e2e/configuration/server-mode/lightspeed-stack-auth-noop-token.yaml (1)

16-16: Looks good.

Line 16 correctly switches to environment-driven hostname resolution while keeping the existing port and auth flow unchanged.

tests/e2e/configuration/server-mode/lightspeed-stack-no-cache.yaml (1)

16-16: LGTM for this config update.

Line 16 is consistent with the single-config-set approach for host resolution in E2E.

tests/e2e/configuration/server-mode/lightspeed-stack-no-mcp.yaml (1)

12-12: Looks correct.

Line 12 applies the same env-based hostname strategy consistently for the no-MCP variant.

tests/e2e/configuration/server-mode/lightspeed-stack-inline-rag.yaml (1)

11-11: Good consistency update.

Line 11 aligns inline-RAG server-mode config with the same env-driven llama host pattern.

tests/e2e-prow/rhoai/pipeline-konflux.sh (1)

148-150: E2E_LLAMA_HOSTNAME is properly injected in Konflux deployments.

The environment variable is explicitly exported in pipeline-services-konflux.sh at line 28 before the lightspeed-stack pod is deployed, setting it to llama-stack-service-svc.${NAMESPACE}.svc.cluster.local. The manifest declares the env var in the pod, and the mounted config files use the ${env.E2E_LLAMA_HOSTNAME} syntax which Lightspeed resolves at runtime. No action needed.

tests/e2e-prow/rhoai/pipeline.sh (1)

197-201: Environment variable injection is properly configured.

The lightspeed-stack pod correctly receives E2E_LLAMA_HOSTNAME through the manifest: the pod spec in tests/e2e-prow/rhoai/manifests/lightspeed/lightspeed-stack.yaml (lines 20–24) defines the env var sourced from the llama-stack-ip-secret secret, which is populated by pipeline-services.sh (line 23) after the service endpoint is created. The shared lightspeed-stack.yaml config file (mounted at line 59) can safely resolve ${env.E2E_LLAMA_HOSTNAME} at runtime.

Comment thread docker-compose.yaml
Comment on lines +101 to +103
# Substituted in mounted lightspeed-stack.yaml (llama_stack.url); GitHub Actions sets via vars
- E2E_LLAMA_HOSTNAME=${E2E_LLAMA_HOSTNAME:-llama-stack}
- E2E_LLAMA_PORT=${E2E_LLAMA_PORT:-8321}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

E2E_LLAMA_PORT is not wired through the mounted YAML yet.

The shared lightspeed-stack*.yaml files still build llama_stack.url as http://${env.E2E_LLAMA_HOSTNAME}:8321, so overriding E2E_LLAMA_PORT here only changes the helper clients, not the app's upstream endpoint. Either substitute ${env.E2E_LLAMA_PORT} in those YAMLs as well or drop this env until the override is supported end-to-end.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docker-compose.yaml` around lines 101 - 103, The docker-compose env
E2E_LLAMA_PORT is being set but the mounted lightspeed-stack*.yaml still
hardcodes llama_stack.url to use port 8321; update the lightspeed-stack*.yaml
templates to interpolate the port (e.g. use ${env.E2E_LLAMA_PORT} when
constructing llama_stack.url) so the app's upstream endpoint and the helper
clients use the same port, or remove E2E_LLAMA_PORT from docker-compose until
you add that substitution; look for the llama_stack.url key in the
lightspeed-stack.yaml files and replace the literal :8321 with an environment
variable reference matching E2E_LLAMA_PORT.

Comment on lines +198 to +201
oc create configmap llama-stack-config -n "$NAMESPACE" \
--from-file="$REPO_ROOT/tests/e2e-prow/rhoai/configs/run.yaml"
oc create configmap lightspeed-stack-config -n "$NAMESPACE" \
--from-file="$REPO_ROOT/tests/e2e/configuration/server-mode/lightspeed-stack.yaml"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Use oc apply for these ConfigMaps.

The namespace is reused at Line 44, so raw oc create configmap makes reruns fail with AlreadyExists before the services come up. The rest of this script already uses --dry-run=client -o yaml | oc apply -f -, and these two ConfigMaps need the same treatment.

♻️ Suggested fix
-oc create configmap llama-stack-config -n "$NAMESPACE" \
-  --from-file="$REPO_ROOT/tests/e2e-prow/rhoai/configs/run.yaml"
-oc create configmap lightspeed-stack-config -n "$NAMESPACE" \
-  --from-file="$REPO_ROOT/tests/e2e/configuration/server-mode/lightspeed-stack.yaml"
+oc create configmap llama-stack-config -n "$NAMESPACE" \
+  --from-file=run.yaml="$REPO_ROOT/tests/e2e-prow/rhoai/configs/run.yaml" \
+  --dry-run=client -o yaml | oc apply -f -
+oc create configmap lightspeed-stack-config -n "$NAMESPACE" \
+  --from-file=lightspeed-stack.yaml="$REPO_ROOT/tests/e2e/configuration/server-mode/lightspeed-stack.yaml" \
+  --dry-run=client -o yaml | oc apply -f -
📝 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
oc create configmap llama-stack-config -n "$NAMESPACE" \
--from-file="$REPO_ROOT/tests/e2e-prow/rhoai/configs/run.yaml"
oc create configmap lightspeed-stack-config -n "$NAMESPACE" \
--from-file="$REPO_ROOT/tests/e2e/configuration/server-mode/lightspeed-stack.yaml"
oc create configmap llama-stack-config -n "$NAMESPACE" \
--from-file=run.yaml="$REPO_ROOT/tests/e2e-prow/rhoai/configs/run.yaml" \
--dry-run=client -o yaml | oc apply -f -
oc create configmap lightspeed-stack-config -n "$NAMESPACE" \
--from-file=lightspeed-stack.yaml="$REPO_ROOT/tests/e2e/configuration/server-mode/lightspeed-stack.yaml" \
--dry-run=client -o yaml | oc apply -f -
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/e2e-prow/rhoai/pipeline.sh` around lines 198 - 201, Replace the two raw
oc create configmap invocations for llama-stack-config and
lightspeed-stack-config with the same apply pattern used elsewhere: generate the
ConfigMap YAML with --from-file and --dry-run=client -o yaml and pipe to oc
apply -f - so reruns won't fail with AlreadyExists; update the commands that
reference "$REPO_ROOT/tests/e2e-prow/rhoai/configs/run.yaml" and
"$REPO_ROOT/tests/e2e/configuration/server-mode/lightspeed-stack.yaml"
accordingly.

llama_stack:
use_as_library_client: false
url: http://llama-stack:8321
url: http://${env.E2E_LLAMA_HOSTNAME}:8321

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify how replace_env_vars handles missing environment variables
# and check E2E_LLAMA_PORT usage across config files

echo "=== Checking replace_env_vars implementation ==="
rg -n -A 10 "def replace_env_vars" src/

echo -e "\n=== Checking E2E_LLAMA_PORT usage in config files ==="
rg -n "E2E_LLAMA_PORT" tests/e2e/

echo -e "\n=== Checking if port 8321 is hardcoded in server-mode configs ==="
fd -e yaml . tests/e2e/configuration/server-mode/ --exec rg -n ":8321"

Repository: lightspeed-core/lightspeed-stack

Length of output: 1300


🏁 Script executed:

#!/bin/bash

echo "=== Searching for env var substitution implementation ==="
rg -n "\${env\." tests/e2e/ | head -20

echo -e "\n=== Looking for how ${env.X} syntax is processed ==="
rg -n -B2 -A5 "env\." src/ tests/e2e/ | grep -E "(replace|substitute|process|template)" | head -20

echo -e "\n=== Checking documentation file ==="
find . -name "*e2e*" -type f | grep -i doc

echo -e "\n=== Checking llama_stack_utils.py for env var handling ==="
head -50 tests/e2e/utils/llama_stack_utils.py

echo -e "\n=== Checking if replace_env_vars exists in Python anywhere ==="
rg -n "replace_env_vars" .

Repository: lightspeed-core/lightspeed-stack

Length of output: 2993


🏁 Script executed:

#!/bin/bash

echo "=== Searching for config file loading and env var processing ==="
rg -n "replace_env_vars" -A3 -B3 src/configuration.py src/llama_stack_configuration.py

echo -e "\n=== Looking for where YAML config files are loaded ==="
rg -n "\.yaml\|config_path\|load.*config" tests/e2e/ | head -20

echo -e "\n=== Checking the actual test that uses the file under review ==="
rg -n "lightspeed-stack-auth-rh-identity" tests/e2e/

echo -e "\n=== Checking docs/e2e_testing.md for env var documentation ==="
head -150 docs/e2e_testing.md | tail -50

Repository: lightspeed-core/lightspeed-stack

Length of output: 5882


Parameterize the Llama Stack port for consistency with the hostname.

The URL uses ${env.E2E_LLAMA_HOSTNAME} for the hostname but hardcodes the port as :8321. Since E2E_LLAMA_PORT is an environment variable defined in the E2E framework (documented in docs/e2e_testing.md with a default of 8321), the port should also be parameterized as ${env.E2E_LLAMA_PORT} for consistency and flexibility.

Change:

url: http://${env.E2E_LLAMA_HOSTNAME}:${env.E2E_LLAMA_PORT}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/e2e/configuration/server-mode/lightspeed-stack-auth-rh-identity.yaml`
at line 11, The URL in the configuration hardcodes port 8321 while the hostname
already uses ${env.E2E_LLAMA_HOSTNAME}; update that URL to also use the
environment variable ${env.E2E_LLAMA_PORT} (i.e., change the url value that
currently uses :8321 to use :${env.E2E_LLAMA_PORT}) so the Llama Stack port is
parameterized consistently with the hostname.

# Server mode - connects to separate llama-stack service
use_as_library_client: false
url: http://llama-stack:8321
url: http://${env.E2E_LLAMA_HOSTNAME}:8321

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add a default for E2E_LLAMA_HOSTNAME to prevent env-dependent breakage.

Line 12 introduces a hard dependency on E2E_LLAMA_HOSTNAME with no fallback. This can break runs where that variable is not injected. Use the same defaulting pattern already used elsewhere in this file.

🔧 Proposed fix
-  url: http://${env.E2E_LLAMA_HOSTNAME}:8321
+  url: http://${env.E2E_LLAMA_HOSTNAME:=llama-stack}:8321
📝 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
url: http://${env.E2E_LLAMA_HOSTNAME}:8321
url: http://${env.E2E_LLAMA_HOSTNAME:=llama-stack}:8321
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/e2e/configuration/server-mode/lightspeed-stack.yaml` at line 12, The
url line currently depends on E2E_LLAMA_HOSTNAME with no fallback; change the
env substitution to use the same defaulting pattern used elsewhere so it won't
break when the variable is missing (replace the value for the url key that uses
E2E_LLAMA_HOSTNAME with a default, e.g. use ${env.E2E_LLAMA_HOSTNAME:-localhost}
so the url becomes http://${env.E2E_LLAMA_HOSTNAME:-localhost}:8321).

Comment on lines 60 to +62
def _get_config_path(config_name: str, mode_dir: str) -> str:
"""Get the appropriate config path based on environment."""
docker_path_template, prow_path = _CONFIG_PATHS[config_name]
if is_prow_environment():
return prow_path
return docker_path_template.format(mode_dir=mode_dir)
"""Resolve repo-relative path to a Lightspeed stack YAML for the current mode."""
return _CONFIG_PATHS[config_name].format(mode_dir=mode_dir)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Return absolute paths from _get_config_path() in Prow.

before_feature() and before_scenario() feed this helper straight into switch_config(). In Prow that call updates the ConfigMap from the runner filesystem, so returning a repo-relative string here still depends on Behave's cwd, unlike the new absolute-path handling in tests/e2e/features/steps/common.py. Tag-driven config switches can therefore still miss their YAMLs in Prow/Konflux.

🛠️ Suggested fix
 from tests.e2e.utils.utils import (
+    absolute_repo_path,
     clear_llama_stack_storage,
     create_config_backup,
     is_prow_environment,
     remove_config_backup,
     restart_container,
@@
 def _get_config_path(config_name: str, mode_dir: str) -> str:
     """Resolve repo-relative path to a Lightspeed stack YAML for the current mode."""
-    return _CONFIG_PATHS[config_name].format(mode_dir=mode_dir)
+    path = _CONFIG_PATHS[config_name].format(mode_dir=mode_dir)
+    return absolute_repo_path(path) if is_prow_environment() else path
📝 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
def _get_config_path(config_name: str, mode_dir: str) -> str:
"""Get the appropriate config path based on environment."""
docker_path_template, prow_path = _CONFIG_PATHS[config_name]
if is_prow_environment():
return prow_path
return docker_path_template.format(mode_dir=mode_dir)
"""Resolve repo-relative path to a Lightspeed stack YAML for the current mode."""
return _CONFIG_PATHS[config_name].format(mode_dir=mode_dir)
def _get_config_path(config_name: str, mode_dir: str) -> str:
"""Resolve repo-relative path to a Lightspeed stack YAML for the current mode."""
path = _CONFIG_PATHS[config_name].format(mode_dir=mode_dir)
return absolute_repo_path(path) if is_prow_environment() else path
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/e2e/features/environment.py` around lines 60 - 62, _get_config_path
currently returns repo-relative paths which fail in Prow; change it to return
absolute paths. Update the function _get_config_path to resolve the stored
_CONFIG_PATHS entry against the repository root (use
Path(__file__).resolve().parents[...] or equivalent) and return an absolute path
(Path(...).resolve().as_posix() or str(Path(...).resolve())). Ensure callers
like before_feature, before_scenario and switch_config receive the absolute path
so Prow/Konflux can locate the YAMLs; keep the existing formatting with mode_dir
when building the path.

Comment thread tests/e2e/features/steps/common.py

@tisnik tisnik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice cleanup, LGTM

@tisnik

tisnik commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Missing import

The functions _e2e_repo_root, absolute_repo_path, cluster_lightspeed_config_dir, and cluster_lightspeed_config_path all reference the os module (e.g. os.getenv, os.path.normpath) but the module does not import os. This will raise a NameError at runtime.

_DEFAULT_CLUSTER_LIGHTSPEED_CONFIG_DIR = "tests/e2e/configuration/server-mode"


def _e2e_repo_root() -> str:
    """Absolute path to repository root (for Prow/Konflux runners and local behave).

    Set ``E2E_REPO_ROOT`` when the process cwd is not the repo or checkout layout
    differs. Otherwise derived from this file: ``tests/e2e/utils/utils.py`` → root.
    """
    env = os.getenv("E2E_REPO_ROOT", "").strip()
    if env:
        return os.path.abspath(env)
    return os.path.normpath(
        os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "..")
    )


def absolute_repo_path(repo_relative: str) -> str:
    """Return an absolute path for a location given relative to the repository root.

    Used on Prow so ``oc`` and file reads do not depend on the process working
    directory. If ``repo_relative`` is already absolute, it is normalized and
    returned unchanged.

    Parameters:
        repo_relative: Path relative to the repo root, or an absolute path.

    Returns:
        Normalized absolute filesystem path.
    """
    rel = repo_relative.strip()
    if os.path.isabs(rel):
        return os.path.normpath(rel)
    return os.path.normpath(os.path.join(_e2e_repo_root(), rel))


def is_prow_environment() -> bool:
    """Check if running in Prow/OpenShift environment."""
    return os.getenv("RUNNING_PROW") is not None


def cluster_lightspeed_config_dir() -> str:
    """Directory of Lightspeed YAML files used for Prow/Konflux (ConfigMap sources).

    Paths are relative to the repository root. Pipelines set
    ``E2E_LIGHTSPEED_CONFIG_DIR`` explicitly so local and CI agree on one variable;
    when unset, defaults to ``tests/e2e/configuration/server-mode``.

    Returns:
        Non-empty repo-relative directory path.
    """
    raw = os.getenv("E2E_LIGHTSPEED_CONFIG_DIR", _DEFAULT_CLUSTER_LIGHTSPEED_CONFIG_DIR)
    stripped = raw.strip()
    return stripped if stripped else _DEFAULT_CLUSTER_LIGHTSPEED_CONFIG_DIR


def cluster_lightspeed_config_path(filename: str) -> str:
    """Absolute path to a Lightspeed stack YAML used for Prow/OpenShift ConfigMap updates.

    The cluster loads config from the ConfigMap; Behave/e2e-ops must read the same
    YAML from the **runner filesystem**. Using an absolute path anchored at the repo
    root avoids failures when behave's cwd is not the repository root.

    Parameters:
        filename: Basename of the Lightspeed stack YAML.

    Returns:
        Absolute path suitable for ``switch_config`` and ``oc --from-file`` on CI.
    """
    base = cluster_lightspeed_config_dir()
    if os.path.isabs(base):
        return os.path.normpath(os.path.join(base, filename))
    return os.path.normpath(os.path.join(_e2e_repo_root(), base, filename))

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docker-compose-library.yaml`:
- Line 79: Add the missing E2E_LLAMA_PORT environment export to
docker-compose-library.yaml to match docker-compose.yaml and prevent config
drift: locate the E2E_LLAMA_HOSTNAME line
(E2E_LLAMA_HOSTNAME=${E2E_LLAMA_HOSTNAME:-llama-stack}) and add a sibling export
for E2E_LLAMA_PORT with a sensible default (e.g.,
E2E_LLAMA_PORT=${E2E_LLAMA_PORT:-<default_port>}) so both hostname and port are
provided consistently for consumers that rely on E2E_LLAMA_HOSTNAME and
E2E_LLAMA_PORT.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: cd5b75e9-4050-43c5-95da-ab56692de70c

📥 Commits

Reviewing files that changed from the base of the PR and between aebdd41 and 2c1007d.

📒 Files selected for processing (1)
  • docker-compose-library.yaml
📜 Review details
⏰ 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). (4)
  • GitHub Check: E2E: server mode / ci
  • GitHub Check: E2E: library mode / ci
  • GitHub Check: E2E Tests for Lightspeed Evaluation job
  • GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-on-pull-request

Comment thread docker-compose-library.yaml Outdated
- LLAMA_STACK_LOGGING=${LLAMA_STACK_LOGGING:-}
# FAISS test and inline RAG config
- FAISS_VECTOR_STORE_ID=${FAISS_VECTOR_STORE_ID:-}
- E2E_LLAMA_HOSTNAME=${E2E_LLAMA_HOSTNAME:-llama-stack}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add E2E_LLAMA_PORT here as well to avoid config drift.

At Line 79, docker-compose-library.yaml exports only hostname, while docker-compose.yaml:98-110 exports both hostname and port. This creates a split contract for shared config resolution and can break overrides when port needs to vary.

Proposed fix
     environment:
@@
       - FAISS_VECTOR_STORE_ID=${FAISS_VECTOR_STORE_ID:-}
       - E2E_LLAMA_HOSTNAME=${E2E_LLAMA_HOSTNAME:-llama-stack}
+      - E2E_LLAMA_PORT=${E2E_LLAMA_PORT:-8321}
📝 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
- E2E_LLAMA_HOSTNAME=${E2E_LLAMA_HOSTNAME:-llama-stack}
- E2E_LLAMA_HOSTNAME=${E2E_LLAMA_HOSTNAME:-llama-stack}
- E2E_LLAMA_PORT=${E2E_LLAMA_PORT:-8321}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docker-compose-library.yaml` at line 79, Add the missing E2E_LLAMA_PORT
environment export to docker-compose-library.yaml to match docker-compose.yaml
and prevent config drift: locate the E2E_LLAMA_HOSTNAME line
(E2E_LLAMA_HOSTNAME=${E2E_LLAMA_HOSTNAME:-llama-stack}) and add a sibling export
for E2E_LLAMA_PORT with a sensible default (e.g.,
E2E_LLAMA_PORT=${E2E_LLAMA_PORT:-<default_port>}) so both hostname and port are
provided consistently for consumers that rely on E2E_LLAMA_HOSTNAME and
E2E_LLAMA_PORT.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/e2e/test_list.txt`:
- Line 1: The PR mistakenly replaced the E2E feature list with only
"features/faiss.feature" in tests/e2e/test_list.txt which reduces coverage;
restore the full set of feature file paths in tests/e2e/test_list.txt (revert to
the prior list or re-add all feature filenames that were removed) so make
test-e2e runs the complete suite, or if this is a temporary debug change, gate
it behind an explicit non-mergeable flag/branch and document that in the commit
message; ensure the commit touches tests/e2e/test_list.txt and that CI (make
test-e2e) runs all previously included features rather than only
features/faiss.feature.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 668f53b4-a617-48ec-8960-cd811854f738

📥 Commits

Reviewing files that changed from the base of the PR and between 2c1007d and 1609027.

📒 Files selected for processing (1)
  • tests/e2e/test_list.txt
📜 Review details
⏰ 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). (5)
  • GitHub Check: build-pr
  • GitHub Check: E2E Tests for Lightspeed Evaluation job
  • GitHub Check: E2E: library mode / ci
  • GitHub Check: E2E: server mode / ci
  • GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-on-pull-request
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-04-05T12:19:36.009Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-05T12:19:36.009Z
Learning: Maintain E2E test list in `tests/e2e/test_list.txt`

Applied to files:

  • tests/e2e/test_list.txt
📚 Learning: 2026-04-05T12:19:36.009Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-05T12:19:36.009Z
Learning: Applies to tests/e2e/features/**/*.feature : Use behave (BDD) framework with Gherkin feature files for end-to-end tests

Applied to files:

  • tests/e2e/test_list.txt

Comment thread tests/e2e/test_list.txt Outdated
@radofuchs radofuchs merged commit 8897d1b into lightspeed-core:main Apr 7, 2026
22 of 26 checks passed
jrobertboos added a commit to jrobertboos/lightspeed-stack that referenced this pull request Apr 7, 2026
fix missing dep

potential fix

konflux

addressed comments

chore(deps): update konflux references

Signed-off-by: red-hat-konflux-kflux-prd-rh02 <190377777+red-hat-konflux-kflux-prd-rh02[bot]@users.noreply.github.com>

Fixes docstrings in conversation cache unit tests

Fixed docstrings in Splunk unit tests

Test docstrings in quota limiters unit tests

LCORE-1596: Branching graphs

feat: add shield moderation to rlsapi_v1 /infer endpoint

Wire run_shield_moderation() into the rlsapi_v1 /infer endpoint so CLA
requests go through the same safety checks as responses, query, and
streaming_query. When a shield blocks input, the refusal message is
returned as normal response text and the LLM call is skipped entirely.
No-op when no shields are configured.

RSPEED-2809

Signed-off-by: Major Hayden <[email protected]>

refactor: extract _check_shield_moderation helper, fix integration tests

Move the moderation logic out of infer_endpoint into a private helper
to avoid increasing the function's cyclomatic complexity (stays at C 13).

Add shield moderation mock to the integration tests so they don't hit
the real run_shield_moderation path with non-async client mocks.

Signed-off-by: Major Hayden <[email protected]>

LCORE-1441: Updated Konflux dependencies

Specific rule name when types are ignored: integration tests

Specific rule name when types are ignored: sources

Specific rule name when types are ignored: end to end tests

LCORE-1715: Fixes in LiteLLM package

LCORE-1472: use single config set (lightspeed-core#1467)

* LCORE-1472: use single config set

refactor: reduce infer_endpoint cyclomatic complexity from C(13) to B(7)

Extract helpers from infer_endpoint to eliminate the verbose mode
branching that inflated its complexity:

- _call_llm: transport-only LLM call (no metrics side effects)
- _is_verbose_enabled: the 3-way config+request check
- _build_infer_response: verbose vs minimal response construction,
  keyed on response object presence rather than a boolean flag

retrieve_simple_response now delegates to _call_llm internally and
handles its own token usage extraction. The verbose failure path in
infer_endpoint is preserved: if the LLM call succeeded but later
processing fails, token usage is still recorded.

No behavior changes, pure refactor.

Signed-off-by: Major Hayden <[email protected]>
jrobertboos added a commit to jrobertboos/lightspeed-stack that referenced this pull request Apr 7, 2026
fix missing dep

potential fix

konflux

addressed comments

chore(deps): update konflux references

Signed-off-by: red-hat-konflux-kflux-prd-rh02 <190377777+red-hat-konflux-kflux-prd-rh02[bot]@users.noreply.github.com>

Fixes docstrings in conversation cache unit tests

Fixed docstrings in Splunk unit tests

Test docstrings in quota limiters unit tests

LCORE-1596: Branching graphs

feat: add shield moderation to rlsapi_v1 /infer endpoint

Wire run_shield_moderation() into the rlsapi_v1 /infer endpoint so CLA
requests go through the same safety checks as responses, query, and
streaming_query. When a shield blocks input, the refusal message is
returned as normal response text and the LLM call is skipped entirely.
No-op when no shields are configured.

RSPEED-2809

Signed-off-by: Major Hayden <[email protected]>

refactor: extract _check_shield_moderation helper, fix integration tests

Move the moderation logic out of infer_endpoint into a private helper
to avoid increasing the function's cyclomatic complexity (stays at C 13).

Add shield moderation mock to the integration tests so they don't hit
the real run_shield_moderation path with non-async client mocks.

Signed-off-by: Major Hayden <[email protected]>

LCORE-1441: Updated Konflux dependencies

Specific rule name when types are ignored: integration tests

Specific rule name when types are ignored: sources

Specific rule name when types are ignored: end to end tests

LCORE-1715: Fixes in LiteLLM package

LCORE-1472: use single config set (lightspeed-core#1467)

* LCORE-1472: use single config set

refactor: reduce infer_endpoint cyclomatic complexity from C(13) to B(7)

Extract helpers from infer_endpoint to eliminate the verbose mode
branching that inflated its complexity:

- _call_llm: transport-only LLM call (no metrics side effects)
- _is_verbose_enabled: the 3-way config+request check
- _build_infer_response: verbose vs minimal response construction,
  keyed on response object presence rather than a boolean flag

retrieve_simple_response now delegates to _call_llm internally and
handles its own token usage extraction. The verbose failure path in
infer_endpoint is preserved: if the LLM call succeeded but later
processing fails, token usage is still recorded.

No behavior changes, pure refactor.

Signed-off-by: Major Hayden <[email protected]>
jrobertboos pushed a commit to jrobertboos/lightspeed-stack that referenced this pull request Apr 14, 2026
jrobertboos added a commit to jrobertboos/lightspeed-stack that referenced this pull request Apr 14, 2026
fix missing dep

potential fix

konflux

addressed comments

chore(deps): update konflux references

Signed-off-by: red-hat-konflux-kflux-prd-rh02 <190377777+red-hat-konflux-kflux-prd-rh02[bot]@users.noreply.github.com>

Fixes docstrings in conversation cache unit tests

Fixed docstrings in Splunk unit tests

Test docstrings in quota limiters unit tests

LCORE-1596: Branching graphs

feat: add shield moderation to rlsapi_v1 /infer endpoint

Wire run_shield_moderation() into the rlsapi_v1 /infer endpoint so CLA
requests go through the same safety checks as responses, query, and
streaming_query. When a shield blocks input, the refusal message is
returned as normal response text and the LLM call is skipped entirely.
No-op when no shields are configured.

RSPEED-2809

Signed-off-by: Major Hayden <[email protected]>

refactor: extract _check_shield_moderation helper, fix integration tests

Move the moderation logic out of infer_endpoint into a private helper
to avoid increasing the function's cyclomatic complexity (stays at C 13).

Add shield moderation mock to the integration tests so they don't hit
the real run_shield_moderation path with non-async client mocks.

Signed-off-by: Major Hayden <[email protected]>

LCORE-1441: Updated Konflux dependencies

Specific rule name when types are ignored: integration tests

Specific rule name when types are ignored: sources

Specific rule name when types are ignored: end to end tests

LCORE-1715: Fixes in LiteLLM package

LCORE-1472: use single config set (lightspeed-core#1467)

* LCORE-1472: use single config set

refactor: reduce infer_endpoint cyclomatic complexity from C(13) to B(7)

Extract helpers from infer_endpoint to eliminate the verbose mode
branching that inflated its complexity:

- _call_llm: transport-only LLM call (no metrics side effects)
- _is_verbose_enabled: the 3-way config+request check
- _build_infer_response: verbose vs minimal response construction,
  keyed on response object presence rather than a boolean flag

retrieve_simple_response now delegates to _call_llm internally and
handles its own token usage extraction. The verbose failure path in
infer_endpoint is preserved: if the LLM call succeeded but later
processing fails, token usage is still recorded.

No behavior changes, pure refactor.

Signed-off-by: Major Hayden <[email protected]>
Anxhela21 pushed a commit to Anxhela21/lightspeed-stack that referenced this pull request Apr 27, 2026
Anxhela21 pushed a commit to Anxhela21/lightspeed-stack that referenced this pull request Apr 27, 2026
fix missing dep

potential fix

konflux

addressed comments

chore(deps): update konflux references

Signed-off-by: red-hat-konflux-kflux-prd-rh02 <190377777+red-hat-konflux-kflux-prd-rh02[bot]@users.noreply.github.com>

Fixes docstrings in conversation cache unit tests

Fixed docstrings in Splunk unit tests

Test docstrings in quota limiters unit tests

LCORE-1596: Branching graphs

feat: add shield moderation to rlsapi_v1 /infer endpoint

Wire run_shield_moderation() into the rlsapi_v1 /infer endpoint so CLA
requests go through the same safety checks as responses, query, and
streaming_query. When a shield blocks input, the refusal message is
returned as normal response text and the LLM call is skipped entirely.
No-op when no shields are configured.

RSPEED-2809

Signed-off-by: Major Hayden <[email protected]>

refactor: extract _check_shield_moderation helper, fix integration tests

Move the moderation logic out of infer_endpoint into a private helper
to avoid increasing the function's cyclomatic complexity (stays at C 13).

Add shield moderation mock to the integration tests so they don't hit
the real run_shield_moderation path with non-async client mocks.

Signed-off-by: Major Hayden <[email protected]>

LCORE-1441: Updated Konflux dependencies

Specific rule name when types are ignored: integration tests

Specific rule name when types are ignored: sources

Specific rule name when types are ignored: end to end tests

LCORE-1715: Fixes in LiteLLM package

LCORE-1472: use single config set (lightspeed-core#1467)

* LCORE-1472: use single config set

refactor: reduce infer_endpoint cyclomatic complexity from C(13) to B(7)

Extract helpers from infer_endpoint to eliminate the verbose mode
branching that inflated its complexity:

- _call_llm: transport-only LLM call (no metrics side effects)
- _is_verbose_enabled: the 3-way config+request check
- _build_infer_response: verbose vs minimal response construction,
  keyed on response object presence rather than a boolean flag

retrieve_simple_response now delegates to _call_llm internally and
handles its own token usage extraction. The verbose failure path in
infer_endpoint is preserved: if the LLM call succeeded but later
processing fails, token usage is still recorded.

No behavior changes, pure refactor.

Signed-off-by: Major Hayden <[email protected]>
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