[#109] Compared 'SCRIPT_RUN_SKIP' strictly in the bootstrap guard. - #127
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 16 minutes Limit details: You’ve used all 2 included reviews currently available under your plan. You completed 87 included PR reviews in the past 7 days; at that activity level, included reviews refill at 2 reviews per hour. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #127 +/- ##
=======================================
Coverage 84.98% 84.98%
=======================================
Files 3 3
Lines 433 433
=======================================
Hits 368 368
Misses 65 65 ☔ View full report in Codecov by Harness. |
Closes #109
Summary
The bootstrap guard in
apiserver/index.phpcomparedgetenv('SCRIPT_RUN_SKIP')loosely against the integer1, even though the file declaresstrict_types=1. Sincegetenv()returnsstring|false, this was a string-to-int loose comparison whose set of accepted values is not obvious from reading the code and not the set most people would guess. The comparison now uses!== '1', a strict string comparison. Neither of the two cases the codebase actually exercises changes behaviour: Behat leaves the variable unset and the server still starts, andphpunit.xmlsets it to the string1and the bootstrap is still skipped.Changes
getenv('SCRIPT_RUN_SKIP') != 1becamegetenv('SCRIPT_RUN_SKIP') !== '1'inapiserver/index.php.'1'spellings change treatment: values like'01','1.0'and' 1'used to compare loosely equal to1and skip the bootstrap; they no longer match the strict'1'check, so they now fall through and run it instead.false, how Behat runs) still leaves the bootstrap running, and the string'1'(howphpunit.xmlsets it via<env name="SCRIPT_RUN_SKIP" value="1"/>) still skips it.composer test(124 tests, 259 assertions) exercises the'1'skip path, since PHPUnit sets the variable,composer test-bdd(14 scenarios, 153 steps) exercises the unset run path, since Behat does not set it, andcomposer lintis clean.Before / After
!= 1)!== '1')false(Behat)'1'(PHPUnit, viaphpunit.xml)'01''1.0'' 1''true'/'yes'/'on'