-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(cli): migrate to Cargo workspaces #380
Conversation
WalkthroughThe pull request introduces significant changes to the project configuration, primarily focusing on the GitHub Actions workflow and the Rust package management structure. The Changes
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[actionlint] reported by reviewdog 🐶
the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue [action]
- uses: actions-rs/toolchain@v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[actionlint] reported by reviewdog 🐶
the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue [action]
- uses: actions-rs/toolchain@v1 |
Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com>
45bcb14
to
394e8e3
Compare
There was a problem hiding this 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
🧹 Outside diff range and nitpick comments (2)
cli/Cargo.toml (1)
16-24
: Optimize dependency features for CLI usage.Consider the following optimizations:
- Replace
tokio = { version = "1.37.0", features = ["full"] }
with minimal required features (e.g., "rt", "macros") to reduce binary size.- Review if all
serde
derive features are necessary.Example optimization:
-tokio = { version = "1.37.0", features = ["full"] } +tokio = { version = "1.37.0", features = ["rt", "rt-multi-thread", "macros", "fs", "io-util"] }.github/workflows/release.yaml (1)
Line range hint
11-116
: Consider documenting the workspace structure change.The workflow changes reflect a significant structural change in the project. Consider adding a comment in the workflow file explaining the workspace structure and why certain paths are configured as they are.
Add a comment at the top of the file:
name: Release +# This workflow is configured to work with a Cargo workspace structure where +# the main package resides in the ./cli directory. on: push:
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
📒 Files selected for processing (3)
.github/workflows/release.yaml
(2 hunks)Cargo.toml
(1 hunks)cli/Cargo.toml
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- Cargo.toml
🔇 Additional comments (5)
cli/Cargo.toml (3)
27-29
: LGTM!
The binary configuration follows standard Rust conventions.
31-32
: LGTM! Verify binary release workflow.
The binstall configuration looks correct. Ensure the release workflow generates compatible artifacts.
#!/bin/bash
# Check if release workflow handles binary artifacts
if [ -d ".github/workflows" ]; then
echo "Checking release workflow for binary artifacts:"
rg -A 5 "asset|artifact|binary|release" .github/workflows/
fi
13-13
: Verify the purpose of excluding the web directory.
The /web
exclusion pattern seems isolated. If this is related to documentation or a web interface, consider documenting its purpose in the README.
✅ Verification successful
The /web
exclusion is correct and properly documented
The /web
directory contains the project's documentation website built with Astro (astro.config.mjs), TypeScript (tsconfig.json), and Node.js (package.json). It's appropriate to exclude it from the Rust package as it's a separate web application that doesn't need to be included in the CLI distribution.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if web directory exists and its purpose
fd -t d "web$" -x echo "Found web directory at: {}"
if [ -f "README.md" ]; then
echo "Checking README.md for web directory documentation:"
rg -i "web" "README.md"
fi
Length of output: 3231
Script:
#!/bin/bash
# Let's check for web-related files and directories in the repository
fd -t d "web" || true
fd -t f "web" || true
# Check Cargo.toml files for web-related configurations
echo "Checking Cargo.toml files:"
rg -A 3 "web" "Cargo.toml" || true
rg -A 3 "web" "**/Cargo.toml" || true
# Check if there are any web-related build or documentation tasks
echo "Checking for web-related tasks:"
rg -i "web" .github/workflows/*.y*ml || true
Length of output: 720
Script:
#!/bin/bash
# Let's check the contents of the web directory and its purpose
echo "Checking web directory structure:"
ls -la web/ || true
# Check for package.json or other web-related configuration files
echo "Checking for web configurations:"
fd -t f "package.json|tsconfig.json|webpack.config|vite.config" web/ || true
# Check if web directory is related to documentation
echo "Checking for documentation in web:"
fd . web/ -t f -e md || true
Length of output: 1878
.github/workflows/release.yaml (2)
116-116
: Verify Docker build configuration.
The Docker build context is correctly set to ./cli
to match the new workspace structure. However, we should verify the Dockerfile location and its content to ensure compatibility.
Let's verify the Docker setup:
✅ Verification successful
Let me gather more information about the Dockerfile contents to ensure complete verification.
Docker configuration is properly aligned with the new workspace structure
The Docker setup is correctly configured:
- Dockerfile is properly located at
cli/Dockerfile
- Build context at
./cli
matches the Dockerfile location - The Dockerfile uses appropriate paths for copying files and setting up the build
- Multi-stage build is properly configured with correct COPY instructions
- No other conflicting Docker configurations were found
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify Docker configuration alignment with the new structure
# Test 1: Check Dockerfile location
echo "Checking Dockerfile location:"
fd -t f "Dockerfile" cli/
# Test 2: Check for any Docker-related paths in the Dockerfile
if [ -f "cli/Dockerfile" ]; then
echo "Checking paths in Dockerfile:"
rg "COPY|ADD" cli/Dockerfile
fi
Length of output: 324
Script:
#!/bin/bash
# Check complete Dockerfile contents to verify the configuration
echo "Complete Dockerfile contents:"
cat cli/Dockerfile
# Check if there are any other Docker-related files
echo -e "\nChecking for docker-compose or other Docker-related files:"
fd -t f "docker-compose|\.docker"
Length of output: 785
11-14
: Verify the impact of the default working directory.
The addition of a default working directory aligns with the Cargo workspace migration. However, we should verify that all run
steps in the workflow are compatible with this change.
Let's verify the compatibility:
✅ Verification successful
The working directory change is correctly configured and compatible with all steps
The verification shows that:
- The
./cli
working directory is appropriate as it contains:- The main Cargo.toml for the CLI package
- The Dockerfile used by the docker job
- All
run
steps in the workflow are Cargo-related commands that should execute in the CLI directory:cargo build --release
cargo publish
- Other path references in the workflow are either:
- Absolute paths for artifacts
- Explicitly set contexts (docker build, web deployment)
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if any run steps might be affected by the working directory change
# Test 1: Find all run steps in the workflow
echo "Checking run steps in the workflow:"
rg "^\s*-\s*run:" -A 1
# Test 2: Check if Cargo.toml exists in the cli directory
fd -t f "Cargo.toml" cli/
# Test 3: Check if there are any path references in run commands that might need adjustment
rg "run:.*\.\/" -A 1
Length of output: 254
Script:
#!/bin/bash
# Let's try a different approach to analyze the workflow file
# First, let's see the entire workflow file content
echo "=== Workflow file content ==="
cat .github/workflows/release.yaml
# Then, let's specifically look for run steps without the problematic escape sequence
echo -e "\n=== Run steps in workflow ==="
rg "run:" .github/workflows/release.yaml -A 1
# Finally, check if there are any path references that might be affected
echo -e "\n=== Path references in workflow ==="
rg "path:|\.\/|\.\.\/|\/" .github/workflows/release.yaml
Length of output: 4886
Script:
#!/bin/bash
# Let's check for path references with a corrected regex
# Check for path references in the workflow
echo "=== Path references in workflow ==="
rg "path:|\\./|\\.\\./" .github/workflows/release.yaml
# Check if Dockerfile exists in the cli directory
echo -e "\n=== Check for Dockerfile ==="
fd Dockerfile cli/
# Check the content of Cargo.toml in cli directory
echo -e "\n=== CLI Cargo.toml content ==="
cat cli/Cargo.toml
Length of output: 1604
Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[actionlint] reported by reviewdog 🐶
the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue [action]
commitlint-rs/.github/workflows/ci.yaml
Line 10 in 6ff3fdc
- uses: actions-rs/toolchain@v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[actionlint] reported by reviewdog 🐶
the runner of "actions-rs/cargo@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue [action]
commitlint-rs/.github/workflows/ci.yaml
Line 16 in 6ff3fdc
- uses: actions-rs/cargo@v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[actionlint] reported by reviewdog 🐶
the runner of "actions-rs/cargo@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue [action]
commitlint-rs/.github/workflows/ci.yaml
Line 38 in 6ff3fdc
- uses: actions-rs/cargo@v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[actionlint] reported by reviewdog 🐶
the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue [action]
commitlint-rs/.github/workflows/ci.yaml
Line 54 in 6ff3fdc
- uses: actions-rs/toolchain@v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[actionlint] reported by reviewdog 🐶
the runner of "actions-rs/cargo@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue [action]
commitlint-rs/.github/workflows/ci.yaml
Line 70 in 6ff3fdc
- uses: actions-rs/cargo@v1 |
Why
Because I want to ensure this project is flexible enough for future development.
Summary by CodeRabbit
New Features
commitlint-rs
, for linting commits based on the Conventional Commits specification.Refactor
Bug Fixes