Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .ci/changed-file-filters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Shared changed-file filters for workflows and pipelines that should ignore docs-only changes.
# Negative patterns need `predicate-quantifier: every` in dorny/paths-filter workflow steps.
android:
- 'platforms/android/**'
- &exclude-markdown '!**/*.md'
- &exclude-docs-directory '!**/docs/**'
swift:
- 'platforms/swift/**'
- *exclude-markdown
- *exclude-docs-directory
reactNative:
- 'platforms/react-native/**'
- *exclude-markdown
- *exclude-docs-directory
web:
- 'platforms/web/**'
- *exclude-markdown
- *exclude-docs-directory
protocol:
- 'protocol/**'
- *exclude-markdown
- *exclude-docs-directory
protocolTypescript:
- 'protocol/languages/typescript/**'
- *exclude-markdown
- *exclude-docs-directory
protocolSwift:
- 'protocol/languages/swift/**'
- *exclude-markdown
- *exclude-docs-directory
protocolKotlin:
- 'protocol/languages/kotlin/**'
- *exclude-markdown
- *exclude-docs-directory
packageSwift:
- 'Package.swift'
- 'Package.resolved'
e2e:
- 'e2e/**'
- *exclude-markdown
- *exclude-docs-directory
ciFilters:
- '.ci/changed-file-filters.yml'
27 changes: 0 additions & 27 deletions .github/filters/platform-non-docs.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
id: platform
with:
predicate-quantifier: every
filters: .github/filters/platform-non-docs.yml
filters: .ci/changed-file-filters.yml

- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: infra
Expand All @@ -55,7 +55,7 @@ jobs:
- '.github/workflows/breaking-changes.yml'
- '.github/workflows/release.yml'
- '.github/scripts/validate-release-version'
- '.github/filters/**'
- '.ci/changed-file-filters.yml'
- '.github/workflows/ci.yml'
swift:
- 'Package.swift'
Expand All @@ -65,7 +65,7 @@ jobs:
- '.github/workflows/swift-test-workflow.yml'
- '.github/workflows/swift-lint.yml'
- '.github/workflows/breaking-changes.yml'
- '.github/filters/**'
- '.ci/changed-file-filters.yml'
- '.github/workflows/ci.yml'
# Common React Native infra: JS-level jobs (jest, lint, packed
# files) and shared config that should trigger all RN jobs.
Expand All @@ -78,7 +78,7 @@ jobs:
- '.github/scripts/package-json-version'
- '.github/scripts/validate-release-version'
- '.github/actions/setup/**'
- '.github/filters/**'
- '.ci/changed-file-filters.yml'
- '.github/workflows/breaking-changes.yml'
- '.github/workflows/ci.yml'
# iOS-only RN infra: gates the macOS build/test jobs.
Expand All @@ -94,7 +94,7 @@ jobs:
web:
- '.github/workflows/web.yml'
- '.github/actions/setup/**'
- '.github/filters/**'
- '.ci/changed-file-filters.yml'
- '.github/workflows/ci.yml'
protocol:
- '.github/workflows/protocol-test.yml'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/package-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@ jobs:
id: package
with:
predicate-quantifier: every
filters: .github/filters/platform-non-docs.yml
filters: .ci/changed-file-filters.yml

- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: infra
with:
filters: |
android:
- '.github/scripts/measure-package-size'
- '.github/filters/**'
- '.ci/changed-file-filters.yml'
- '.github/workflows/package-size.yml'
reactNative:
- '.github/actions/setup/**'
- '.github/scripts/measure-package-size'
- '.github/filters/**'
- '.ci/changed-file-filters.yml'
- '.github/workflows/package-size.yml'
web:
- '.github/actions/setup/**'
- '.github/scripts/measure-package-size'
- '.github/filters/**'
- '.ci/changed-file-filters.yml'
- '.github/workflows/package-size.yml'

measure:
Expand Down
8 changes: 7 additions & 1 deletion e2e/BITRISE.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ bitrise validate -c e2e/bitrise.yml

## PR trigger

`e2e/bitrise.yml` maps pull requests to the `e2e` pipeline with `trigger_map`. The GitHub checks are kept non-required while `E2E_STRICT=false`.
`e2e/bitrise.yml` maps pull requests to the `e2e` pipeline with `trigger_map`. The trigger uses Bitrise `changed_files.regex` as a coarse source-tree gate for Checkout Kit platform, protocol, shared filter, package, and E2E paths. Bitrise does not support the same named include/exclude filter objects as GitHub Actions, so app-level filtering is enforced by `e2e/config/matrix.yml` and `e2e/scripts/e2e_matrix_to_browserstack_run_plan` after the pipeline starts.

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.

Suggested change
`e2e/bitrise.yml` maps pull requests to the `e2e` pipeline with `trigger_map`. The trigger uses Bitrise `changed_files.regex` as a coarse source-tree gate for Checkout Kit platform, protocol, shared filter, package, and E2E paths. Bitrise does not support the same named include/exclude filter objects as GitHub Actions, so app-level filtering is enforced by `e2e/config/matrix.yml` and `e2e/scripts/e2e_matrix_to_browserstack_run_plan` after the pipeline starts.
`e2e/bitrise.yml` maps pull requests to the `e2e` pipeline with `trigger_map`. The trigger uses Bitrise `changed_files.regex` as a coarse source-tree gate for Checkout Kit platform, protocol, shared filter, package, and E2E paths. Bitrise does not support the same named include/exclude filter objects as GitHub Actions, so `platforms` level filtering is enforced by `e2e/config/matrix.yml` and `e2e/scripts/e2e_matrix_to_browserstack_run_plan` after the pipeline starts (essentially fulfilling the same need that `dorny/paths-filter` holds in github.


Shared changed-file filter groups live in `.ci/changed-file-filters.yml` and are consumed by both GitHub Actions and Bitrise E2E. Each application in `e2e/config/matrix.yml` declares `changed_files_filters` by shared group name. The run-plan producer fetches the PR file list from GitHub, applies those groups, emits only matching application rows into the BrowserStack run plan, and shares `E2E_BUILD_*` variables that gate downstream Bitrise build workflows with `run_if`.

Markdown and `docs/` changes are excluded by the app-level filters. A docs-only change under a coarse Bitrise trigger path can still start the lightweight run-plan workflow, but it will produce an empty run plan and skip app build, BrowserStack execution, and reporting workflows.

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.

Suggested change
Markdown and `docs/` changes are excluded by the app-level filters. A docs-only change under a coarse Bitrise trigger path can still start the lightweight run-plan workflow, but it will produce an empty run plan and skip app build, BrowserStack execution, and reporting workflows.
Markdown and `docs/` changes are excluded by the `platforms` level filters at runtime during the `e2e-produce-browserstack-run-plan` workflow. A docs-only change under a coarse Bitrise trigger path can still start the lightweight ` e2e-produce-browserstack-run-plan` workflow (~15 seconds runtime), but it will produce an empty run plan and skip app build, BrowserStack execution, and reporting workflows.


The GitHub checks are kept non-required while `E2E_STRICT=false`.

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.

Suggested change
The GitHub checks are kept non-required while `E2E_STRICT=false`.
The GitHub checks are kept non-blocking while `E2E_STRICT=false`.


## Duplicate PR build cancellation

Expand Down
42 changes: 33 additions & 9 deletions e2e/bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,35 @@ tools:
trigger_map:
- pull_request_source_branch: "*"
draft_pull_request_enabled: false
changed_files:
regex: '^(platforms/(swift|android|react-native)|protocol|e2e|\.ci)/.*|^Package\.(swift|resolved)$'

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

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.

Debating whether we remove this and only rely on the run-plan platforms level filtering at runtime
It likely only saves us seconds in machine startup before the run_if determines the workflow shouldn't run

pipeline: e2e

pipelines:
e2e:
workflows:
e2e-produce-browserstack-run-plan: {}
e2e-build-react-native-ios:
run_if:
expression: env "E2E_BUILD_REACT_NATIVE_IOS" | eq "true"
depends_on:
- e2e-produce-browserstack-run-plan
e2e-build-react-native-android:
run_if:
expression: env "E2E_BUILD_REACT_NATIVE_ANDROID" | eq "true"
depends_on:
- e2e-produce-browserstack-run-plan
e2e-execute-browserstack-run:
run_if:
expression: env "E2E_HAS_E2E_RUNS" | eq "true"
depends_on:
- e2e-produce-browserstack-run-plan
- e2e-build-react-native-ios
- e2e-build-react-native-android
parallel: $E2E_BROWSERSTACK_RUN_PLAN_COUNT
parallel: $E2E_BROWSERSTACK_RUN_PLAN_PARALLEL_COUNT
e2e-report:
run_if:
expression: env "E2E_HAS_E2E_RUNS" | eq "true"
depends_on:
- e2e-execute-browserstack-run
should_always_run: workflow
Expand Down Expand Up @@ -111,19 +121,33 @@ workflows:
- content: |-
set -euo pipefail
source e2e/scripts/bitrise_ci_helpers
ruby e2e/scripts/e2e_matrix_to_browserstack_run_plan validate
changed_files="$(e2e_deploy_dir)/changed-files.txt"
e2e_log "Fetching pull request changed files"
if [ -n "${BITRISE_PULL_REQUEST:-}" ]; then
ruby e2e/scripts/github_pr_changed_files > "$changed_files"
else
git diff --name-only "${BITRISE_GIT_BRANCH_DEST:-origin/main}...HEAD" > "$changed_files"
fi
ruby e2e/scripts/e2e_matrix_to_browserstack_run_plan validate --changed-files-file "$changed_files"
e2e_log "Producing BrowserStack run plan"
ruby e2e/scripts/e2e_matrix_to_browserstack_run_plan expand > "$BITRISE_DEPLOY_DIR/browserstack-run-plan.json"
e2e_log "Publishing BrowserStack run plan count"
envman add --key E2E_BROWSERSTACK_RUN_PLAN_COUNT --value "$(ruby e2e/scripts/e2e_matrix_to_browserstack_run_plan count)"
ruby e2e/scripts/e2e_matrix_to_browserstack_run_plan expand --changed-files-file "$changed_files" > "$BITRISE_DEPLOY_DIR/browserstack-run-plan.json"
e2e_log "Publishing BrowserStack run plan environment"
while IFS='=' read -r key value; do
envman add --key "$key" --value "$value"
done < <(ruby e2e/scripts/e2e_matrix_to_browserstack_run_plan bitrise-env --changed-files-file "$changed_files")
e2e_log "Zipping E2E tests"
tests_zip="$(e2e_deploy_dir)/e2e-tests.zip"
e2e/scripts/zip_e2e_tests --output "$tests_zip"
e2e_log "Publishing E2E tests zip path"
envman add --key E2E_TESTS_ZIP --value "$tests_zip"
- share-pipeline-variable@1:
inputs:
- variables: E2E_BROWSERSTACK_RUN_PLAN_COUNT
- variables: |-
E2E_BROWSERSTACK_RUN_PLAN_COUNT
E2E_BROWSERSTACK_RUN_PLAN_PARALLEL_COUNT
E2E_HAS_E2E_RUNS
E2E_BUILD_REACT_NATIVE_IOS
E2E_BUILD_REACT_NATIVE_ANDROID
- deploy-to-bitrise-io@2:
is_always_run: false
inputs:
Expand Down Expand Up @@ -196,7 +220,7 @@ workflows:
- git-clone@8: {}
- pull-intermediate-files@1:
inputs:
- artifact_sources: e2e-produce-browserstack-run-plan,e2e-build-react-native-.*
- artifact_sources: e2e-produce-browserstack-run-plan,e2e-build-.*
- script@1:
title: Execute BrowserStack run
timeout: 2700
Expand All @@ -215,8 +239,8 @@ workflows:
: "${BROWSERSTACK_ACCESS_KEY:?BROWSERSTACK_ACCESS_KEY is required}"
: "${E2E_TESTS_ZIP:?E2E_TESTS_ZIP is required. Check e2e-execute-browserstack-run pull-intermediate-files artifact_sources.}"
: "${E2E_BROWSERSTACK_RUN_PLAN_JSON:?E2E_BROWSERSTACK_RUN_PLAN_JSON is required. Check e2e-execute-browserstack-run pull-intermediate-files artifact_sources.}"
: "${E2E_REACT_NATIVE_IOS_APP_PATH:?E2E_REACT_NATIVE_IOS_APP_PATH is required. Check e2e-execute-browserstack-run pull-intermediate-files artifact_sources.}"
: "${E2E_REACT_NATIVE_ANDROID_APP_PATH:?E2E_REACT_NATIVE_ANDROID_APP_PATH is required. Check e2e-execute-browserstack-run pull-intermediate-files artifact_sources.}"
run_artifact_env="$(ruby -rjson -e 'run_plan = JSON.parse(File.read(ARGV.fetch(0))); puts run_plan.fetch(Integer(ARGV.fetch(1))).fetch("artifact_env")' "$E2E_BROWSERSTACK_RUN_PLAN_JSON" "$run_index")"
: "${!run_artifact_env:?${run_artifact_env} is required. Check e2e-execute-browserstack-run pull-intermediate-files artifact_sources.}"
e2e_log "Executing BrowserStack run plan row ${run_index}"
E2E_STRICT="${E2E_STRICT:-false}" e2e/scripts/execute_browserstack_run \
--index "$run_index" \
Expand Down
11 changes: 11 additions & 0 deletions e2e/config/matrix.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
version: 1
changed_file_filters: .ci/changed-file-filters.yml
applications:
- id: react-native-ios
target: react-native
platform: ios
app_id: com.shopify.checkoutkit.reactnativedemo
artifact_env: E2E_REACT_NATIVE_IOS_APP_PATH
ready_marker: checkout-kit-sample-ready
changed_files_filters:
- reactNative
- protocolTypescript
- e2e
- ciFilters
- id: react-native-android
target: react-native
platform: android
app_id: com.shopify.checkoutkit.reactnativedemo
artifact_env: E2E_REACT_NATIVE_ANDROID_APP_PATH
ready_marker: checkout-kit-sample-ready
changed_files_filters:
- reactNative
- protocolTypescript
- e2e
- ciFilters
os_version_tags:
- latest
suites:
Expand Down
Loading
Loading