[Phase 8] Add E2E path filtering for Bitrise - #417
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
e6803ea to
fc3c69a
Compare
50ae2bd to
ac6cc38
Compare
fc3c69a to
5f078b7
Compare
ac6cc38 to
a2c10bc
Compare
5f078b7 to
5c70153
Compare
a2c10bc to
02227b8
Compare
858b9de to
ceb5011
Compare
92b0cf9 to
b7aa8b6
Compare
ceb5011 to
b08d7b3
Compare
b7aa8b6 to
c2fc448
Compare
b08d7b3 to
6959ac8
Compare
c2fc448 to
f060ca5
Compare
ce50495 to
c9f214c
Compare
6b12548 to
405986b
Compare
c9f214c to
3145aff
Compare
|
|
||
| tools: | ||
| ruby: 3.3.6 | ||
| ruby: installed |
There was a problem hiding this comment.
Switching this to only apply 3.3.6 to the react-native builds saves us ~3.5mins per CI run
There was a problem hiding this comment.
Is the ruby version important to us?
Feels like it could shift about a bit under the hood (if they update the stack to bump dependencies periodically)
There was a problem hiding this comment.
They don't change the default version on a stack - bumps are introduced when a new stack is released
I'll check whether I can delete this line - I opted for per workflow overrides to 3.3.6 to improve build time, and so I might be able to get rid of this line now
3145aff to
2b427c7
Compare
Package Size
Web file breakdown
React Native file breakdown
Android file breakdown
Measured from the PR base SHA and PR head SHA. The file breakdown shows uncompressed sizes within each package artifact, so individual files do not sum to the compressed artifact total. This comment reports package artifact sizes only; it is not a final app binary-size report. |
2b427c7 to
4943887
Compare
|
|
||
| tools: | ||
| ruby: 3.3.6 | ||
| ruby: installed |
There was a problem hiding this comment.
Is the ruby version important to us?
Feels like it could shift about a bit under the hood (if they update the stack to bump dependencies periodically)
|
|
||
| e2e-build-react-native-ios: | ||
| tools: | ||
| ruby: 3.3.6 |
There was a problem hiding this comment.
does this need to match the installed version above?
and the one below
There was a problem hiding this comment.
Ruby is in a weird state in the repo right now, I have a ticket to fix it, but basically we have multiple .ruby-version files, react-native pins to 3.3.6 whilst rest of the repo uses 3.4.4
Theres an unfortunate side effect when we use a version that isn't preinstalled on bitrise that it recompiles from source via asdf adding ~3mins per workflow that relies on ruby
These are per job overrides for these two workflows - will be removed once we unify ruby usage
| require "net/http" | ||
| require "uri" | ||
|
|
||
| class PullRequestChangedFiles |
There was a problem hiding this comment.
Could we reuse the JsonHttpClient we added
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 |
There was a problem hiding this comment.
I think everywhere else we hardcode v1.316.0
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 | ||
| with: | ||
| ruby-version: .ruby-version |
There was a problem hiding this comment.
Think this resolves to 3.4.4
Apparently we already have 3.3.6 for RN swift, plus installed for bitrise
Do we want to align these all to use .ruby-version and standardize on 1 version (maybe as well as installed)?
There was a problem hiding this comment.
I have a ticket here to align ruby across the project https://github.com/shop/issues-checkout-kit/issues/1136 given the ruby scripts it wasn't just a case of bump the version so I decided I'd get the e2e pipe setup for all platforms, then I have that to verify correctness on any changes
| class PullRequestChangedFiles | ||
| PER_PAGE = 100 | ||
| RETRYABLE_STATUS_CODES = [429, 500, 502, 503, 504].freeze | ||
| RETRYABLE_EXCEPTIONS = [ |
There was a problem hiding this comment.
Worth adding in a few more?
| RETRYABLE_EXCEPTIONS = [ | |
| RETRYABLE_EXCEPTIONS = [ | |
| Net::OpenTimeout, | |
| Net::ReadTimeout, | |
| Errno::ECONNRESET, | |
| Errno::ECONNREFUSED, | |
| Errno::EHOSTUNREACH, | |
| Errno::ETIMEDOUT, | |
| SocketError, | |
| OpenSSL::SSL::SSLError, | |
| Timeout::Error, | |
| EOFError, | |
| IOError | |
| ].freeze |
| def default_transport(uri, headers) | ||
| request = Net::HTTP::Get.new(uri) | ||
| headers.each { |key, value| request[key] = value } | ||
| Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) } |
There was a problem hiding this comment.
should we have a request timeout (open/read)
4943887 to
5c3ec74
Compare
Merge activity
|
Assisted-By: devx/96a590ff-685a-49ce-8199-0810f0ac2379
5c3ec74 to
e3737a0
Compare

Why?
GitHub and Bitrise both need changed-file detection, so we can avoid wasting CI time building ios/android and running e2e suites.
dorny/paths-filter.To give a similar experience to what we have in github actions, running only the checks relevant for that slice, I've setup a two prong approach:
Bitrise regex to give a coarse grain skip, which entirely skips the bitrise check, this will avoid things like root readme triggering anything (no runtime checking, it will just be omitted, need to confirm whether this will work once we turn this into a required check)
If the flow passes beyond the regex (this includes readme changes if they're nested within a platform directory), each workflow has its own changed files filter script to determine whether it has any matches, it uses an deny-allow-deny approach
File matching:
a. files are **implicitly ** excluded by default
b. explicitly included files will cause the workflow to run
c. unless there is explicit deny, in which case its excluded
This means the first step in the e2e pipeline will run (~15 seconds to run) and determines if any builds/e2e tests need to run, you can see here it quickly skips and marks a green bitrise check
What?
.github/filters/platform-non-docs.ymlmoved to.ci/changed-file-filters.ymlfor re-use across bitrise and .githubscripts/changed_file_filters/scripts/lib/changed_file_filters.rbhelpers for reusable changed-file filter evaluation outside GitHub Actions where we cannot usedorny/paths-filter..ci/changed-file-filters.yml.changed_files.regextrigger and uses generatedE2E_BUILD_*variables to skip unrelated Bitrise workflows.How to test
I did some testing with some debug branches here:
This proved that ios/android kicks off if we change something in platforms/react-native like a typescript file
This proves that files like .md are skipped in platforms/react-native
changes outside of the bitrise regex dont trigger any kind of pipeline at all (a root Readme change didn't even trigger the first stage of the bitrise pipeline)