Skip to content

[Phase 8] Add E2E path filtering for Bitrise - #417

Merged
kieran-osgood-shopify merged 1 commit into
mainfrom
kieran-osgood/e2e-browserstack/phase-8-path-filters
Jul 15, 2026
Merged

[Phase 8] Add E2E path filtering for Bitrise#417
kieran-osgood-shopify merged 1 commit into
mainfrom
kieran-osgood/e2e-browserstack/phase-8-path-filters

Conversation

@kieran-osgood-shopify

@kieran-osgood-shopify kieran-osgood-shopify commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Why?

GitHub and Bitrise both need changed-file detection, so we can avoid wasting CI time building ios/android and running e2e suites.

  • Github uses dorny/paths-filter.
  • Bitrise has built in support for a regex, it's fairly limited in its specificity and mostly helps guard by slices rather than fine grained filters

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:

  1. 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)

  2. 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

image.png

What?

  • .github/filters/platform-non-docs.yml moved to .ci/changed-file-filters.yml for re-use across bitrise and .github
  • Adds focused scripts/changed_file_filters / scripts/lib/changed_file_filters.rb helpers for reusable changed-file filter evaluation outside GitHub Actions where we cannot use dorny/paths-filter.
  • Updates the Bitrise E2E run-plan producer to use shared filter groups from .ci/changed-file-filters.yml.
  • Adds a coarse Bitrise changed_files.regex trigger and uses generated E2E_BUILD_* variables to skip unrelated Bitrise workflows.

How to test

I did some testing with some debug branches here:

shadowenv exec -- ruby e2e/scripts/e2e_matrix_to_browserstack_run_plan validate
shadowenv exec -- ruby e2e/scripts/e2e_matrix_to_browserstack_run_plan expand --changed-file platforms/swift/Sources/Foo.swift
shadowenv exec -- ruby e2e/scripts/e2e_matrix_to_browserstack_run_plan expand --changed-file protocol/languages/typescript/src/generated/Models.ts
shadowenv exec -- scripts/changed_file_filters list --changed-file platforms/react-native/modules/@shopify/checkout-kit-react-native/src/index.ts
shadowenv exec -- ruby -e 'require "yaml"; %w[.github/workflows/ci.yml .github/workflows/package-size.yml .ci/changed-file-filters.yml e2e/config/matrix.yml e2e/bitrise.yml].each { |path| YAML.safe_load_file(path, aliases: true) }; puts "yaml ok"'
shadowenv exec -- bitrise validate --config=e2e/bitrise.yml
shadowenv exec -- /opt/dev/bin/dev check e2e-bitrise-validate

@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Jul 7, 2026
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-8-path-filters branch from e6803ea to fc3c69a Compare July 7, 2026 16:51
Comment thread e2e/BITRISE.md Outdated
Comment thread e2e/BITRISE.md Outdated
Comment thread e2e/BITRISE.md Outdated
@kieran-osgood-shopify
kieran-osgood-shopify changed the base branch from kieran-osgood/e2e-browserstack/phase-7-soft-launch to graphite-base/417 July 8, 2026 10:11
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-8-path-filters branch from fc3c69a to 5f078b7 Compare July 8, 2026 11:41
@kieran-osgood-shopify
kieran-osgood-shopify changed the base branch from graphite-base/417 to kieran-osgood/e2e-browserstack/phase-7-soft-launch July 8, 2026 11:42
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-7-soft-launch branch from ac6cc38 to a2c10bc Compare July 8, 2026 15:01
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-8-path-filters branch from 5f078b7 to 5c70153 Compare July 8, 2026 15:01
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-7-soft-launch branch from a2c10bc to 02227b8 Compare July 8, 2026 15:08
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-8-path-filters branch 2 times, most recently from 858b9de to ceb5011 Compare July 8, 2026 16:18
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-7-soft-launch branch 2 times, most recently from 92b0cf9 to b7aa8b6 Compare July 8, 2026 17:02
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-8-path-filters branch from ceb5011 to b08d7b3 Compare July 8, 2026 17:03
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-7-soft-launch branch from b7aa8b6 to c2fc448 Compare July 9, 2026 08:11
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-8-path-filters branch from b08d7b3 to 6959ac8 Compare July 9, 2026 08:12
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-7-soft-launch branch from c2fc448 to f060ca5 Compare July 9, 2026 09:34
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-8-path-filters branch from ce50495 to c9f214c Compare July 14, 2026 16:07
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-7-soft-launch branch from 6b12548 to 405986b Compare July 14, 2026 16:33
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-8-path-filters branch from c9f214c to 3145aff Compare July 14, 2026 16:33
Comment thread e2e/bitrise.yml Outdated

tools:
ruby: 3.3.6
ruby: installed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Switching this to only apply 3.3.6 to the react-native builds saves us ~3.5mins per CI run

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-8-path-filters branch from 3145aff to 2b427c7 Compare July 14, 2026 17:08
@kieran-osgood-shopify
kieran-osgood-shopify marked this pull request as ready for review July 14, 2026 17:36
@kieran-osgood-shopify
kieran-osgood-shopify requested a review from a team as a code owner July 14, 2026 17:36
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 92%
91.85% (327/356) 87.98% (183/208) 100% (86/86)

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

Web — Coverage Report

Lines Statements Branches Functions
Coverage: 99%
98.8% (248/251) 85.49% (112/131) 98.57% (69/70)

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

Package Size

Platform Artifact Base Head Delta
Web npm tarball 65.5 KiB 65.5 KiB 0 B
React Native npm tarball 103.1 KiB 103.1 KiB 0 B
Android release AAR 226.7 KiB 226.7 KiB 0 B
Web file breakdown
File Base Head Delta
dist/index.js.map 184.1 KiB 184.1 KiB 0 B
dist/index.d.ts 41.9 KiB 41.9 KiB 0 B
dist/custom-elements.json 40.1 KiB 40.1 KiB 0 B
dist/index.js 29.6 KiB 29.6 KiB 0 B
README.md 17.8 KiB 17.8 KiB 0 B
package.json 2.8 KiB 2.8 KiB 0 B
LICENSE 1.1 KiB 1.1 KiB 0 B
React Native file breakdown
File Base Head Delta
node_modules/@shopify/checkout-kit-protocol/src/generated/Models.ts 85.4 KiB 85.4 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/Models.d.ts 53.0 KiB 53.0 KiB 0 B
ios/ShopifyCheckoutKit.swift 15.0 KiB 15.0 KiB 0 B
ios/AcceleratedCheckoutButtons.swift 14.0 KiB 14.0 KiB 0 B
lib/commonjs/index.js 13.1 KiB 13.1 KiB 0 B
src/components/AcceleratedCheckoutButtons.tsx 12.9 KiB 12.9 KiB 0 B
src/index.ts 12.5 KiB 12.5 KiB 0 B
lib/commonjs/components/AcceleratedCheckoutButtons.js 11.4 KiB 11.4 KiB 0 B
android/src/main/java/com/shopify/reactnative/checkoutkit/ShopifyCheckoutKitModule.java 11.1 KiB 11.1 KiB 0 B
lib/module/index.js 10.4 KiB 10.4 KiB 0 B
lib/commonjs/components/AcceleratedCheckoutButtons.js.map 10.3 KiB 10.3 KiB 0 B
lib/module/components/AcceleratedCheckoutButtons.js 10.2 KiB 10.2 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolNotifications.ts 9.5 KiB 9.5 KiB 0 B
lib/module/components/AcceleratedCheckoutButtons.js.map 9.1 KiB 9.1 KiB 0 B
src/index.d.ts 8.9 KiB 8.9 KiB 0 B
lib/module/index.js.map 8.2 KiB 8.2 KiB 0 B
src/present-dispatcher.ts 8.0 KiB 8.0 KiB 0 B
lib/commonjs/index.js.map 7.7 KiB 7.7 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolNotifications.d.ts 7.6 KiB 7.6 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolRenameMap.ts 7.2 KiB 7.2 KiB 0 B
…and 110 smaller files
Android file breakdown
File Base Head Delta
classes.jar 239.9 KiB 239.9 KiB 0 B
res/layout/checkout_sheet_content.xml 4.0 KiB 4.0 KiB 0 B
res/values/values.xml 1.2 KiB 1.2 KiB 0 B
R.txt 1.0 KiB 1.0 KiB 0 B
proguard.txt 798 B 798 B 0 B
AndroidManifest.xml 578 B 578 B 0 B
res/drawable/close.xml 431 B 431 B 0 B
res/menu/checkout_menu.xml 354 B 354 B 0 B
META-INF/com/android/build/gradle/aar-metadata.properties 157 B 157 B 0 B

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.

@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-8-path-filters branch from 2b427c7 to 4943887 Compare July 14, 2026 17:46
Comment thread e2e/bitrise.yml Outdated

tools:
ruby: 3.3.6
ruby: installed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)

Comment thread e2e/bitrise.yml

e2e-build-react-native-ios:
tools:
ruby: 3.3.6

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

does this need to match the installed version above?

and the one below

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we reuse the JsonHttpClient we added

Comment thread .github/workflows/ci.yml Outdated
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think everywhere else we hardcode v1.316.0

Comment thread .github/workflows/ci.yml
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0
with:
ruby-version: .ruby-version

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Comment thread e2e/lib/pull_request_changed_files.rb Outdated
class PullRequestChangedFiles
PER_PAGE = 100
RETRYABLE_STATUS_CODES = [429, 500, 502, 503, 504].freeze
RETRYABLE_EXCEPTIONS = [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Worth adding in a few more?

Suggested change
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

Comment thread e2e/lib/pull_request_changed_files.rb Outdated
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) }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we have a request timeout (open/read)

@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-8-path-filters branch from 4943887 to 5c3ec74 Compare July 15, 2026 10:21

kieran-osgood-shopify commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Jul 15, 10:38 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 15, 10:40 AM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 15, 10:58 AM UTC: @kieran-osgood-shopify merged this pull request with Graphite.

@kieran-osgood-shopify
kieran-osgood-shopify changed the base branch from kieran-osgood/e2e-browserstack/phase-7-soft-launch to graphite-base/417 July 15, 2026 10:38
@kieran-osgood-shopify
kieran-osgood-shopify changed the base branch from graphite-base/417 to main July 15, 2026 10:38
Assisted-By: devx/96a590ff-685a-49ce-8199-0810f0ac2379
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-8-path-filters branch from 5c3ec74 to e3737a0 Compare July 15, 2026 10:39
@kieran-osgood-shopify
kieran-osgood-shopify merged commit ec2ccd0 into main Jul 15, 2026
37 checks passed
@kieran-osgood-shopify
kieran-osgood-shopify deleted the kieran-osgood/e2e-browserstack/phase-8-path-filters branch July 15, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants