-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Update CI auto-format #6233
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
Update CI auto-format #6233
Conversation
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
WalkthroughThe CI Changes
Sequence Diagram(s)sequenceDiagram
participant Upstream as Upstream Jobs
participant Lint as lint (clippy)
participant AutoFmt as auto-format workflow
participant Repo as GitHub Repo
Upstream->>Lint: required jobs finish
Lint->>Lint: run clippy
rect rgb(240,250,235)
Note over AutoFmt: auto-format flow (rustfmt + commit)
AutoFmt->>Repo: checkout head commit
AutoFmt->>AutoFmt: setup Rust toolchain (with rustfmt)
AutoFmt->>AutoFmt: run cargo fmt --all
AutoFmt->>AutoFmt: detect formatting changes
end
alt changes detected
AutoFmt->>Repo: git commit -m "[skip ci] autoformat"
AutoFmt->>Repo: git push
AutoFmt->>Repo: optionally post PR comment
else no changes
AutoFmt-->>AutoFmt: exit without commit/comment
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (5)📓 Common learnings📚 Learning: 2025-09-11T05:06:59.971ZApplied to files:
📚 Learning: 2025-07-10T10:08:43.330ZApplied to files:
📚 Learning: 2025-09-11T05:06:59.971ZApplied to files:
📚 Learning: 2025-09-11T05:06:59.971ZApplied to files:
⏰ 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). (4)
🔇 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/ci.yaml(2 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: RustPython/RustPython PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-11T05:06:59.971Z
Learning: Applies to **/*.rs : Run clippy and fix any warnings or lints introduced by your changes
Learnt from: CR
Repo: RustPython/RustPython PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-11T05:06:59.971Z
Learning: Applies to **/*.rs : Format Rust code with the default rustfmt style (run `cargo fmt`)
📚 Learning: 2025-09-11T05:06:59.971Z
Learnt from: CR
Repo: RustPython/RustPython PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-11T05:06:59.971Z
Learning: Applies to **/*.rs : Run clippy and fix any warnings or lints introduced by your changes
Applied to files:
.github/workflows/ci.yaml
📚 Learning: 2025-09-11T05:06:59.971Z
Learnt from: CR
Repo: RustPython/RustPython PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-11T05:06:59.971Z
Learning: Applies to extra_tests/**/*.py : Use ruff to lint custom Python code
Applied to files:
.github/workflows/ci.yaml
📚 Learning: 2025-07-10T10:08:43.330Z
Learnt from: ShaharNaveh
Repo: RustPython/RustPython PR: 5932
File: .github/workflows/comment-commands.yml:18-24
Timestamp: 2025-07-10T10:08:43.330Z
Learning: In GitHub Actions workflows for the RustPython project, the maintainer ShaharNaveh prefers to keep workflows simple and doesn't mind if steps fail when the desired state is already achieved (e.g., user already assigned to an issue). Avoid suggesting complex error handling for edge cases they don't consider problematic.
Applied to files:
.github/workflows/ci.yaml
📚 Learning: 2025-09-11T05:06:59.971Z
Learnt from: CR
Repo: RustPython/RustPython PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-11T05:06:59.971Z
Learning: Applies to **/*.rs : Format Rust code with the default rustfmt style (run `cargo fmt`)
Applied to files:
.github/workflows/ci.yaml
⏰ 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). (11)
- GitHub Check: Check Rust code with clippy
- GitHub Check: Run snippets and cpython tests on wasm-wasi
- GitHub Check: Run tests under miri
- GitHub Check: Check the WASM package and demo
- GitHub Check: Run snippets and cpython tests (macos-latest)
- GitHub Check: Run snippets and cpython tests (ubuntu-latest)
- GitHub Check: Run snippets and cpython tests (windows-latest)
- GitHub Check: Run rust tests (macos-latest)
- GitHub Check: Run rust tests (ubuntu-latest)
- GitHub Check: Run rust tests (windows-latest)
- GitHub Check: Ensure compilation on various targets
🔇 Additional comments (1)
.github/workflows/ci.yaml (1)
310-310: ✓ Lint job refactored correctly.The separation of formatting concerns from the lint job aligns well with the PR objectives. Rustfmt has been removed, and the lint job now focuses solely on clippy checks.
Also applies to: 316-316
123d194 to
4755b21
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: 2
🧹 Nitpick comments (1)
.github/workflows/auto-format.yaml (1)
63-65: Minor: Capitalize first word in comment text.The message on line 65 should start with a capital letter for consistency.
message: | Code has been automatically formatted. No action needed. - the changes were committed with `[skip ci]`. + The changes were committed with `[skip ci]`.
📜 Review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/auto-format.yaml(1 hunks).github/workflows/ci.yaml(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/ci.yaml
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: RustPython/RustPython PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-11T05:06:59.971Z
Learning: Applies to **/*.rs : Run clippy and fix any warnings or lints introduced by your changes
Learnt from: CR
Repo: RustPython/RustPython PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-11T05:06:59.971Z
Learning: Applies to **/*.rs : Format Rust code with the default rustfmt style (run `cargo fmt`)
📚 Learning: 2025-09-11T05:06:59.971Z
Learnt from: CR
Repo: RustPython/RustPython PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-11T05:06:59.971Z
Learning: Applies to **/*.rs : Format Rust code with the default rustfmt style (run `cargo fmt`)
Applied to files:
.github/workflows/auto-format.yaml
📚 Learning: 2025-07-10T10:08:43.330Z
Learnt from: ShaharNaveh
Repo: RustPython/RustPython PR: 5932
File: .github/workflows/comment-commands.yml:18-24
Timestamp: 2025-07-10T10:08:43.330Z
Learning: In GitHub Actions workflows for the RustPython project, the maintainer ShaharNaveh prefers to keep workflows simple and doesn't mind if steps fail when the desired state is already achieved (e.g., user already assigned to an issue). Avoid suggesting complex error handling for edge cases they don't consider problematic.
Applied to files:
.github/workflows/auto-format.yaml
🔇 Additional comments (6)
.github/workflows/auto-format.yaml (6)
1-6: Trigger configuration looks good.The workflow correctly responds to CI completion and supports manual dispatch.
10-24: Job configuration is appropriate.Permissions correctly scoped for git commits and PR comments; concurrency setup prevents redundant runs.
27-32: Checkout configuration correct for workflow_run context.Properly references
github.event.workflow_runcontext to check out the PR head branch and repository.
34-37: Rust toolchain setup is standard.Using dtolnay's stable toolchain with rustfmt component is the recommended approach.
39-42: Formatting command is correct.Straightforward
cargo fmt --allinvocation.
21-21: Verify workflow_dispatch trigger intent—job will be skipped when manually triggered.The job condition checks
github.event.workflow_run.conclusion, which doesn't exist forworkflow_dispatchevents. This means the job will be skipped if manually triggered via the workflow_dispatch button.If manual formatting is desired, update the condition to handle both event types:
- if: ${{ github.event.workflow_run.conclusion == 'success' && !contains(github.event.workflow_run.head_commit.message, '[skip ci]') }} + if: ${{ (github.event_name == 'workflow_dispatch') || (github.event.workflow_run.conclusion == 'success' && !contains(github.event.workflow_run.head_commit.message, '[skip ci]')) }}
4760c69 to
be4aa0f
Compare
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
be4aa0f to
aae26a3
Compare
|
@youknowone please check as I seprate the auto formate workflow due to branch restrictions on ci . |
youknowone
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.
Thank you so much, let's try
This reverts commit 377151a.
After running all all test i have added a another which check the rust format and if its not correct it make a commit with
[skip ci] which tell github workflow to ignore this commit.
issue :#6204
Summary by CodeRabbit