Skip to content

Ignore platform requirements in Qodana bootstrap - #644

Merged
mambax7 merged 2 commits into
masterfrom
fix/qodana-bootstrap
Oct 9, 2026
Merged

mambax7 merged 2 commits into
masterfrom
fix/qodana-bootstrap

Conversation

@mambax7

@mambax7 mambax7 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Qodana's bootstrap runs composer install inside the JetBrains linter container, which has no ext-bcmath. moneyphp/money requires it, so the install fails and the scan exits with code 2. This has happened on master since the scan started running for real (#643).

Qodana only reads vendor code for type information and never runs it, so --ignore-platform-reqs is safe here. The real platform check is still composer check-platform-reqs in ci.yml.

Summary by Sourcery

Bug Fixes:

  • Allow Qodana bootstrap dependency installation to succeed when the linter container lacks PHP extensions required by project packages.

Summary by CodeRabbit

  • Bug Fixes
    • During bootstrap, Composer dependency installation now ignores requirements for PHP extensions. Setup can therefore continue when an extension required by a package is unavailable in the environment, instead of stopping because that extension requirement is unmet. This change applies to PHP extension requirements during installation.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 03:07
@sourcery-ai

sourcery-ai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates Qodana's Composer bootstrap to ignore platform requirements because the linter container lacks ext-bcmath, while leaving real platform compatibility checks to CI.

Sequence diagram for Qodana Composer bootstrap and CI platform checks

sequenceDiagram
    participant Qodana
    participant Composer
    participant CI

    Qodana->>Composer: config platform.php 8.4
    Qodana->>Composer: install --no-interaction --prefer-dist --ignore-platform-reqs
    Composer-->>Qodana: Vendor code installed for type information
    CI->>Composer: check-platform-reqs
    Composer-->>CI: Report real platform compatibility
Loading

File-Level Changes

Change Details Files
Allow Qodana's dependency bootstrap to succeed without matching the linter container's PHP extensions.
  • Add Composer's --ignore-platform-reqs option to the bootstrap install command.
  • Continue pinning the Composer PHP platform to 8.4 and installing non-interactively from preferred distribution packages.
qodana.yaml
Keep runtime platform validation in the CI workflow rather than the static-analysis bootstrap.
  • Rely on the existing composer check-platform-reqs CI step for actual platform compatibility validation.
ci.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: XOOPS/XoopsCore26/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 0248606c-13ea-408c-aaeb-1c90d57c8825
📥 Commits

Reviewing files that changed from the base of the PR and between 91bb115 and 6a77713.

📒 Files selected for processing (1)
  • qodana.yaml

Included review availability: This review used your included allowance. Your plan provides up to 5 included reviews per hour; 0 remain after this review.


Walkthrough

The bootstrap Composer install command now passes --ignore-platform-req=ext-* to ignore PHP extension requirements.

Changes

Composer Bootstrap

Layer / File(s) Summary
Composer install option
qodana.yaml
The bootstrap Composer install command now includes --ignore-platform-req=ext-*.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 6a777

No confirmed merge-blocking issue remains. Confirm the Composer version in the Qodana image during normal validation.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: the Qodana bootstrap now ignores platform requirements during Composer installation.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@gitar-bot

gitar-bot Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Gitar is working

Gitar

Copilot AI 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.

🟡 Changes recommended

The broad bypass can resolve dependencies incompatible with the configured PHP 8.4 target; only ext-bcmath should be ignored.

1 open finding
What changed in this PR

Updates Qodana bootstrap to install dependencies despite the linter image lacking ext-bcmath.

Changes:

  • Adds platform-requirement bypassing to Composer installation.
File Description
qodana.yaml Adjusts Qodana dependency installation flags.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread qodana.yaml Outdated

@sourcery-ai sourcery-ai 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.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="qodana.yaml" line_range="11" />
<code_context>
   version: "8.4"

-bootstrap: cp composer.json.dist composer.json && composer config platform.php 8.4 && composer install --no-interaction --prefer-dist
+bootstrap: cp composer.json.dist composer.json && composer config platform.php 8.4 && composer install --no-interaction --prefer-dist --ignore-platform-reqs

 exclude:
</code_context>
<issue_to_address>
**Qodana scan fails on newer PHP dependencies**

When a dependency allowed by the declared constraints requires PHP newer than 8.4, composer ignores the PHP platform requirement and can install that dependency; Qodana then cannot analyze the vendor code with PHP 8.4, so the scan fails.

Remove `--ignore-platform-reqs` so Composer enforces the configured PHP 8.4 platform requirement.

Also at `qodana.yaml:12`.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: qodana.yaml:11


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread qodana.yaml Outdated
@mambax7

mambax7 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Narrowed in 6a77713 to '--ignore-platform-req=ext-*'. It now ignores only missing PHP extensions, and the platform.php 8.4 pin is enforced again (checked locally: with platform.php 8.0 resolution fails on php ^8.4, and with ext-bcmath disabled it resolves). I used ext-* rather than only ext-bcmath because the linter image may lack other extensions, and Composer stops at the first one it reports.

@sourcery-ai sourcery-ai 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.

Sourcery assessment

Approved.

@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

Copilot AI 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.

🟢 Approval recommended

The targeted Composer option resolves the bootstrap failure while retaining CI platform checks.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@mambax7
mambax7 merged commit 432d394 into master Oct 9, 2026
12 of 13 checks passed
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