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

Add set -o pipefail to script that builds iOS E2E version #54235

Merged
merged 1 commit into from Sep 7, 2023

Conversation

mokagio
Copy link
Contributor

@mokagio mokagio commented Sep 7, 2023

What?

Addresses a dumb oversight on my end in #54079. I piped output without accounting for the script returning with the pipe status code instead of that of the piped command.

Why?

Without it, we'd get false positives in the mobile CI pipeline.

How?

set -o pipefail 🤦‍♂️

Testing Instructions

Notice how a CI build with this change fails:

Screenshot 2023-09-07 at 1 24 19 pm

While one without it passes:

Screenshot 2023-09-07 at 1 25 31 pm

Testing Instructions for Keyboard

N.A.

Screenshots or screencast

N.A.

@mokagio mokagio added Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Type] Build Tooling Issues or PRs related to build tooling labels Sep 7, 2023
@mokagio mokagio enabled auto-merge (squash) September 7, 2023 03:27
@@ -1,5 +1,7 @@
#!/bin/bash -eu

set -o pipefail
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I considered adding this in the code path where the output is piped, but it seemed better to set it as an option for the whole script instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, I didn't make it part of the shebang because of the following ShellCheck warning: On most OS, shebangs can only specify a single parameter. [SC2096]

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Flaky tests detected in 2a8bb4f.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6105053119
📝 Reported issues:

@mokagio mokagio merged commit c791a7d into trunk Sep 7, 2023
55 of 56 checks passed
Copy link
Member

@derekblank derekblank left a comment

Choose a reason for hiding this comment

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

I observed the differences between the true failing build and the false positive build (and learned about the pipebuild option in the process). LGTM. 🚀

@mokagio mokagio deleted the mokagio/add-pipefail-to-build-script branch September 7, 2023 05:05
@github-actions github-actions bot added this to the Gutenberg 16.7 milestone Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Type] Build Tooling Issues or PRs related to build tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants