Repository navigation
fix(cli): name the launch variable in invalid launch-default startup errors - #236
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
…errors Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Note: since this fix was opened, |
|
Superseded by #239, merged for 2.9.0. The original fix and regression test were cherry-picked with attribution, then adjusted for the final main branch's decoupled profile parsing. Launch validation now reports the actual environment variable while preserving explicit daemon stdin overrides and management commands. Closing this outdated maintenance-branch draft after the replacement landed. |
What and why
What: This is a fix for #235, which targets
maintenance/2.8.9at reviewed head1c468b5. The CLI startup preflight now prints invalid launch-default environment errors under the variable that is actually wrong. Real profile errors keep theBETTERWRIGHT_PROFILE:/--profile:label.Why: In #235,
cliProfile()now callslaunchOptionsFromEnv(), which validatesBETTERWRIGHT_HEADLESSandBETTERWRIGHT_DOWNLOAD_POLICY. The preflightcatchinrunClithen puts the profile-source label on every error, so a bad display/download variable points the user at the wrong setting:Every command that runs the preflight hits this, including
doctorandcookies browsers. The fix leaves the label off any error message that already starts with aBETTERWRIGHT_*variable name. It is a small change: 1 source hunk plus 1 regression test.Checklist
bun run release:checkwas not run in full. On this Linux VM,test:unithas 2 failures that come from the environment and are unrelated to this change: thechromium-packagepackager tests need Python ≥3.11hashlib.file_digest, and the VM has 3.10. These tests fail the same way on the reviewed head. lint, typecheck, andbuild:harnesspass.types/*.d.ts: no change.dist/bin/betterwright.js.How it was verified
invalid launch environment errors name their own variable, not the profile sourceintests/node/cli-startup.test.ts. On reviewed head1c468b5it fails (0 pass / 1 fail). On this branchce29ba3it passes, and the whole file passes (5/5).BETTERWRIGHT_HEADLESS=maybe(with and without--profile work),BETTERWRIGHT_DOWNLOAD_POLICY=sometimesandBETTERWRIGHT_PROFILE=../escape. The last case still printsBETTERWRIGHT_PROFILE: invalid profile name ….Recording of the before/after run and the regression test (MP4): https://app.devin.ai/api/presigned_proxy?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjpudWxsLCJidWNrZXRfbmFtZSI6ImRldmluYXR0YWNobWVudHMiLCJidWNrZXRfa2V5IjoiYXR0YWNobWVudHNfcHJpdmF0ZS9vcmctYmQ0NTliYTUyOTRiNDEyMGJiYWRhNmE1Y2JmODIyZTUvNDJlOWZhZTEtMTllZS00NjQyLWJmNDMtMmU3OTRiMTUxNzA0IiwiaWF0IjoxNzkxODU3NjM1LCJvcmdfaWQiOiJvcmctYmQ0NTliYTUyOTRiNDEyMGJiYWRhNmE1Y2JmODIyZTUiLCJmaWxlbmFtZSI6InByMjM1LWNsaS1sYWJlbC1maXgtY2UyOWJhMy5tcDQifQ.LyhQ7_wNl-g6MbxqOidy7--kqyPUSo9qYyYje4W3Fgw
Full E2E report: on #235.
Written by Devin
Open in Devin Desktop: https://app.devin.ai/desktop/session/4e6d7e2ecdb94f9c87e8ed1a4ea75614?variant=devin