Skip to content

Conversation

@raptorsun
Copy link
Contributor

@raptorsun raptorsun commented Sep 2, 2025

Description

fix the error calling docker compose --version in e2e test scripts.

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

Related Tickets & Documents

  • Related Issue #
  • 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
    • Updated the end-to-end testing workflow to align with current container tooling, improving compatibility and reliability across CI environments.
    • Reduces intermittent failures in test runs and provides more consistent, faster feedback on pull requests.
    • No impact on user-facing features or behavior. This is an entirely maintenance-only change. Deployment process remains unaffected.

Signed-off-by: Haoyu Sun <hasun@redhat.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 2, 2025

Walkthrough

Updated the GitHub Actions e2e workflow to use docker compose version instead of docker compose --version in the manual service run step. No other changes.

Changes

Cohort / File(s) Summary
CI Workflow
.github/workflows/e2e_tests.yaml
Replaced Docker Compose version check command from docker compose --version to docker compose version.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

I hop through YAML fields so bright,
A tiny tweak, a version right—
Compose now speaks without the dash,
Our pipelines purr, no sudden crash.
Thump-thump! I sign with whiskered cheer,
Minor change, green carrots near! 🥕

✨ 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:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • 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.
  • 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.

Copy link
Contributor

@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

Caution

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

⚠️ Outside diff range comments (3)
.github/workflows/e2e_tests.yaml (3)

4-4: High risk: pull_request_target + job-level secrets exposes OPENAI_API_KEY to untrusted forks.

Untrusted PR code runs with repo secrets via the job-level env. Switch to pull_request or gate secrets to trusted contexts and move secrets to step-level.

-on: [push, pull_request_target]
+on: [push, pull_request]
@@
-    env:
-      OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
+    # Avoid exposing secrets to forked PRs. Provide secrets only in guarded steps:
+    # (add per-step)
+    # if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.fork == false }}
+    # env:
+    #   OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

If you must keep pull_request_target, run untrusted code without secrets and kick off a separate, trusted workflow via workflow_run for secret-requiring steps.

Also applies to: 10-11


235-244: Use explicit -f checks instead of ls | head when verifying Compose file

The suggested ls … | head snippet can mis-parse due to pipe and ! precedence, causing false negatives. Replace it with a straightforward file-existence test:

- name: Verify Docker Compose file exists
  run: |
    if [ ! -f docker-compose.yml ] && [ ! -f docker-compose.yaml ] && [ ! -f compose.yml ] && [ ! -f compose.yaml ]; then
      echo "ERROR: no Docker Compose file found in repo root"; exit 1
    fi
    docker compose version
    docker compose up -d

Apply the same check before the log-tail step (lines 253-256).


260-267: Ensure uv CLI is installed before uv sync. The uv binary is missing and no pyproject.toml or requirements.txt exists in this repo, so uv sync will always fail.

🧹 Nitpick comments (2)
.github/workflows/e2e_tests.yaml (2)

242-242: Add a compatibility fallback for environments with legacy docker-compose.

Guard against runners that still have the v1 binary only.

-          docker compose version
+          DOCKER_COMPOSE="docker compose"
+          $DOCKER_COMPOSE version >/dev/null 2>&1 || DOCKER_COMPOSE="docker-compose"
+          $DOCKER_COMPOSE version

245-249: Replace fixed sleep with a readiness probe.

Reduces flakiness and speeds up happy paths.

-          echo "Waiting for services to be healthy..."
-          sleep 20  # adjust depending on boot time
+          echo "Waiting for service to be ready (max 120s)..."
+          for i in {1..24}; do
+            if curl -fsS http://localhost:8080/healthz >/dev/null; then
+              echo "Service is ready."
+              break
+            fi
+            sleep 5
+          done

If no health endpoint, consider checking docker compose ps for healthy status.

📜 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 9c51e77 and 6071907.

📒 Files selected for processing (1)
  • .github/workflows/e2e_tests.yaml (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). (2)
  • GitHub Check: build-pr
  • GitHub Check: e2e_tests
🔇 Additional comments (1)
.github/workflows/e2e_tests.yaml (1)

242-242: Switch to docker compose version is correct.

Matches Compose v2 CLI; avoids the --version flag quirk.

Comment on lines 239 to 241
echo "OPENAI_API_KEY is set: $([ -n "$OPENAI_API_KEY" ] && echo 'YES' || echo 'NO')"
echo "OPENAI_API_KEY length: ${#OPENAI_API_KEY}"
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Do not print presence/length of OPENAI_API_KEY.

Even metadata leaks aid exfiltration attempts.

-          echo "OPENAI_API_KEY is set: $([ -n "$OPENAI_API_KEY" ] && echo 'YES' || echo 'NO')"
-          echo "OPENAI_API_KEY length: ${#OPENAI_API_KEY}"
+          echo "OPENAI_API_KEY present: [redacted]"

Or remove entirely.

📝 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
echo "OPENAI_API_KEY is set: $([ -n "$OPENAI_API_KEY" ] && echo 'YES' || echo 'NO')"
echo "OPENAI_API_KEY length: ${#OPENAI_API_KEY}"
echo "OPENAI_API_KEY present: [redacted]"
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 241-241: trailing spaces

(trailing-spaces)

🤖 Prompt for AI Agents
In .github/workflows/e2e_tests.yaml around lines 239 to 241, remove the two echo
lines that print the presence and length of OPENAI_API_KEY; do not output any
metadata about secret values. Delete those echo statements (or replace them with
a non-sensitive, generic log such as a static "OPENAI_API_KEY configured"
message that does not reveal presence, length, or any secret-derived info) to
prevent metadata leakage.

Copy link
Contributor

@tisnik tisnik left a comment

Choose a reason for hiding this comment

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

LGTM

@tisnik
Copy link
Contributor

tisnik commented Sep 3, 2025

/retest

@tisnik tisnik merged commit 53c0923 into lightspeed-core:main Sep 3, 2025
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants