Skip to content

[#109] Compared 'SCRIPT_RUN_SKIP' strictly in the bootstrap guard. - #127

Merged
AlexSkrypnyk merged 1 commit into
mainfrom
feature/strict-skip-guard
Aug 18, 2026
Merged

[#109] Compared 'SCRIPT_RUN_SKIP' strictly in the bootstrap guard.#127
AlexSkrypnyk merged 1 commit into
mainfrom
feature/strict-skip-guard

Conversation

@AlexSkrypnyk

Copy link
Copy Markdown
Member

Closes #109

Summary

The bootstrap guard in apiserver/index.php compared getenv('SCRIPT_RUN_SKIP') loosely against the integer 1, even though the file declares strict_types=1. Since getenv() returns string|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, and phpunit.xml sets it to the string 1 and the bootstrap is still skipped.

Changes

  • getenv('SCRIPT_RUN_SKIP') != 1 became getenv('SCRIPT_RUN_SKIP') !== '1' in apiserver/index.php.
  • Only the numeric-but-not-'1' spellings change treatment: values like '01', '1.0' and ' 1' used to compare loosely equal to 1 and skip the bootstrap; they no longer match the strict '1' check, so they now fall through and run it instead.
  • The two real cases are untouched: an unset variable (false, how Behat runs) still leaves the bootstrap running, and the string '1' (how phpunit.xml sets it via <env name="SCRIPT_RUN_SKIP" value="1"/>) still skips it.
  • The guard itself is unchanged and still in place, so the requirement in AGENTS.md not to remove it still holds; only the comparison operator was tightened.
  • Verified with the existing suites rather than a new test: 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, and composer lint is clean.

Before / After

SCRIPT_RUN_SKIP value Before (!= 1) After (!== '1') Changed
unset / false (Behat) server runs server runs no
'1' (PHPUnit, via phpunit.xml) bootstrap skipped bootstrap skipped no
'01' bootstrap skipped server runs yes
'1.0' bootstrap skipped server runs yes
' 1' bootstrap skipped server runs yes
'true' / 'yes' / 'on' server runs server runs no

@AlexSkrypnyk AlexSkrypnyk added this to the 2.4 milestone Aug 18, 2026
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

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.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8179c39c-c6c6-4cdb-8298-e848ec1c8f3b

📥 Commits

Reviewing files that changed from the base of the PR and between 7b853c9 and 5ad8c91.

📒 Files selected for processing (1)
  • apiserver/index.php

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

@github-actions

Copy link
Copy Markdown
Code Coverage Report:
  2026-08-18 08:17:39

 Summary:
  Classes: 20.00% (1/5)
  Methods: 66.67% (24/36)
  Lines:   82.27% (362/440)

DrevOps\BehatPhpServer\ApiServerContext
  Methods:  75.00% ( 9/12)   Lines:  95.90% (117/122)
DrevOps\BehatPhpServer\ApiServer\ApiServer
  Methods:  20.00% ( 1/ 5)   Lines:   7.94% (  5/ 63)
DrevOps\BehatPhpServer\ApiServer\Request
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
DrevOps\BehatPhpServer\ApiServer\Response
  Methods:  66.67% ( 2/ 3)   Lines:  95.12% ( 39/ 41)
DrevOps\BehatPhpServer\PhpServerContext
  Methods:  73.33% (11/15)   Lines:  96.15% (200/208)

@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.98%. Comparing base (7b853c9) to head (5ad8c91).
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

@AlexSkrypnyk AlexSkrypnyk added the Needs review Pull request needs a review from assigned developers label Aug 18, 2026
@AlexSkrypnyk
AlexSkrypnyk merged commit ee4de74 into main Aug 18, 2026
20 checks passed
@AlexSkrypnyk
AlexSkrypnyk deleted the feature/strict-skip-guard branch August 18, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs review Pull request needs a review from assigned developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compare 'SCRIPT_RUN_SKIP' strictly in the bootstrap guard

1 participant