-
Notifications
You must be signed in to change notification settings - Fork 855
build(mac): split bundle step and capture stderr for diagnostics #9965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -291,8 +291,29 @@ _complete_bundle() { | |
| pushd "${SOURCE_DIR}/web" > /dev/null || exit | ||
| yarn set version berry | ||
| yarn set version 4 | ||
| yarn install | ||
| yarn run bundle | ||
| yarn install 2>&1 | ||
|
|
||
| # Record the source commit hash before the heavy lint/webpack | ||
| # steps. `yarn run` needs node_modules so this runs after install, | ||
| # but it's a pure `git log` redirect (see web/package.json | ||
| # "git:hash") that costs ~nothing, so doing it up front means the | ||
| # commit_hash file is captured even if webpack later bails out. | ||
| echo "==> Recording git hash..." | ||
| yarn run git:hash | ||
|
|
||
| # Split the "bundle" script into its underlying steps and merge | ||
| # stderr into stdout, so a crash inside lint/webpack (e.g. an OOM | ||
| # kill or native-module load failure) leaves a trace in the | ||
| # Jenkins console instead of an empty gap before the trap fires. | ||
| # Env vars match the top-level "bundle" npm script (see web/package.json) | ||
| # so behavior is identical to `yarn run bundle`. | ||
| export NODE_ENV=production | ||
| export NODE_OPTIONS=--max-old-space-size=3072 | ||
| echo "==> Running ESLint..." | ||
| yarn run linter 2>&1 | ||
| echo "==> Running webpack bundle..." | ||
| yarn run webpacker 2>&1 | ||
|
Comment on lines
+313
to
+315
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add error handling for If either linting or webpack bundling fails, the build should stop immediately. Without explicit error handling, the script will continue after failures and produce incomplete or broken build artifacts. Linting failures indicate code quality issues that should block release, and webpack failures mean the frontend bundle is missing or corrupted. Both are critical build gates. 🛡️ Proposed fix to add error handling echo "==> Running ESLint..."
- yarn run linter 2>&1
+ yarn run linter 2>&1 || exit 1
echo "==> Running webpack bundle..."
- yarn run webpacker 2>&1
+ yarn run webpacker 2>&1 || exit 1
unset NODE_ENV NODE_OPTIONS🤖 Prompt for AI Agents |
||
| unset NODE_ENV NODE_OPTIONS | ||
|
|
||
| curl https://curl.se/ca/cacert.pem -o cacert.pem -s | ||
| popd > /dev/null || exit | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error handling for
yarn installandyarn run git:hash.Both commands lack explicit error handling (e.g.,
|| exit 1). Ifyarn installfails, subsequent build steps will operate on broken or incomplete dependencies, producing unusable artifacts. Thegit:hashstep is less critical but should still fail fast if it cannot complete.Other critical commands in this file (lines 92–93) follow the
|| exit 1pattern. Apply the same here to maintain consistency and ensure build failures are caught immediately.🛡️ Proposed fix to add error handling
📝 Committable suggestion
🤖 Prompt for AI Agents