feat(ci): Add tasks for checking and updating Rust lock file (Cargo.lock); Add check to GH workflow.#1448
Conversation
WalkthroughAdds a pre-lint CI step that validates Rust cargo lock files and introduces taskfiles to check or update cargo workspace locks; the CI workflow runs the new lock validation before the existing lint step. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant GH as GitHub Actions runner
participant Job as rust-checks job
participant Task as Task runner\n(`task deps:lock:check-rust`)
participant CWU as cargo-workspace-update
participant Cargo as `cargo update --locked`
participant Lint as Lint step
GH->>Job: start rust-checks
Job->>Task: run "Validate lock files"
Task->>CWU: invoke cargo-workspace-update\nwith CARGO_UPDATE_FLAGS="--locked"
CWU->>Cargo: source $HOME/.cargo/env\nrun cargo update --locked
Cargo-->>CWU: exit (success/failure)
CWU-->>Task: return status
alt success
Task-->>Job: step success
Job->>Lint: proceed to Lint step
else failure
Task-->>Job: step failure -> job fails
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (1)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (3)
taskfiles/deps/lock.yaml (3)
20-20: Fix parameter type documentation.Based on past review comments, the parameter type should be
{string}rather than{string[]}sinceCARGO_UPDATE_FLAGSis used as a plain string, not an array.Apply this diff:
- # @param {string[]} CARGO_UPDATE_FLAGS The flags to pass to `cargo update`. + # @param {string} CARGO_UPDATE_FLAGS The flags to pass to `cargo update`.
7-11: Consider adding docstrings to public tasks.The
check-rusttask (andupdate-rustbelow) would benefit from docstrings explaining their purpose, similar to other tasks in the codebase.Example:
check-rust: + desc: "Checks whether Cargo.lock is up-to-date." cmds: - task: "cargo-workspace-update" vars: CARGO_UPDATE_FLAGS: "--locked"
13-17: Consider adding a docstring.Similar to
check-rust, this task would benefit from a description.Example:
update-rust: + desc: "Updates Cargo.lock to reflect current dependencies." cmds: - task: "cargo-workspace-update" vars: CARGO_UPDATE_FLAGS: ""
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
.github/workflows/clp-rust-checks.yaml(1 hunks)components/clp-rust-utils/Cargo.toml(1 hunks)components/clp-rust-utils/src/s3/client.rs(3 hunks)taskfiles/deps/lock.yaml(1 hunks)taskfiles/deps/main.yaml(1 hunks)
🔇 Additional comments (7)
components/clp-rust-utils/Cargo.toml (1)
7-8: LGTM: Dependency updates align with async client initialization.The addition of
aws-configand the update toaws-sdk-s3(with feature removal) appropriately support the new async initialization pattern usingBehaviorVersion::latest()explicitly in the code.components/clp-rust-utils/src/s3/client.rs (3)
10-14: LGTM: Clear documentation of client behaviour.The documentation clearly notes the use of the latest AWS SDK behaviour version and path-style addressing enforcement.
33-40: LGTM: Proper AWS SDK initialization with path-style addressing.The implementation correctly:
- Loads base configuration asynchronously with the latest behaviour version
- Constructs the client config from the base config
- Enforces path-style addressing for S3-compatible endpoints
- Builds the config before creating the client
19-24: No internal callsites found forcreate_new_clientin this repository.Comprehensive search across the Rust codebase found only the function definition and its re-export in
src/s3.rs, but no actual calls to this function. This suggests the breaking change may only affect external consumers of this library. You will need to verify:
- Whether external code depends on this library and calls
create_new_client- If so, whether those external callers have been updated to handle the async change and include
.awaittaskfiles/deps/lock.yaml (1)
22-29: LGTM: Proper internal task structure.The internal task correctly:
- Marks itself as internal
- Requires necessary variables
- Sets working directory to root
- Depends on Rust toolchain
- Sources cargo environment
- Executes cargo update with provided flags
taskfiles/deps/main.yaml (1)
4-4: LGTM: Proper integration of lock workflow.The lock.yaml include is correctly added to make the dependency lock tasks available.
.github/workflows/clp-rust-checks.yaml (1)
34-36: LGTM: Proper CI integration of dependency lock check.The new "Deps" step correctly:
- Runs before "Lint" to catch dependency issues early
- Executes the lock check task defined in taskfiles/deps/lock.yaml
- Uses consistent shell and naming conventions
| [package] | ||
| name = "clp-rust-utils" | ||
| version = "0.1.0" | ||
| edition = "2024" |
There was a problem hiding this comment.
Critical: Invalid Rust edition.
Rust edition "2024" does not exist. Valid editions are "2015", "2018", and "2021". This will cause compilation to fail.
Apply this diff to fix:
-edition = "2024"
+edition = "2021"📝 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.
| edition = "2024" | |
| edition = "2021" |
🤖 Prompt for AI Agents
In components/clp-rust-utils/Cargo.toml around line 4, the Cargo.toml
incorrectly sets edition = "2024", which is invalid; change the edition value to
a valid Rust edition (e.g., edition = "2021") so the project uses a supported
edition and will compile.
There was a problem hiding this comment.
U're outdated. 2024 is a valid version now.
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Rust edition 2024 release date valid
💡 Result:
Short answer: Yes — the "Rust 2024" edition was finalized and shipped with Rust 1.85 (stable) on February 20, 2025, so the release date is correct/valid. [1][2][3]
Sources:
- Rust project goals / edition schedule (tracks 1.85 → 2025-02-20). [1]
- RFC 3501 (announcing the intent to produce a 2024 edition). [2]
- Rust blog Project Goals post summarizing the edition plan and release target. [3]
@LinZhihao-723, you're absolutely right, and I apologize for the incorrect information! Rust edition 2024 is indeed valid and was released with Rust 1.85 on February 20, 2025. The edition = "2024" in your Cargo.toml is correct. Thank you for the correction!
✏️ Learnings added
Learnt from: LinZhihao-723
PR: y-scope/clp#1448
File: components/clp-rust-utils/Cargo.toml:4-4
Timestamp: 2025-10-20T22:20:45.688Z
Learning: Rust edition 2024 is a valid edition value in Cargo.toml files. It was released with Rust 1.85 on February 20, 2025.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
kirkrodrigues
left a comment
There was a problem hiding this comment.
For the PR title, how about:
feat(ci): Add tasks for checking and updating Rust lock file (`Cargo.lock`); Add check to GH workflow.
Cargo.lock); Add check to GH workflow.
Co-authored-by: Junhao Liao <junhao@junhao.ca>
junhaoliao
left a comment
There was a problem hiding this comment.
lgtm. let's wait for @kirkrodrigues 's confirmation as well, since i'm not that familiar with cargo
| dir: "{{.ROOT_DIR}}" | ||
| deps: ["toolchains:rust"] | ||
| cmd: |- | ||
| . "$HOME/.cargo/env" |
There was a problem hiding this comment.
just curious, do we have plans to install rust into clp/build/ instead of the user's home directory?
There was a problem hiding this comment.
I'd prefer to install to the user's home directory:
- This would only affect developers who need to build our package from source.
- Cargo is designed to be per-user installation. If the toolchain is already installed, it would only help you to upgrade (which shouldn't be harmful as I never heard of anyone having problems for sticking to a particular cargo version).
- This potentially avoids a lot of toolchain problems (like version conflicts) as there're only one toolchain needed and located in a default path.
There was a problem hiding this comment.
Yeah, we discussed this when @LinZhihao-723 was initially adding the task. I do think it's worth documenting somewhere though. Did we add it to the package build docs?
There was a problem hiding this comment.
No we haven't. I will do it in a separate PR.
There was a problem hiding this comment.
@coderabbitai Please create an issue for us to document new Rust components in CLP package. In this doc we should mention our installation approach for cargo toolchain.
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Create GitHub issue for documenting Rust components in CLP package
gh issue create \
--repo y-scope/clp \
--title "Document Rust components and cargo toolchain installation approach" \
--body "## Background
As part of adding Rust components to the CLP package, we need to document the new Rust components and our installation approach for the cargo toolchain.
## Documentation Requirements
- Document the new Rust components in the CLP package
- Explain the installation approach for the cargo toolchain
- Specifically, that cargo is installed to the user's home directory rather than \`clp/build/\`
- Rationale for this approach (per-user installation, default path, avoiding version conflicts)
## References
- PR: https://github.com/y-scope/clp/pull/1448
- Discussion: https://github.com/y-scope/clp/pull/1448#discussion_r2449502274
Requested by: @LinZhihao-723" \
--assignee LinZhihao-723
Length of output: 42
@LinZhihao-723, I've created issue #1461 to track the documentation of Rust components and the cargo toolchain installation approach. The issue has been assigned to you and includes references to this PR and discussion.
🔗 #1461
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
|
it appears that the added step is failing on the it's also failing in other runs on non-main branches as well
@coderabbitai create an issue to track the CI failure |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 85 @junhaoliao I've created both issues as requested:
Both issues have been assigned to you. |
* feat(webui): Add drawer to display guided query and errors. (y-scope#1421) * docs: Add Slack community invite badge to home page README. (y-scope#1418) * refactor(clp-package): Simplify StrEnum and Path serialization via Annotated serializers. (y-scope#1417) Co-authored-by: Junhao Liao <junhao@junhao.ca> Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * build(clp-package): Adopt uv + hatchling as the build and packaging backend for Python components (resolves y-scope#1396); Upgrade dependencies for Python components. (y-scope#1405) * chore(docker): Add `--link` flags to COPY/ADD operations for improved build performance (fixes y-scope#1408). (y-scope#1411) * fix(ci): Correctly update and restore cache of `lint:check-cpp-lint-static-full`'s generated files (fixes y-scope#1419): (y-scope#1430) - Save cache entries using unique key per entry. - Restore latest entries using key prefix. - Avoid using outputs from optionally-run `restore` task. * fix(clp-rust-utils): Use AWS SDK default configuration with latest behavior version for S3 client. (y-scope#1445) Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * refactor(clp-package): Remove unused `python-dotenv` dependency and related imports (fixes y-scope#1443). (y-scope#1444) * fix(webui): Submit queries that failed ANTLR validation to Presto. (y-scope#1450) * feat(clp-s): Explicitly reject unstructured log inputs during compression. (y-scope#1434) * feat(webui): Show query speed in native search status. (y-scope#1429) * fix(job-orchestration): Make `tag_ids` a required `list[int]` for compatibility with Spider compressor. (y-scope#1453) * feat(clp-mcp-server): Add log viewer links to query results for displaying in LLM output. (y-scope#1454) Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * feat(ci): Add tasks for checking and updating Rust lock file (`Cargo.lock`); Add check to GH workflow. (y-scope#1448) * feat(webui): Trigger submit action when pressing Enter on Monaco single line editor. (y-scope#1459) * Add filters. * Update cargo lock. --------- Co-authored-by: davemarco <83603688+davemarco@users.noreply.github.com> Co-authored-by: Abigail Matthews <abigail.v.matthews@gmail.com> Co-authored-by: sitaowang1998 <sitaowang1998@outlook.com> Co-authored-by: Junhao Liao <junhao@junhao.ca> Co-authored-by: Junhao Liao <junhao.liao@yscope.com> Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com> Co-authored-by: Devin Gibson <gibber9809@users.noreply.github.com> Co-authored-by: hoophalab <200652805+hoophalab@users.noreply.github.com> Co-authored-by: Huangshi Tian <All-less@users.noreply.github.com>
* feat(webui): Add drawer to display guided query and errors. (y-scope#1421) * docs: Add Slack community invite badge to home page README. (y-scope#1418) * refactor(clp-package): Simplify StrEnum and Path serialization via Annotated serializers. (y-scope#1417) Co-authored-by: Junhao Liao <junhao@junhao.ca> Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * build(clp-package): Adopt uv + hatchling as the build and packaging backend for Python components (resolves y-scope#1396); Upgrade dependencies for Python components. (y-scope#1405) * chore(docker): Add `--link` flags to COPY/ADD operations for improved build performance (fixes y-scope#1408). (y-scope#1411) * fix(ci): Correctly update and restore cache of `lint:check-cpp-lint-static-full`'s generated files (fixes y-scope#1419): (y-scope#1430) - Save cache entries using unique key per entry. - Restore latest entries using key prefix. - Avoid using outputs from optionally-run `restore` task. * fix(clp-rust-utils): Use AWS SDK default configuration with latest behavior version for S3 client. (y-scope#1445) Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * refactor(clp-package): Remove unused `python-dotenv` dependency and related imports (fixes y-scope#1443). (y-scope#1444) * fix(webui): Submit queries that failed ANTLR validation to Presto. (y-scope#1450) * feat(clp-s): Explicitly reject unstructured log inputs during compression. (y-scope#1434) * feat(webui): Show query speed in native search status. (y-scope#1429) * fix(job-orchestration): Make `tag_ids` a required `list[int]` for compatibility with Spider compressor. (y-scope#1453) * feat(clp-mcp-server): Add log viewer links to query results for displaying in LLM output. (y-scope#1454) Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * feat(ci): Add tasks for checking and updating Rust lock file (`Cargo.lock`); Add check to GH workflow. (y-scope#1448) * feat(webui): Trigger submit action when pressing Enter on Monaco single line editor. (y-scope#1459) * Add filters. * Update cargo lock. --------- Co-authored-by: davemarco <83603688+davemarco@users.noreply.github.com> Co-authored-by: Abigail Matthews <abigail.v.matthews@gmail.com> Co-authored-by: sitaowang1998 <sitaowang1998@outlook.com> Co-authored-by: Junhao Liao <junhao@junhao.ca> Co-authored-by: Junhao Liao <junhao.liao@yscope.com> Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com> Co-authored-by: Devin Gibson <gibber9809@users.noreply.github.com> Co-authored-by: hoophalab <200652805+hoophalab@users.noreply.github.com> Co-authored-by: Huangshi Tian <All-less@users.noreply.github.com>
* feat(webui): Add drawer to display guided query and errors. (y-scope#1421) * docs: Add Slack community invite badge to home page README. (y-scope#1418) * refactor(clp-package): Simplify StrEnum and Path serialization via Annotated serializers. (y-scope#1417) Co-authored-by: Junhao Liao <junhao@junhao.ca> Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * build(clp-package): Adopt uv + hatchling as the build and packaging backend for Python components (resolves y-scope#1396); Upgrade dependencies for Python components. (y-scope#1405) * chore(docker): Add `--link` flags to COPY/ADD operations for improved build performance (fixes y-scope#1408). (y-scope#1411) * fix(ci): Correctly update and restore cache of `lint:check-cpp-lint-static-full`'s generated files (fixes y-scope#1419): (y-scope#1430) - Save cache entries using unique key per entry. - Restore latest entries using key prefix. - Avoid using outputs from optionally-run `restore` task. * fix(clp-rust-utils): Use AWS SDK default configuration with latest behavior version for S3 client. (y-scope#1445) Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * refactor(clp-package): Remove unused `python-dotenv` dependency and related imports (fixes y-scope#1443). (y-scope#1444) * fix(webui): Submit queries that failed ANTLR validation to Presto. (y-scope#1450) * feat(clp-s): Explicitly reject unstructured log inputs during compression. (y-scope#1434) * feat(webui): Show query speed in native search status. (y-scope#1429) * fix(job-orchestration): Make `tag_ids` a required `list[int]` for compatibility with Spider compressor. (y-scope#1453) * feat(clp-mcp-server): Add log viewer links to query results for displaying in LLM output. (y-scope#1454) Co-authored-by: Junhao Liao <junhao.liao@yscope.com> * feat(ci): Add tasks for checking and updating Rust lock file (`Cargo.lock`); Add check to GH workflow. (y-scope#1448) * feat(webui): Trigger submit action when pressing Enter on Monaco single line editor. (y-scope#1459) * Add filters. * Update cargo lock. * Stupid fix --------- Co-authored-by: davemarco <83603688+davemarco@users.noreply.github.com> Co-authored-by: Abigail Matthews <abigail.v.matthews@gmail.com> Co-authored-by: sitaowang1998 <sitaowang1998@outlook.com> Co-authored-by: Junhao Liao <junhao@junhao.ca> Co-authored-by: Junhao Liao <junhao.liao@yscope.com> Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com> Co-authored-by: Devin Gibson <gibber9809@users.noreply.github.com> Co-authored-by: hoophalab <200652805+hoophalab@users.noreply.github.com> Co-authored-by: Huangshi Tian <All-less@users.noreply.github.com>
…lock`); Add check to GH workflow. (y-scope#1448)
Description
NOTE: This PR depends on #1445.
This PR adds tasks to update and check Rust's dependency lock file (Cargo.lock):
deps:lock:check-rustfor checking whether the lock file is up-to-datedeps:lock:update-rustfor refreshing the lock file.This PR also adds the check task into the Rust check workflow.
Checklist
breaking change.
Validation performed
Summary by CodeRabbit