Skip to content
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

fix(build): ensure build fails when types building fails #4812

Merged
merged 3 commits into from
Jul 16, 2021

Conversation

tkrugg
Copy link
Contributor

@tkrugg tkrugg commented Jul 15, 2021

Summary
At the moment failing build types are not being surfaced to circle ci. See for example this build, step Trigger a release if the latest commit is a release commit should have failed but it didn't.

This is because yarn built:types is run via shell.exec and the return code of 1 is ignored, instead of passed to calling process.

Per exec docs, it's the caller's reponsibility to read the exit code and exit or continue.

// Run external tool synchronously
if (shell.exec('git commit -am "Auto-commit"').code !== 0) {
  shell.echo('Error: Git commit failed');
  shell.exit(1);
}

This change would effectively make sure that scripts/release/build-experimental-typescript.js return code 1 if any of the exec inside do.

NB: exec is also called in other areas but in this case, it's not from shelljs but the one in shipjs-lib which reads and throws when code is 1.

Verified

This commit was signed with the committer’s verified signature.
wmouchere William Mouchère
Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the same but a simpler option?

Verified

This commit was signed with the committer’s verified signature.
wmouchere William Mouchère
Co-authored-by: Haroen Viaene <hello@haroen.me>
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 16, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit fd82083:

Sandbox Source
InstantSearch.js Configuration

@Haroenv Haroenv merged commit b37e23b into master Jul 16, 2021
@Haroenv Haroenv deleted the fix/build-should-fail-code-1 branch July 16, 2021 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants