Skip to content

Commit 1e959cc

Browse files
committed
fix: move Fusion DuckDB tests off pull_request_target to safe trigger
The run-duckdb-tests job in fusion.yml used pull_request_target (base repo context + secrets) while checking out and executing fork PR code without an environment approval gate — a classic pwn-request vector. Move the Fusion + DuckDB job into local_only.yml which uses the safe pull_request trigger. Remove the now-unnecessary run-duckdb-tests job from fusion.yml and drop the needs: dependency from fusion-tests (the Snowflake cloud job is already gated by the cloud-tests environment).
1 parent d6ea261 commit 1e959cc

3 files changed

Lines changed: 30 additions & 38 deletions

File tree

.github/workflows/fusion.yml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
# **when?**
99
# On every PR, and every push to main and when manually triggered
1010

11-
# **note**
12-
# DuckDB runs first as a quick check that does not require cloud credentials.
13-
# Cloud adapter tests use the reusable workflow from dbt-labs/dbt-package-testing.
1411

1512
name: Fusion Integration Tests
1613

@@ -28,40 +25,7 @@ env:
2825
PYTHON_VERSION: "3.11"
2926

3027
jobs:
31-
run-duckdb-tests:
32-
runs-on: ubuntu-latest
33-
34-
steps:
35-
- name: "Checkout PR code"
36-
uses: actions/checkout@v4
37-
with:
38-
ref: ${{ github.event.pull_request.head.sha || github.ref }}
39-
40-
- name: "Set up Python ${{ env.PYTHON_VERSION }}"
41-
uses: actions/setup-python@v5
42-
with:
43-
python-version: ${{ env.PYTHON_VERSION }}
44-
45-
- name: "Install dbt Fusion"
46-
run: |
47-
curl -fsSL https://public.cdn.getdbt.com/fs/install/install.sh | sh
48-
echo "$HOME/.local/bin" >> $GITHUB_PATH
49-
50-
- name: "Verify Fusion installation"
51-
run: |
52-
dbt --version
53-
54-
- name: "Install tox"
55-
run: |
56-
python -m pip install --upgrade pip
57-
pip install tox
58-
59-
- name: "Run Fusion integration tests on duckdb"
60-
run: |
61-
tox -e dbt_integration_fusion_duckdb
62-
6328
fusion-tests:
64-
needs: run-duckdb-tests
6529
uses: dbt-labs/dbt-package-testing/.github/workflows/run_tox_fusion.yml@5d4d8561b9fd193dc0ef2c5a302ad0acc8f68b64
6630
with:
6731
# Only Snowflake for now - add more adapters here as Fusion support expands

.github/workflows/local_only.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# **what?**
2-
# Run tests for packages not supported for cloud testing
2+
# Run tests for packages not supported for cloud testing, including dbt Fusion + DuckDB
33
#
44
# **why?**
55
# To ensure that packages works as expected with all supported adapters
@@ -81,3 +81,31 @@ jobs:
8181
POSTGRES_DATABASE: ${{ env.POSTGRES_DATABASE }}
8282
POSTGRES_SCHEMA: "integration_tests_postgres_${{ github.run_number }}"
8383
# duckdb - needs no vars
84+
85+
run-fusion-duckdb-tests:
86+
runs-on: ubuntu-latest
87+
88+
steps:
89+
- name: "Checkout ${{ github.event.repository }}"
90+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # actions/checkout@v4
91+
92+
- name: "Set up Python ${{ env.PYTHON_VERSION }}"
93+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # actions/setup-python@v5
94+
with:
95+
python-version: ${{ env.PYTHON_VERSION }}
96+
97+
- name: "Install dbt Fusion"
98+
run: |
99+
curl -fsSL https://public.cdn.getdbt.com/fs/install/install.sh | sh
100+
echo "$HOME/.local/bin" >> $GITHUB_PATH
101+
102+
- name: "Verify Fusion installation"
103+
run: dbt --version
104+
105+
- name: "Install tox"
106+
run: |
107+
python -m pip install --upgrade pip
108+
pip install tox
109+
110+
- name: "Run Fusion integration tests on duckdb"
111+
run: tox -e dbt_integration_fusion_duckdb

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ commands =
8888
bash ./run_tox_tests.sh databricks
8989

9090
# Fusion integration tests - uses --static-analysis=off flag
91-
# See .github/workflows/fusion.yml for the workflow that installs Fusion
91+
# See .github/workflows/local_only.yml for the workflow that installs Fusion for DuckDB
9292
[testenv:dbt_integration_fusion_duckdb]
9393
allowlist_externals =
9494
bash

0 commit comments

Comments
 (0)