Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@janisozaur
Copy link
Owner

@janisozaur janisozaur commented Sep 20, 2025

Summary by CodeRabbit

  • Chores

    • Enhanced CI formatting checks: added explicit permissions and a step that posts actionable comments on pull requests when formatting issues are found, helping contributors address problems quickly.
  • Style

    • Minor whitespace-only change with no functional impact.

@coderabbitai
Copy link

coderabbitai bot commented Sep 20, 2025

Walkthrough

Adds explicit permissions and an ID to the clang-format check in the CI workflow and adds a follow-up step that uses parkerbxyz/suggest-changes to comment/request changes on PRs when formatting fails. Also applies a whitespace-only change in a C++ source file with no functional impact.

Changes

Cohort / File(s) Summary of Changes
CI workflow: formatting check and PR comments
.github/workflows/ci.yml
Added a permissions block for the formatting job, added an id to the clang-format step, and added a follow-up step using parkerbxyz/suggest-changes@v3 to post a comment and signal REQUEST_CHANGES when formatting fails.
Source: whitespace-only edit
src/openrct2/actions/GameAction.cpp
Minor whitespace adjustment in a conditional (if (result.Error == Status::Ok)) with no behavioral change.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant PR as Pull Request
  participant GH as GitHub Actions
  participant Job as check-code-formatting
  rect #E8F8F5
    Dev->>PR: Open or update PR
    PR->>GH: Trigger workflow
    GH->>Job: Run formatting job (permissions set)
    Job->>Job: Run clang-format step (id: clang-format)
  end
  alt Formatting passes
    Job-->>PR: Report success
  else Formatting fails
    rect #FFF4E6
      Job->>PR: Run suggest-changes action (post comment, REQUEST_CHANGES)
      Job-->>PR: Report failure / changes requested
    end
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

I nibbled the YAML, neat and bright,
A comment hops when checks aren’t right.
With whiskered care I tap my paw—
“Please fix the formats, mind the law.”
One space here, one hop there—🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Suggest code format" succinctly reflects the primary change in this pull request, which adds an automated suggestion/comment for code formatting in the CI workflow. It is short, focused, and directly related to the changes in ci.yml and the new suggest-changes step. The phrasing is clear enough for reviewers to understand the PR's intent.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch suggest-code-format

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c7bcdd9 and b75218d.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml (2 hunks)
  • src/openrct2/actions/GameAction.cpp (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/ci.yml
  • src/openrct2/actions/GameAction.cpp
⏰ 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). (1)
  • GitHub Check: Analyze (c-cpp)

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please commit the suggested changes from clang-format.

}
#endif
if (result.Error == Status::Ok)
if (result.Error == Status::Ok)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (result.Error == Status::Ok)
if (result.Error == Status::Ok)

Copy link

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (1)
src/openrct2/actions/GameAction.cpp (1)

322-326: Fix formatting to satisfy clang-format (CI is red).

Double spaces around the equality operator violate the style rule and cause the pipeline to fail.

Apply this diff:

-        if (result.Error  ==  Status::Ok)
+        if (result.Error == Status::Ok)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ad79fa and c7bcdd9.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml (1 hunks)
  • src/openrct2/actions/GameAction.cpp (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: CI
src/openrct2/actions/GameAction.cpp

[error] 319-319: Code style issue: spacing around operator; 'result.Error == Status::Ok' should be 'result.Error == Status::Ok'.

🔇 Additional comments (1)
.github/workflows/ci.yml (1)

141-143: Nice: stable step id for referencing.

Adding id: clang_format improves readability and future conditionals.

janisozaur and others added 3 commits September 22, 2025 22:54
Update permissions for actions for OpenRCT2#25211 .

It needs to be done this way and *not* via token, because pull
requests have no access to secrets.

The default branch dictates what kind of access the default actions token has
(constrained by repo config in https://github.com/OpenRCT2/OpenRCT2/settings/actions)
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.

2 participants