Skip to content

Run php-cs-fixer sequentially - #10

Merged
lolgab merged 1 commit into
mainfrom
php-cs-fixer-sequential
Dec 3, 2026
Merged

lolgab merged 1 commit into
mainfrom
php-cs-fixer-sequential

Conversation

@lolgab

@lolgab lolgab commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

php-cs-fixer pods have no CPU limit, so the CPU count php-cs-fixer sees is the whole node's (16–64 cores), not the pod's 1-core request. Since v3.94, new Config() always turns on parallel mode sized from that count, so a 100-file chunk runs up to ~10 php-cs-fixer worker processes, each with its own PHP heap, against a 1.5Gi memory limit.

  • The wrapper now passes --sequential to php-cs-fixer check: one process, matching the 1-core CPU request.
  • --sequential wins over any parallel config, including one set in a repo's own .php-cs-fixer.php (ConfigurationResolver::getParallelConfig at v3.95.26).

Same fix as codacy/codacy-opengrep#50.

  • Build the image and run the multiple-tests suite (CircleCI plugins_test)
  • After deploy, 7 days: php-cs-fixer ToolOutOfMemory count vs before
  • After deploy, 7 days: p99 run time and timeouts vs before (one process can be slower on idle nodes)

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@lolgab
lolgab requested a review from DMarinhoCodacy December 3, 2026 10:23
@lolgab
lolgab marked this pull request as ready for review December 3, 2026 10:23
@lolgab
lolgab enabled auto-merge (squash) December 3, 2026 10:23

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

✅ No blocking issues noticed

No blocking findings were identified. Automated coverage is missing for command construction, configuration precedence, and ensuring multi-file linting does not spawn parallel workers.

Test suggestions

  • Verify the generated php-cs-fixer command includes --sequential.
  • Verify sequential mode remains effective when repository configuration enables parallel execution.
  • Run a multi-file lint chunk and verify no parallel worker processes are spawned.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify the generated php-cs-fixer command includes `--sequential`.
2. Verify sequential mode remains effective when repository configuration enables parallel execution.
3. Run a multi-file lint chunk and verify no parallel worker processes are spawned.

TIP Add review instructions in .codacy/instructions/review.md, or an AGENTS.md, so the reviewer knows your conventions.
TIP How was this review? Give us feedback

@lolgab
lolgab merged commit c8f0a32 into main Dec 3, 2026
4 checks passed
@lolgab
lolgab deleted the php-cs-fixer-sequential branch December 3, 2026 10:24
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