Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Decide whether to build uberjar based on files changed (#80129)

Nemanja Glumacb7f4881ae82e
diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml
index 1f086c1285a..5dbcb88b9b9 100644
--- a/.github/workflows/run-tests.yml
+++ b/.github/workflows/run-tests.yml
@@ -39,18 +39,22 @@ jobs:
|| 'defer' }}
run: echo "verdict=$VERDICT" | tee -a "$GITHUB_OUTPUT"
- create-test-plan:
+ files-changed:
needs: should-run
- name: Create test plan
+ name: Detect changed files
if: ${{ needs.should-run.outputs.verdict == 'defer' }}
- runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}
+ runs-on: ${{ vars.SLIM_RUNNER_KEY }}
timeout-minutes: 5
outputs:
e2e_all: ${{ steps.changes.outputs.e2e_all }}
e2e_specs: ${{ steps.changes.outputs.e2e_specs }}
+ e2e_infra: ${{ steps.changes.outputs.e2e_infra }}
backend_all: ${{ steps.changes.outputs.backend_all }}
frontend_all: ${{ steps.changes.outputs.frontend_all }}
frontend_sources: ${{ steps.changes.outputs.frontend_sources }}
+ frontend_unit_infra: ${{ steps.changes.outputs.frontend_unit_infra }}
+ frontend_loki_infra: ${{ steps.changes.outputs.frontend_loki_infra }}
+ shared_sources: ${{ steps.changes.outputs.shared_sources }}
documentation: ${{ steps.changes.outputs.documentation }}
embedding_documentation: ${{ steps.changes.outputs.embedding_documentation }}
embedding_sdk_components: ${{ steps.changes.outputs.embedding_sdk_components }}
@@ -63,13 +67,11 @@ jobs:
&& steps.changes.outputs.frontend_all == 'false'
&& steps.changes.outputs.e2e_all == 'false' }}
+ all_changed_files: ${{ steps.changes.outputs.all_changed_files }}
e2e_all_files: ${{ steps.changes.outputs.e2e_all_files }}
e2e_specs_files: ${{ steps.changes.outputs.e2e_specs_files }}
-
- stats: ${{ steps.compute.outputs.stats }}
- fe_unit_specs_to_run: ${{ steps.compute.outputs.fe_unit_specs_to_run }}
- loki_stories_to_run: ${{ steps.compute.outputs.loki_stories_to_run }}
- e2e_specs_to_run: ${{ steps.compute.outputs.e2e_specs_to_run }}
+ frontend_sources_files: ${{ steps.changes.outputs.frontend_sources_files }}
+ backend_sources_files: ${{ steps.changes.outputs.backend_sources_files }}
steps:
- uses: actions/checkout@v6
- name: Test which files changed
@@ -80,18 +82,31 @@ jobs:
# comma separated list of files
list-files: csv
filters: .github/file-paths.yaml
+
+ create-test-plan:
+ needs: files-changed
+ name: Create test plan
+ if: ${{ github.event_name == 'pull_request' }}
+ runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}
+ timeout-minutes: 10
+ outputs:
+ stats: ${{ steps.compute.outputs.stats }}
+ fe_unit_specs_to_run: ${{ steps.compute.outputs.fe_unit_specs_to_run }}
+ loki_stories_to_run: ${{ steps.compute.outputs.loki_stories_to_run }}
+ e2e_specs_to_run: ${{ steps.compute.outputs.e2e_specs_to_run }}
+ steps:
+ - uses: actions/checkout@v6
- name: Create test plan
id: compute
- if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/create-test-plan
with:
- changed-files: ${{ steps.changes.outputs.all_changed_files }}
- fe-changed-files: ${{ steps.changes.outputs.frontend_sources_files }}
- be-changed-files: ${{ steps.changes.outputs.backend_sources_files }}
- unit-infra-touched: ${{ steps.changes.outputs.frontend_unit_infra }}
- loki-infra-touched: ${{ steps.changes.outputs.frontend_loki_infra }}
- e2e-infra-touched: ${{ steps.changes.outputs.e2e_infra }}
- shared-sources-touched: ${{ steps.changes.outputs.shared_sources }}
+ changed-files: ${{ needs.files-changed.outputs.all_changed_files }}
+ fe-changed-files: ${{ needs.files-changed.outputs.frontend_sources_files }}
+ be-changed-files: ${{ needs.files-changed.outputs.backend_sources_files }}
+ unit-infra-touched: ${{ needs.files-changed.outputs.frontend_unit_infra }}
+ loki-infra-touched: ${{ needs.files-changed.outputs.frontend_loki_infra }}
+ e2e-infra-touched: ${{ needs.files-changed.outputs.e2e_infra }}
+ shared-sources-touched: ${{ needs.files-changed.outputs.shared_sources }}
upload-affected-tests-stats:
needs: create-test-plan
@@ -119,11 +134,11 @@ jobs:
run: bun .github/scripts/upload-affected-tests-stats.ts
uberjar:
- needs: [should-run, create-test-plan]
+ needs: [should-run, files-changed]
if: |
!cancelled() && needs.should-run.outputs.verdict != 'force-skip' &&
(needs.should-run.outputs.verdict == 'force-run' ||
- needs.create-test-plan.outputs.no_source_code_changes != 'true')
+ needs.files-changed.outputs.no_source_code_changes != 'true')
uses: ./.github/workflows/uberjar.yml
secrets: inherit
@@ -131,12 +146,12 @@ jobs:
# The compile is doesn't depend on MB_EDITION
e2e-cljs:
name: Compile CLJS for e2e
- needs: [should-run, create-test-plan]
+ needs: [should-run, files-changed]
if: |
!cancelled() &&
(needs.should-run.outputs.verdict == 'force-run' ||
- (needs.create-test-plan.result == 'success' &&
- needs.create-test-plan.outputs.e2e_all == 'true'))
+ (needs.files-changed.result == 'success' &&
+ needs.files-changed.outputs.e2e_all == 'true'))
runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}
timeout-minutes: 15
steps:
@@ -187,14 +202,14 @@ jobs:
if: |
!cancelled() &&
(needs.should-run.outputs.verdict == 'force-run' ||
- needs.create-test-plan.result == 'success')
- needs: [should-run, create-test-plan, static-viz-files-changed]
+ needs.files-changed.result == 'success')
+ needs: [should-run, files-changed, static-viz-files-changed]
uses: ./.github/workflows/backend.yml
secrets: inherit
with:
skip: >-
${{ needs.should-run.outputs.verdict != 'force-run' &&
- needs.create-test-plan.outputs.backend_all != 'true' &&
+ needs.files-changed.outputs.backend_all != 'true' &&
needs.static-viz-files-changed.outputs.static_viz != 'true' }}
force-run: ${{ needs.should-run.outputs.verdict == 'force-run' }}
@@ -202,65 +217,65 @@ jobs:
if: |
!cancelled() &&
(needs.should-run.outputs.verdict == 'force-run' ||
- needs.create-test-plan.result == 'success')
- needs: [should-run, create-test-plan]
+ needs.files-changed.result == 'success')
+ needs: [should-run, files-changed]
uses: ./.github/workflows/semantic-search.yml
secrets: inherit
with:
skip: >-
${{ needs.should-run.outputs.verdict != 'force-run' &&
- needs.create-test-plan.outputs.backend_all != 'true' }}
+ needs.files-changed.outputs.backend_all != 'true' }}
app-db-tests:
if: |
!cancelled() &&
(needs.should-run.outputs.verdict == 'force-run' ||
- needs.create-test-plan.result == 'success')
- needs: [should-run, create-test-plan]
+ needs.files-changed.result == 'success')
+ needs: [should-run, files-changed]
uses: ./.github/workflows/app-db.yml
secrets: inherit
with:
skip: >-
${{ needs.should-run.outputs.verdict != 'force-run' &&
- needs.create-test-plan.outputs.backend_all != 'true' }}
+ needs.files-changed.outputs.backend_all != 'true' }}
force-run: ${{ needs.should-run.outputs.verdict == 'force-run' }}
driver-tests:
if: |
!cancelled() &&
(needs.should-run.outputs.verdict == 'force-run' ||
- needs.create-test-plan.result == 'success')
- needs: [should-run, create-test-plan]
+ needs.files-changed.result == 'success')
+ needs: [should-run, files-changed]
uses: ./.github/workflows/drivers.yml
secrets: inherit
with:
skip: >-
${{ needs.should-run.outputs.verdict != 'force-run' &&
- needs.create-test-plan.outputs.backend_all != 'true' }}
+ needs.files-changed.outputs.backend_all != 'true' }}
force-run: ${{ needs.should-run.outputs.verdict == 'force-run' }}
frontend-tests:
- needs: [should-run, create-test-plan]
+ needs: [should-run, files-changed]
if: |
!cancelled() &&
(needs.should-run.outputs.verdict == 'force-run' ||
- needs.create-test-plan.result == 'success')
+ needs.files-changed.result == 'success')
uses: ./.github/workflows/frontend.yml
secrets: inherit
with:
skip: >-
${{ needs.should-run.outputs.verdict != 'force-run' &&
- needs.create-test-plan.outputs.frontend_all != 'true' }}
+ needs.files-changed.outputs.frontend_all != 'true' }}
skip-lint: >-
${{ needs.should-run.outputs.verdict != 'force-run' &&
- needs.create-test-plan.outputs.frontend_all != 'true' &&
- needs.create-test-plan.outputs.e2e_all != 'true' }}
+ needs.files-changed.outputs.frontend_all != 'true' &&
+ needs.files-changed.outputs.e2e_all != 'true' }}
skip-custom-viz: >-
${{ needs.should-run.outputs.verdict != 'force-run' &&
- needs.create-test-plan.outputs.custom_viz_all != 'true' }}
+ needs.files-changed.outputs.custom_viz_all != 'true' }}
e2e-tests:
- needs: [should-run, create-test-plan, uberjar]
+ needs: [should-run, files-changed, uberjar]
# Skip e2e tests when the uberjar build failed or was cancelled — the
# downstream tests can't fetch a missing artifact, and we don't want to
# mask the uberjar failure with a wave of misleading e2e errors. We still
@@ -271,7 +286,7 @@ jobs:
# branch protection blocks the merge as pending.
if: |
always() && !cancelled() &&
- (needs.should-run.outputs.verdict == 'force-run' || needs.create-test-plan.result == 'success') &&
+ (needs.should-run.outputs.verdict == 'force-run' || needs.files-changed.result == 'success') &&
needs.uberjar.result != 'failure' &&
needs.uberjar.result != 'cancelled'
uses: ./.github/workflows/e2e-tests.yml
@@ -279,7 +294,7 @@ jobs:
with:
skip: >-
${{ needs.should-run.outputs.verdict != 'force-run' &&
- needs.create-test-plan.outputs.e2e_all != 'true' }}
+ needs.files-changed.outputs.e2e_all != 'true' }}
# here we pass the list of changed files
# e.g. e2e/test/scenarios/onboarding/command-palette.cy.spec.js,e2e/test/scenarios/question/document-title.cy.spec.js
# e2e_all_files includes all changes which trigger all e2e tests, if the list of changes files is included in the
@@ -291,54 +306,54 @@ jobs:
specs: >-
${{ needs.should-run.outputs.verdict != 'force-run' &&
github.event_name == 'pull_request' &&
- needs.create-test-plan.outputs.e2e_all_files == needs.create-test-plan.outputs.e2e_specs_files &&
- needs.create-test-plan.outputs.e2e_specs_files || '' }}
+ needs.files-changed.outputs.e2e_all_files == needs.files-changed.outputs.e2e_specs_files &&
+ needs.files-changed.outputs.e2e_specs_files || '' }}
embedding-sdk-package:
- needs: [should-run, create-test-plan]
+ needs: [should-run, files-changed]
if: |
!cancelled() &&
(needs.should-run.outputs.verdict == 'force-run' ||
- needs.create-test-plan.outputs.embedding_sdk_components == 'true' ||
- needs.create-test-plan.outputs.frontend_sources == 'true' ||
- needs.create-test-plan.outputs.embedding_documentation == 'true' ||
- needs.create-test-plan.outputs.embedding_sdk_ci == 'true' ||
- needs.create-test-plan.outputs.embedding_sdk_host_sample_apps == 'true')
+ needs.files-changed.outputs.embedding_sdk_components == 'true' ||
+ needs.files-changed.outputs.frontend_sources == 'true' ||
+ needs.files-changed.outputs.embedding_documentation == 'true' ||
+ needs.files-changed.outputs.embedding_sdk_ci == 'true' ||
+ needs.files-changed.outputs.embedding_sdk_host_sample_apps == 'true')
uses: ./.github/workflows/embedding-sdk-package-build.yml
secrets: inherit
sdk-tests:
- needs: [should-run, uberjar, embedding-sdk-package, create-test-plan]
+ needs: [should-run, uberjar, embedding-sdk-package, files-changed]
if: always() && !cancelled()
uses: ./.github/workflows/embedding-sdk.yml
secrets: inherit
with:
cli-snippets-type-check: >-
${{ needs.should-run.outputs.verdict == 'force-run' ||
- needs.create-test-plan.outputs.frontend_sources == 'true' }}
+ needs.files-changed.outputs.frontend_sources == 'true' }}
docs-snippets-type-check: >-
${{ needs.should-run.outputs.verdict == 'force-run' ||
- needs.create-test-plan.outputs.embedding_documentation == 'true' }}
+ needs.files-changed.outputs.embedding_documentation == 'true' }}
documentation-validation: >-
${{ needs.should-run.outputs.verdict == 'force-run' ||
- needs.create-test-plan.outputs.frontend_sources == 'true' }}
+ needs.files-changed.outputs.frontend_sources == 'true' }}
component-tests: >-
${{ needs.should-run.outputs.verdict == 'force-run' ||
- needs.create-test-plan.outputs.embedding_sdk_components == 'true' }}
+ needs.files-changed.outputs.embedding_sdk_components == 'true' }}
host-sample-apps-tests: >-
${{ needs.should-run.outputs.verdict == 'force-run' ||
- needs.create-test-plan.outputs.embedding_sdk_host_sample_apps == 'true' }}
+ needs.files-changed.outputs.embedding_sdk_host_sample_apps == 'true' }}
skip: >-
${{ needs.embedding-sdk-package.result != 'success' ||
needs.uberjar.result != 'success' }}
bundle-size:
- needs: [uberjar, create-test-plan]
+ needs: [uberjar, files-changed]
if: |
!cancelled() &&
github.event_name == 'pull_request' &&
needs.uberjar.result == 'success' &&
- needs.create-test-plan.outputs.frontend_sources == 'true'
+ needs.files-changed.outputs.frontend_sources == 'true'
uses: ./.github/workflows/bundle-size.yml
secrets: inherit