Skip to content

Conversation

@YashSuthar983
Copy link
Contributor

@YashSuthar983 YashSuthar983 commented Nov 10, 2025

Summary by CodeRabbit

  • Chores
    • Streamlined CI process by consolidating Rust code quality checks into a single linting step.
    • Introduced automatic code formatting for pull requests to maintain consistent code style.

YashSuthar983 and others added 5 commits November 5, 2025 01:03
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
Co-authored-by: fanninpm <luxverdans@sbcglobal.net>
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request removes the rustfmt formatting check from the CI lint job in .github/workflows/ci.yaml and introduces a new workflow file .github/workflows/pr-auto-commit.yaml that automatically formats Rust code in pull requests, commits changes, and posts status comments.

Changes

Cohort / File(s) Summary
CI Workflow Simplification
​.github/workflows/ci.yaml
Removed rustfmt step and its trigger condition from the lint job; retained clippy-only checking; updated job description from "rustfmt and clippy" to "clippy."
PR Auto-format Workflow
​.github/workflows/pr-auto-commit.yaml
New workflow that triggers on PR events to main/release branches, skips on skip:ci label or [skip ci] in commit, checks out PR branch, waits for status checks, runs cargo fmt --all, and conditionally commits/pushes formatting changes with PR comment notification or logs success.

Sequence Diagram

sequenceDiagram
    actor GitHub as GitHub<br/>(PR Event)
    participant Workflow as PR Auto-format<br/>Workflow
    participant Rust as Rust/cargo fmt
    participant Git as Git<br/>(Push)
    participant API as GitHub API<br/>(PR Comment)

    GitHub->>Workflow: Trigger on pull_request_target
    Workflow->>Workflow: Check skip conditions<br/>(label, commit message)
    alt Skip Detected
        Workflow->>Workflow: Exit early
    else Proceed
        Workflow->>Workflow: Checkout PR branch
        Workflow->>Workflow: Wait for status checks
        Workflow->>Rust: Setup rustfmt toolchain
        Workflow->>Rust: Run cargo fmt --all
        Rust-->>Workflow: Format changes detected?
        alt Changes Found
            Workflow->>Git: Commit and push<br/>formatted code [skip ci]
            Git-->>Workflow: Success
            Workflow->>API: Post PR comment<br/>(formatting applied)
            API-->>Workflow: Comment posted
        else No Changes
            Workflow->>Workflow: Log: already formatted
        end
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Examine the trigger conditions and skip logic in the new workflow to ensure edge cases are handled (PR labels, commit message filtering)
  • Verify the conditional commit/push logic correctly detects formatting changes and applies [skip ci] tags to prevent recursive CI runs
  • Confirm GitHub API permissions are sufficient for posting PR comments and pushing commits back to the PR branch

Possibly related PRs

Suggested reviewers

  • youknowone

Poem

🐰 In workflows so clean, a rabbit did scheme,
Removing old checks for a formatting dream—
Now PRs auto-bloom with fmt's gentle touch,
No manual fussing, we loved this so much!

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2d46172 and 9bfaab7.

📒 Files selected for processing (2)
  • .github/workflows/ci.yaml (1 hunks)
  • .github/workflows/pr-auto-commit.yaml (1 hunks)

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant