Skip to content

Fix CI concurrent build exiting before static site generation#2122

Draft
seveibar wants to merge 1 commit intomainfrom
codex/identify-edge-case-for-config-build-failure
Draft

Fix CI concurrent build exiting before static site generation#2122
seveibar wants to merge 1 commit intomainfrom
codex/identify-edge-case-for-config-build-failure

Conversation

@seveibar
Copy link
Contributor

Motivation

  • Concurrent builds could call process.exit(1) from a worker onJobComplete when a fatal error occurred, which could terminate the process before post-build steps like --site completed.
  • This caused an edge case where a config that uses prebuildCommand to generate board files (with includeBoardFiles globs and previewComponentPath/siteDefaultComponentPath set) would not produce dist/index.html or other outputs if any parallel build fatally failed.

Description

  • Removed the immediate process.exit(1) inside the worker onJobComplete handler and no longer exit from inside the parallel job callback.
  • Defer final exit handling until after all post-build tasks run and compute the exit code from hasFatalErrors and hasErrors vs ignoreErrors.
  • Added a regression test tests/cli/build/build-ci-concurrency-site-fatal.test.ts that reproduces the scenario using a prebuildCommand that generates one successful and one fatally failing board file, and runs tsci build --ci --concurrency 4 to verify site output is still generated from successful builds.
  • Changes are in cli/build/register.ts and the new test file under tests/cli/build/.

Testing

  • Ran bun test tests/cli/build/build-ci-concurrency-site-fatal.test.ts and the test passed.
  • Ran bunx tsc --noEmit for typechecking and it completed with no errors.
  • Ran bun run format to format changes and it completed successfully.

Codex Task

@github-actions
Copy link
Contributor

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant