Skip to content

Tooling: Fixed PHPCS check. #1146

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

Merged
merged 3 commits into from
Aug 13, 2025
Merged

Tooling: Fixed PHPCS check. #1146

merged 3 commits into from
Aug 13, 2025

Conversation

veryspry
Copy link
Contributor

@veryspry veryspry commented Aug 13, 2025

Context

The PHPCS check was failing

Summary

  • Newer GH action runners don't have apt-fast installed (or aliased to apt). Updates nanasess/setup-php to version 4.1.0 which accounts for that change.
  • Also updates actions/checkout to version 5. Unrelated to the above, but just for house keeping purposes.

Copy link

coderabbitai bot commented Aug 13, 2025

Walkthrough

Updated the GitHub Actions workflow .github/workflows/php-lint-pr.yml: actions/checkout bumped from v2 to v5, nanasess/setup-php replaced with shivammathur/setup-php@v2 and given inputs tools: composer:v2 and coverage: none; added a trailing newline. No phpcs configuration changes.

Changes

Cohort / File(s) Summary of changes
CI workflow
.github/workflows/php-lint-pr.yml
actions/checkout v2 → v5; nanasess/setup-php v3 → shivammathur/setup-php@v2; added inputs tools: composer:v2 and coverage: none; added trailing newline; phpcs standard line unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes


📜 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 52aa9f9 and 2c29a3b.

📒 Files selected for processing (1)
  • .github/workflows/php-lint-pr.yml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/php-lint-pr.yml
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch matt/phpcs-fix

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Aug 13, 2025

Warnings
⚠️ When ready, don't forget to request reviews on this pull request from your fellow wizards.
Messages
📖 Look at you go, you GitHub Actions wizard! 🧙‍️

Generated by 🚫 dangerJS against 2c29a3b

@veryspry veryspry changed the title Updates PHPCS Tooling: Fixed PHPCS check. Aug 13, 2025
@veryspry veryspry requested a review from claygriffiths August 13, 2025 19:53
@veryspry veryspry marked this pull request as ready for review August 13, 2025 19:53
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: 0

🧹 Nitpick comments (2)
.github/workflows/php-lint-pr.yml (2)

15-18: setup-php v4.1.0 addresses apt-fast; watch out for PHP 7.4 install on ubuntu-latest.

This resolves the apt-fast/apt change. One caveat: installing PHP 7.4 on ubuntu-latest (currently 24.04) can be flaky/unavailable via PPAs. If you hit intermittent failures, either:

  • Pin the runner to ubuntu-22.04, which still reliably supports PHP 7.4 via apt.
  • Or switch to shivammathur/setup-php, which provides prebuilt PHP versions and is more resilient for EOL versions.

Suggested alternatives:

Option A (pin the runner)

runs-on: ubuntu-22.04

Option B (switch action)

-      - uses: nanasess/setup-php@v4.1.0
+      - uses: shivammathur/setup-php@v2
         with:
           php-version: '7.4'

26-26: Explicit ‘standard: phpcs.xml’ is fine; consider using phpcs.xml.dist for flexibility.

If you want local overrides without changing CI, use phpcs.xml.dist in the repo and keep developers’ local phpcs.xml ignored. Not required; current config is 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 1c23cff and e22c6af.

📒 Files selected for processing (1)
  • .github/workflows/php-lint-pr.yml (2 hunks)
🔇 Additional comments (1)
.github/workflows/php-lint-pr.yml (1)

10-12: actions/checkout v5 bump looks good; confirm Node20 compatibility if using GHES/self-hosted.

v5 runs on Node 20. On github.com’s ubuntu-latest this is fine. If you’re on GHES or self-hosted runners pinned to older Node, verify compatibility.

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)
.github/workflows/php-lint-pr.yml (1)

15-15: Switched from nanasess/setup-php to shivammathur/setup-php — confirm intent; add composer tool pinning

PR description mentions updating nanasess/setup-php, but the workflow now uses shivammathur/setup-php@v2. That’s fine (and commonly preferred), but please confirm this change was intentional.

While here:

  • Ensure Composer v2 is available and consistent by pinning via tools.
  • Disable code coverage to avoid installing/initializing xdebug unnecessarily.

Suggested tweak:

-      - uses: shivammathur/setup-php@v2
-        with:
-          php-version: '7.4'
+      - uses: shivammathur/setup-php@v2
+        with:
+          php-version: '7.4'
+          tools: composer:v2
+          coverage: none

Note: PHP 7.4 is EOL; keeping it here to avoid the vsprintf fatal (per your comment) is reasonable, but please confirm it’s still required.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e22c6af and 52aa9f9.

📒 Files selected for processing (1)
  • .github/workflows/php-lint-pr.yml (2 hunks)
🔇 Additional comments (1)
.github/workflows/php-lint-pr.yml (1)

26-26: LGTM: explicit PHPCS standard set

Explicitly specifying phpcs.xml is clear and matches the repo’s configuration. PHPCS would auto-detect this file name, but keeping it explicit is fine.

@@ -7,12 +7,12 @@ jobs:
name: PHPCS (Files Changed)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v5
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify actions/checkout@v5 exists; consider pinning to a known-good version or commit SHA

I’m not certain v5 of actions/checkout is released/available. v4 is the widely-used current major. If v5 doesn’t exist (or is pre-release), this will fail at runtime. Also, for supply-chain hardening, pinning to a commit SHA is recommended.

Consider this safe fallback if v5 is unavailable:

-      - uses: actions/checkout@v5
+      - uses: actions/checkout@v4

Optionally, pin to a specific commit SHA for checkout instead of a floating tag.

To confirm the latest published version of actions/checkout, please run this web search:


🌐 Web query:

What is the latest released version of GitHub Actions "actions/checkout"?

💡 Result:

The latest released version of the GitHub Actions actions/checkout action is v5.0.0, released on August 11, 2025[7][3].

  • v5.0.0 requires runner version 2.327.1 or newer[7].
  • The preceding stable release was v4.3.0[3][7].

When specifying the version in your workflow, use:

- uses: actions/checkout@v5

or, to pin exactly:

- uses: actions/checkout@v5.0.0

Recent minor versions (such as v4.1.4) are now superseded, and the use of v5 is recommended for the latest features and compatibility[7][3].

Citations:


Confirm: actions/checkout@v5 is released — pin to a release or SHA and verify runner compatibility

Web results show actions/checkout v5.0.0 is released (2025-08-11) and requires runner >= 2.327.1. You can keep @v5, but for supply-chain hardening pin to the exact release or a commit SHA.

  • File to update:
    • .github/workflows/php-lint-pr.yml (around line 10)

Suggested change:

-      - uses: actions/checkout@v5
+      - uses: actions/checkout@v5.0.0

Or, for stronger pinning, use the action's commit SHA:

  •  - uses: actions/checkout@<commit-sha>
    

If you use self-hosted runners older than 2.327.1, either upgrade them or stay on v4 as a fallback.

📝 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.

Suggested change
- uses: actions/checkout@v5
- uses: actions/checkout@v5.0.0
🤖 Prompt for AI Agents
In .github/workflows/php-lint-pr.yml around line 10, the step uses
actions/checkout@v5 which is a floating tag; pin it to a specific release or
commit SHA and verify runner compatibility. Replace the loose @v5 with an exact
released tag (for example @v5.0.0) or the action's commit SHA to harden the
supply chain, and confirm your runners are >= 2.327.1 (or keep @v4 as a fallback
for older self-hosted runners).

@veryspry veryspry merged commit 58314e5 into master Aug 13, 2025
4 checks passed
@veryspry veryspry deleted the matt/phpcs-fix branch August 13, 2025 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants