Skip to content

Conversation

@onmete
Copy link
Contributor

@onmete onmete commented Jul 22, 2025

Description

Some fixes to make uv work.

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

  • Documentation

    • Updated development setup instructions to use new commands and clarified virtual environment activation steps.
    • Renamed test commands in the contribution guide for consistency.
  • Chores

    • Modified test commands in the Makefile to use Python module syntax for running tests.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 22, 2025

Walkthrough

The development documentation and Makefile were updated to reflect new commands for setting up the environment and running tests. The documentation now uses updated uv commands and revised Makefile targets, while the Makefile itself invokes pytest via the Python module syntax for test execution.

Changes

File(s) Change Summary
CONTRIBUTING.md Updated setup instructions: replaced uv install -G dev with uv sync --group dev, added explicit uv venv activation, updated test targets to make test-unit and make test-integration, modified a comment about uv run.
Makefile Modified test-unit and test-integration targets to use python -m pytest instead of pytest.

Estimated code review effort

1 (~2 minutes)

Poem

In the warren of code, we hop and sync,
With uv venv magic, our tests in a blink!
Makefile commands now fresh and neat,
Pytest runs smoothly—oh, what a treat!
🐇✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a3b91da and a1f3f58.

📒 Files selected for processing (2)
  • CONTRIBUTING.md (1 hunks)
  • Makefile (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • Makefile
  • CONTRIBUTING.md
⏰ 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). (1)
  • GitHub Check: build-pr

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

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

Other keywords and placeholders

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

CodeRabbit Configuration File (.coderabbit.yaml)

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

Documentation and Community

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

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

🧹 Nitpick comments (2)
Makefile (1)

19-23: Minor typo in help string

## Run integration tests tests## Run the integration tests

Purely cosmetic but keeps make help output tidy.

CONTRIBUTING.md (1)

65-69: Mention e2e tests or drop the step for consistency

The doc calls out make test-unit and make test-integration but omits the test-e2e target that exists in the Makefile. Either add the third step here or explain why it is optional to avoid confusion.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 28abfaf and a3b91da.

📒 Files selected for processing (2)
  • CONTRIBUTING.md (1 hunks)
  • Makefile (1 hunks)

Comment on lines 59 to 62
uv sync --group dev

# Now you can run test commands trough make targets, or prefix the rest of commands with `uv run`, eg. `uv run make test`
# activate venv
uv venv

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

Clarify virtual-env activation

uv venv prints the venv path but does not activate it.
Newcomers may try to run make … in the host interpreter and hit missing-package errors.

Consider amending:

-# activate venv
-uv venv
+# activate venv
+source "$(uv venv)/bin/activate"

(or instruct to prefix every command with uv run).

📝 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
uv sync --group dev
# Now you can run test commands trough make targets, or prefix the rest of commands with `uv run`, eg. `uv run make test`
# activate venv
uv venv
uv sync --group dev
# activate venv
source "$(uv venv)/bin/activate"
🤖 Prompt for AI Agents
In CONTRIBUTING.md around lines 59 to 63, clarify that the command `uv venv`
only prints the virtual environment path and does not activate it. Update the
instructions to explicitly show how to activate the virtual environment in the
shell (e.g., source the activate script) or advise users to prefix commands with
`uv run` to ensure they run inside the virtual environment. This will prevent
confusion and missing-package errors for newcomers.

Comment on lines 14 to 18
test-unit: ## Run the unit tests
@echo "Running unit tests..."
@echo "Reports will be written to ${ARTIFACT_DIR}"
COVERAGE_FILE="${ARTIFACT_DIR}/.coverage.unit" uv run pytest tests/unit --cov=src --cov-report term-missing --cov-report "json:${ARTIFACT_DIR}/coverage_unit.json" --junit-xml="${ARTIFACT_DIR}/junit_unit.xml" --cov-fail-under=60
COVERAGE_FILE="${ARTIFACT_DIR}/.coverage.unit" uv run python -m pytest tests/unit --cov=src --cov-report term-missing --cov-report "json:${ARTIFACT_DIR}/coverage_unit.json" --junit-xml="${ARTIFACT_DIR}/junit_unit.xml" --cov-fail-under=60

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

Create ${ARTIFACT_DIR} before writing reports

pytest and the coverage/junit reporters assume the target directory already exists.
If ${ARTIFACT_DIR} is missing, the run silently falls back to the project root and pollutes it with artefacts.

 test-unit: ## Run the unit tests
 	@echo "Running unit tests..."
 	@echo "Reports will be written to ${ARTIFACT_DIR}"
+	@mkdir -p "${ARTIFACT_DIR}"
 	COVERAGE_FILE="${ARTIFACT_DIR}/.coverage.unit" uv run python -m pytest tests/unit --cov=src --cov-report term-missing --cov-report "json:${ARTIFACT_DIR}/coverage_unit.json" --junit-xml="${ARTIFACT_DIR}/junit_unit.xml" --cov-fail-under=60

Apply the same pre-creation in the test-integration target.

🤖 Prompt for AI Agents
In the Makefile around lines 14 to 18, the test-unit target writes coverage and
junit reports to ${ARTIFACT_DIR} without ensuring the directory exists, which
can cause files to be created in the project root if the directory is missing.
Fix this by adding a command to create the ${ARTIFACT_DIR} directory (e.g.,
mkdir -p ${ARTIFACT_DIR}) before running pytest in the test-unit target. Also,
apply the same directory creation step in the test-integration target to prevent
similar issues there.

Copy link
Contributor

@umago umago left a comment

Choose a reason for hiding this comment

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

Thanks, tested it locally and works fine


# run integration tests
make integration-tests
make test-integration
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catches!

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.

it looks ok

@tisnik tisnik merged commit fb6833a into lightspeed-core:main Jul 23, 2025
17 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.

3 participants