-
Notifications
You must be signed in to change notification settings - Fork 83
fix(ci): Run Rust workflows only when changes affect Rust code (fixes #1463, resolves #1464); Update Cargo lock file. #1466
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
fix(ci): Run Rust workflows only when changes affect Rust code (fixes #1463, resolves #1464); Update Cargo lock file. #1466
Conversation
WalkthroughAdded path filtering to the Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant GH as GitHub Actions
participant Events as Repo events (push/pr)
participant Workflow as clp-rust-checks workflow
Note over Events,GH: Change to workflow triggers
Events->>GH: push / pull_request with file changes
GH->>Workflow: evaluate path filters (uses `monitored_paths` anchor)
alt changes match monitored_paths
GH->>Workflow: trigger workflow run
else no matching changes
GH-->>Events: skip workflow
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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 |
Cargo.lock.
Cargo.lock.
junhaoliao
left a comment
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.
i posted some questions about reducing the range of files to be checked. otherwise the PR lgtm.
for the title, how about:
fix(ci): Run Rust workflows only when changes affect Rust code (fixes #1463, resolves #1464); Update Cargo lock file.
| - "components/log-ingestor/**" | ||
| - "taskfile.yaml" | ||
| - "taskfiles/**" | ||
| - "tools/scripts/deps-download/**" |
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.
do we really need this?
| - "Cargo.lock" | ||
| - "Cargo.toml" | ||
| - ".github/workflows/clp-rust-checks.yaml" | ||
| - ".gitmodules" |
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.
and this? cuz yscope-dev-utils' version is not tracked there i believe?
|
Removed unrelated. |
Co-authored-by: Junhao Liao <[email protected]>
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/clp-rust-checks.yaml(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.8)
.github/workflows/clp-rust-checks.yaml
15-15: "paths" section must be sequence node but got alias node with "" tag
(syntax-check)
⏰ 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). (6)
- GitHub Check: package-image
- GitHub Check: lint-check (macos-15)
- GitHub Check: lint-check (ubuntu-24.04)
- GitHub Check: rust-checks (ubuntu-24.04)
- GitHub Check: rust-checks (macos-15)
- GitHub Check: rust-checks (ubuntu-22.04)
| push: | ||
| paths: *monitored_paths |
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.
Fix actionlint failure on the push trigger.
Actionlint 1.7.8 rejects paths: *monitored_paths because it resolves to an alias node instead of a sequence, so the workflow currently fails validation. Please expand the list inline (or otherwise restructure without aliases) for the push trigger so that paths is a literal sequence.
🧰 Tools
🪛 actionlint (1.7.8)
15-15: "paths" section must be sequence node but got alias node with "" tag
(syntax-check)
🤖 Prompt for AI Agents
In .github/workflows/clp-rust-checks.yaml around lines 14 to 15, the push
trigger currently uses an alias reference "paths: *monitored_paths" which
actionlint rejects because it expects a literal sequence; replace the alias with
an inline literal sequence of the monitored paths (i.e., copy the actual list
items from the monitored_paths anchor into the push.paths section) or otherwise
restructure so push.paths is a plain YAML sequence node rather than an alias.
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.
it's a bug (outdated type annotation) in actionlint then, since GH has added YAML anchor support. see rhysd/actionlint#133 which tracks the bug
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.
@junhaoliao Thanks, and agreed with @junhaoliao. GitHub Actions now supports YAML anchors and aliases in workflows, so the alias used for push.paths is valid; this is a limitation in actionlint rather than a workflow issue. (docs.github.com)
I’ll treat the previous actionlint note as a tooling false positive and not request changes. If you’d still like to quiet the noise until actionlint catches up, here’s a safe, temporary inline alternative for push only (functionally identical):
on:
pull_request:
paths: &monitored_paths
- ".cargo/**"
- "Cargo.lock"
- "Cargo.toml"
- ".github/workflows/clp-rust-checks.yaml"
- "components/clp-rust-utils/**"
- "components/log-ingestor/**"
- "taskfile.yaml"
- "taskfiles/**"
push:
paths:
- ".cargo/**"
- "Cargo.lock"
- "Cargo.toml"
- ".github/workflows/clp-rust-checks.yaml"
- "components/clp-rust-utils/**"
- "components/log-ingestor/**"
- "taskfile.yaml"
- "taskfiles/**"Otherwise, I’m good to keep the anchor as-is and ignore the linter’s complaint for this case. Also noting that actionlint 1.7.8 is the latest as of October 11, 2025 and doesn’t mention explicit anchor handling in its release notes, which likely explains the current behavior. (github.com)
✏️ Learnings added
Learnt from: junhaoliao
PR: y-scope/clp#1466
File: .github/workflows/clp-rust-checks.yaml:14-15
Timestamp: 2025-10-22T21:14:12.178Z
Learning: Repository y-scope/clp: In GitHub Actions workflows (e.g., .github/workflows/clp-rust-checks.yaml), YAML anchors/aliases are acceptable and preferred to avoid duplication; if actionlint flags an alias node (e.g., on push.paths) as an error, treat it as a tool limitation and do not require inlining unless the team asks to silence the warning.
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.
🧠 Learnings used
Learnt from: junhaoliao
PR: y-scope/clp#0
File: :0-0
Timestamp: 2025-10-22T21:02:31.068Z
Learning: Repository y-scope/clp: Maintain deterministic CI/builds for Rust; add a check to verify Cargo.lock is in sync with Cargo.toml without updating dependencies (non-mutating verification in clp-rust-checks workflow).
|
As discussed offline, we should investigate how to verify that the Rust That should be done in a follow-up PR. @coderabbitai create an issue to track the request |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain@junhaoliao On it — I’m creating a follow-up issue with the details, assigning it to you, and linking back to PR #1466 and your comment. I’ll share the issue link here as soon as it’s created. 🏁 Script executed: Length of output: 86 @junhaoliao Issue created: #1470. It’s assigned to you and includes backlinks to PR #1466 and your request. The issue outlines goals, non-mutating approaches to evaluate (e.g., cargo metadata --locked / cargo check --locked / cargo fetch --locked), and acceptance criteria for updating clp-rust-checks. Would you like me to add any labels or a milestone, or adjust the assignee? Suggested first experiment for the follow-up PR:
✏️ Learnings added
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain@junhaoliao Understood—creating a tracking issue now with context, acceptance criteria, and assigning it to you. I’ll include backlinks to PR #1466 and your comment. 🏁 Script executed: Length of output: 137 @junhaoliao Thanks for the heads-up. The earlier failure was due to process substitution not being available in the runner. Here’s a more portable script that uses temp files and should create the tracking issue, assign it to you, and include backlinks to PR #1466 and your comment. 🏁 Script executed: Length of output: 200 @junhaoliao Tracking issue created and assigned to you: #1471. It includes backlinks to PR #1466 and your comment permalink. Would you like me to:
Happy to proceed either in this repo or your fork—your preference. ✏️ Learnings added
|
Description
This PR fixes #1463 by adding a filter to skip Rust workflows when no Rust-related changes are involved in a push or a commit.
The implementation of this PR should resolve #1464.
Checklist
breaking change.
Validation performed
Summary by CodeRabbit