fix: safeguard whitespaces#29153
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
None of these changes affect:
These are purely defensive build-time improvements to prevent malformed secrets (with trailing newlines) from being baked into the JS bundle. The changes are semantically no-ops for well-formed secrets and only add protective validation. No E2E tests need to run to validate these changes, and there is no performance impact. Performance Test Selection: |
Description
Cherry pick: #29151
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Touches CI secret injection and env-var remapping used during builds; a mistake could break build pipelines or alter expected secret values, though changes are limited to trimming surrounding whitespace and adding validation.
Overview
Build workflows now defensively strip leading/trailing whitespace from CI secrets before exporting them to the build environment, and warn when trimming occurs.
GitHub Actions builds additionally fail fast if any mapped env var still contains surrounding whitespace via a new
scripts/check-env-whitespace.jsstep afterset-secrets-from-config.js, reducing the chance of shipping binaries with broken OAuth/API keys caused by trailing newlines.Reviewed by Cursor Bugbot for commit 216761d. Bugbot is set up for automated code reviews on this repo. Configure here.