feat(bin): detect a real Chromium binary in bootstrap - #857
Closed
Freudator86 wants to merge 2 commits into
Closed
Conversation
chrome-devtools-axi's headless launches need a real Chromium binary underneath, but bootstrap only documented the requirement without ever checking for it (chromium-toolchain-r7k). Report MISSING: chromium the same way every other toolchain gap is reported, checking every binary name actually seen across install methods.
The missing-binary case only removed the fake stub, so a CI image with a real chromium-browser/google-chrome already on PATH made the case non-hermetic and let it silently pass or fail depending on the runner. Mask every candidate name the same way the git-required case masks a real git.
Closed
4 tasks
Contributor
Author
|
Closing this ourselves. The gap it addresses is real - bootstrap never checked for a browser - but
All ten checks pass on this PR, which is worth stating plainly: green means the checks ran, not that A correct successor is a different change and belongs with the tool rather than here: a capability |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Add real Chromium binary detection to bin/fm-bootstrap.sh's tool-detection machinery. Chromium was documented (chromium-toolchain-r7k, PR #704) as a required toolchain item for chrome-devtools-axi's headless launches but bootstrap never actually checked for it. Added a chromium_binary_present() helper that checks candidate binary names (chromium, chromium-browser, google-chrome, google-chrome-stable) since no single name is universal across install methods (system package vs Playwright-managed install), wired into the existing install_cmd/MISSING: reporting convention used by every other tool in the script (install command is 'npx --yes playwright install-deps chromium', matching the doc PR's documented manual remediation). This is a fleet-wide framework change scoped only to the detection gap - it deliberately does not touch docs/configuration.md, which is owned by the separate still-open PR #704. Extended tests/fm-bootstrap.test.sh with a new test_chromium_binary_detection covering missing, present, and each alternate binary name, and stubbed a fake chromium binary into the shared make_fake_toolchain fixture so existing silent-output test cases remain silent. Ran bin/fm-lint.sh (shellcheck 0.11.0) clean before committing.
What Changed
chromium_binary_present()helper tobin/fm-bootstrap.shthat checks for any ofchromium,chromium-browser,google-chrome, orgoogle-chrome-stableon PATH, since no single binary name is universal across install methods (system package vs. Playwright-managed install).install_cmd/MISSING:reporting convention, emittingMISSING: chromium (install: npx --yes playwright install-deps chromium)when no candidate binary is found.tests/fm-bootstrap.test.shwithtest_chromium_binary_detection, covering the missing case, the present case, and each alternate binary name, and stubbed a fake chromium binary into the sharedmake_fake_toolchainfixture so existing silent-output test cases remain silent.Risk Assessment
✅ Low: Small, well-bounded addition (one detection helper + one MISSING line + matching tests) that follows the script's existing install_cmd/MISSING conventions, is unconditional in a way consistent with chrome-devtools-axi already being a universal COMMON_TOOLS entry, and matches every constraint in the stated intent (candidate names, install command, non-touching of docs/configuration.md, test fixture updates).
Testing
Ran the full fm-bootstrap test suite (22/22 pass, including the new test_chromium_binary_detection covering missing/present/alternate-name cases), then independently reproduced the end-user CLI experience by invoking bin/fm-bootstrap.sh directly with a fake toolchain: with no Chromium-family binary on PATH it prints MISSING: chromium with the documented playwright install command, and adding a chromium-browser stub makes that line disappear while other MISSING lines stay unaffected — confirming the detection helper and its wiring into the MISSING: reporting convention work end-to-end as the author intended.
Evidence: Manual CLI transcript: bootstrap output with/without a chromium-family binary on PATH
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-bootstrap.sh:8- The file header comment documents every special-cased MISSING behavior (treehouse's lease-support check, no-mistakes' version check, tasks-axi/quota-axi's version+feature gate) but wasn't updated to mention the new unconditional 'MISSING: chromium' check, which is likewise a bespoke check outside the COMMON_TOOLS/BACKEND_TOOLS loop. Worth a one-line addition alongside the existing treehouse/no-mistakes/tasks-axi notes so the header remains a complete contract of the script's output lines.✅ **Test** - passed
✅ No issues found.
bash tests/fm-bootstrap.test.sh— full suite, 22/22 tests pass including newtest_chromium_binary_detection(missing/present/each alternate name)Manual CLI run ofbin/fm-bootstrap.sh(not via test harness) with a fake toolchain and no chromium-family binary on PATH: real output includesMISSING: chromium (install: npx --yes playwright install-deps chromium)Same manual run after adding achromium-browserstub to PATH: the MISSING: chromium line disappears while unrelated MISSING lines (treehouse, no-mistakes, tasks-axi, quota-axi) are unchangedConfirmed no chromium/chromium-browser/google-chrome/google-chrome-stable exists on this machine's real PATH, so Scenario A reflects genuine (non-stubbed) absencegit status --porcelainafter testing — worktree left clean, no stray artifacts✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.