Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Fix Ruff version mismatch and config issues#234

Merged
bennyz merged 5 commits intomainfrom
fix-ruff
Jan 27, 2025
Merged

Fix Ruff version mismatch and config issues#234
bennyz merged 5 commits intomainfrom
fix-ruff

Conversation

@kirkbrauer
Copy link
Copy Markdown
Member

@kirkbrauer kirkbrauer commented Jan 26, 2025

Summary by CodeRabbit

Summary by CodeRabbit

  • Chores
    • Updated GitHub Actions workflow configuration with minor capitalization changes.
    • Updated pre-commit configuration to use newer Ruff version (v0.9.2).
    • Updated Ruff dependency to exact version 0.9.2 in project configuration.
    • Modified Dockerfile to streamline the build process by using pre-built binaries.
  • New Features
    • Introduced a new command request to the lease command group for requesting an exporter lease.
  • Bug Fixes
    • Removed unnecessary Ruff dependency from development groups in multiple project configurations.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 26, 2025

Walkthrough

This pull request encompasses updates to various configuration files and a code addition in the CLI client. The changes primarily involve updating Ruff linting tool configurations across different files, including GitHub Actions workflow, pre-commit configuration, and project dependency specifications. Additionally, a new lease_request command is introduced in the jumpstarter CLI client, allowing users to request an exporter lease with label support.

Changes

File Change Summary
.github/workflows/ruff.yaml Step name capitalization updated from "Run ruff" to "Run Ruff"
.pre-commit-config.yaml - Ruff version updated from v0.3.5 to v0.9.2
- Hook names capitalized to "Ruff Check" and "Ruff Format"
__templates__/driver/pyproject.toml.tmpl Removed ruff>=0.7.1 from dev dependencies
packages/jumpstarter-cli-client/jumpstarter_cli_client/lease.py Added new lease_request command with -l labels option
pyproject.toml Updated Ruff dependency from >=0.9.2 to ==0.9.2
packages/jumpstarter-driver-http/pyproject.toml Removed ruff>=0.7.1 from dev dependencies

Suggested reviewers

  • mangelajo

Poem

🐰 Ruff's version dance, a config delight,
Workflows and hooks now shine so bright!
CLI leases bloom with grace,
A rabbit's code update, embraced with pace!
Precision is our coding might! 🔧


🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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.

@kirkbrauer kirkbrauer marked this pull request as ready for review January 26, 2025 17:16
Copy link
Copy Markdown
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

🔭 Outside diff range comments (1)
.pre-commit-config.yaml (1)

Line range hint 6-14: Fix indentation for hooks section.

The hooks section should be indented with 6 spaces according to YAML standards, but it's currently using 4 spaces.

Apply this diff to fix the indentation:

 repos:
   - repo: https://github.com/astral-sh/ruff-pre-commit
     rev: v0.9.3
     hooks:
-    - id: ruff
-      name: Ruff Check
-      description: "Run 'ruff check' for extremely fast Python linting"
-      args: [ --fix ]
-
-    - id: ruff-format
-      name: Ruff Format
-      description: "Run 'ruff format' for extremely fast Python formatting"
+      - id: ruff
+        name: Ruff Check
+        description: "Run 'ruff check' for extremely fast Python linting"
+        args: [ --fix ]
+
+      - id: ruff-format
+        name: Ruff Format
+        description: "Run 'ruff format' for extremely fast Python formatting"
🧰 Tools
🪛 yamllint (1.35.1)

[warning] 6-6: wrong indentation: expected 6 but found 4

(indentation)


[error] 13-13: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1c41c83 and 9ef8702.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .github/workflows/ruff.yaml (1 hunks)
  • .pre-commit-config.yaml (1 hunks)
  • __templates__/driver/pyproject.toml.tmpl (0 hunks)
  • packages/jumpstarter-cli-client/jumpstarter_cli_client/lease.py (1 hunks)
  • pyproject.toml (1 hunks)
💤 Files with no reviewable changes (1)
  • templates/driver/pyproject.toml.tmpl
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/ruff.yaml
🧰 Additional context used
🪛 yamllint (1.35.1)
.pre-commit-config.yaml

[warning] 6-6: wrong indentation: expected 6 but found 4

(indentation)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)
🔇 Additional comments (3)
.pre-commit-config.yaml (1)

4-4: Verify compatibility with the specified Ruff version.

The version update from v0.3.5 to v0.9.3 is significant. Let's verify this version exists and check for any breaking changes.

✅ Verification successful

Version update to Ruff v0.9.3 is compatible and follows best practices

The version exists in PyPI and the pre-commit configuration follows the official structure with both linting and formatting hooks properly configured.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify Ruff version compatibility
# Check if the version exists in PyPI
curl -s https://pypi.org/pypi/ruff/0.9.3/json | jq -r '.info.version'

# Check release notes for breaking changes
curl -s "https://api.github.com/repos/astral-sh/ruff/releases/tags/v0.9.3" | jq -r '.body'

Length of output: 169


Script:

#!/bin/bash
# Try to fetch the changelog from the repository
curl -s "https://raw.githubusercontent.com/astral-sh/ruff/main/CHANGELOG.md" | grep -A 5 "## \[0\.[98765432]\." || true

# Check if there are any config-related changes in the pre-commit config
rg -g "*.yaml" -g "*.yml" "ruff" .

Length of output: 523

packages/jumpstarter-cli-client/jumpstarter_cli_client/lease.py (2)

56-75: LGTM! Well-documented command with clear examples.

The docstring is comprehensive and includes practical examples that demonstrate the command's usage in real-world scenarios.


Line range hint 76-88: LGTM! Robust error handling and consistent implementation.

The implementation follows the established patterns:

  • Proper config loading with fallback to current client
  • Consistent error handling with specific ValueError cases
  • Correct usage of MetadataFilter for label filtering

Comment thread pyproject.toml
Copy link
Copy Markdown
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: 0

🧹 Nitpick comments (1)
.pre-commit-config.yaml (1)

13-13: Add newline at end of file.

To comply with YAML standards and fix the yamllint error, add a newline at the end of the file.

        description: "Run 'ruff format' for extremely fast Python formatting"
+
🧰 Tools
🪛 yamllint (1.35.1)

[error] 13-13: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9ef8702 and 24f07b3.

📒 Files selected for processing (1)
  • .pre-commit-config.yaml (1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
.pre-commit-config.yaml

[error] 13-13: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
🔇 Additional comments (3)
.pre-commit-config.yaml (3)

6-9: LGTM! Well-configured Ruff check hook.

The hook is properly configured with auto-fix capability, which is ideal for pre-commit hooks.


11-13: LGTM! Well-configured Ruff format hook.

The formatting hook is properly configured with a clear description.

🧰 Tools
🪛 yamllint (1.35.1)

[error] 13-13: no new line character at the end of file

(new-line-at-end-of-file)


4-4: Verify Ruff version compatibility and changelog.

The version update from v0.3.5 to v0.9.2 is significant. Let's verify the version and check for any breaking changes.

Copy link
Copy Markdown
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: 0

🧹 Nitpick comments (1)
.devcontainer/Dockerfile (1)

13-14: Consider using more specific package versions.

The apt-get install command installs the latest versions of packages, which could lead to inconsistency between builds.

Consider pinning package versions:

-RUN apt-get update && apt-get install -y iperf3 libusb-dev
+RUN apt-get update && apt-get install -y iperf3=3.* libusb-dev=2.*
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 24f07b3 and 58c3375.

📒 Files selected for processing (2)
  • .devcontainer/Dockerfile (1 hunks)
  • packages/jumpstarter-driver-http/pyproject.toml (0 hunks)
💤 Files with no reviewable changes (1)
  • packages/jumpstarter-driver-http/pyproject.toml
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: pytest-matrix (3.13)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-dev .devfile/Containerfile)
  • GitHub Check: pytest-matrix (3.12)
  • GitHub Check: pytest-matrix (3.11)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)
🔇 Additional comments (3)
.devcontainer/Dockerfile (3)

3-4: LGTM: Environment variables are properly configured.

The environment variables PYTHONUNBUFFERED and UV_LINK_MODE are correctly set for optimal operation.


1-1: Verify the base image version.

The base image mcr.microsoft.com/vscode/devcontainers/base:bookworm is used without a specific version tag. This could lead to unexpected changes when rebuilding the container.

Consider pinning to a specific version for better reproducibility:

-FROM mcr.microsoft.com/vscode/devcontainers/base:bookworm
+FROM mcr.microsoft.com/vscode/devcontainers/base:bookworm@sha256:<specific-hash>

Run this script to check available versions and their digests:


8-9: Verify UV binary compatibility and integrity.

The direct copy of pre-built binaries from ghcr.io/astral-sh/uv:latest is more efficient than building from source, but we should ensure:

  1. Binary compatibility with the base image
  2. Image integrity through version pinning

Run this script to check UV image versions and their digests:

Consider pinning to a specific version:

-COPY --from=ghcr.io/astral-sh/uv:latest /uv  /bin/uv
-COPY --from=ghcr.io/astral-sh/uv:latest /uvx /bin/uvx
+COPY --from=ghcr.io/astral-sh/uv:0.9.2 /uv  /bin/uv
+COPY --from=ghcr.io/astral-sh/uv:0.9.2 /uvx /bin/uvx
✅ Verification successful

Pin UV version to 0.5.24 for improved security and stability

The latest stable UV release (0.5.24) is compatible with the Debian Bookworm base image. Recommend updating Dockerfile to use pinned version instead of :latest:

-COPY --from=ghcr.io/astral-sh/uv:latest /uv  /bin/uv
-COPY --from=ghcr.io/astral-sh/uv:latest /uvx /bin/uvx
+COPY --from=ghcr.io/astral-sh/uv:0.5.24 /uv  /bin/uv
+COPY --from=ghcr.io/astral-sh/uv:0.5.24 /uvx /bin/uvx
  • Version 0.5.24 provides proper Linux builds with architecture compatibility
  • SHA256 checksums available for binary verification
  • Pinning version eliminates risks of unexpected changes from :latest tag
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Get available tags and their digests for the UV image
curl -s "https://ghcr.io/v2/astral-sh/uv/tags/list" | jq .

# Check if the UV image is built for the correct architecture
docker manifest inspect ghcr.io/astral-sh/uv:latest | jq '.manifests[] | select(.platform.architecture == "amd64")'

Length of output: 380


Script:

#!/bin/bash
# Check base image and UV configuration
echo "=== Base Image ==="
cat .devcontainer/Dockerfile | grep -i "^FROM" || true

echo -e "\n=== UV Configuration Files ==="
fd -t f "pyproject.toml|requirements.txt|.uv" --exec cat {}

echo -e "\n=== UV Version References ==="
rg -i "uv" -A 2 -B 2

Length of output: 92562


Script:

#!/bin/bash
# Get UV releases from GitHub API
curl -s "https://api.github.com/repos/astral-sh/uv/releases" | \
  jq -r '.[] | select(.prerelease==false) | {tag_name, published_at, assets: [.assets[] | {name, browser_download_url}]}' | \
  head -n 20

# Get latest release info
curl -s "https://api.github.com/repos/astral-sh/uv/releases/latest" | \
  jq -r '{tag_name, published_at, assets: [.assets[] | {name, browser_download_url}]}'

Length of output: 8315

$$ j --help
$$ exit
$ jmp lease release -l "${JMP_LEASE}"
$ JMP_LEASE=$(jmp lease request -l label match)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We need to update to jmp client lease request

But the important thing is fixing ruff now... merging :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I am a bit worried about the non deterministic behavior of ruff. Maybe we need to make sure everyone upgrades their uv and fully syncs the workspace. 🤷‍♂️

@bennyz bennyz merged commit 6eafa84 into main Jan 27, 2025
@NickCao NickCao deleted the fix-ruff branch January 29, 2025 14:38
@mangelajo mangelajo added this to the 0.6.0 milestone May 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants