Skip to content

Commit 3fcd502

Browse files
committed
review: address feedback on testing workflows
- revert ${{ github.workspace }} / ${{ env.TESTS_DIR }} inside run: blocks (these are workflow-internal, not user input \u2014 no security value) - drop the ELEMENTARY_EXTRA env var in favour of an inline case statement - fix the drop-stale-schemas --args quoting (mixed-quote, no \\\" escapes) Made-with: Cursor
1 parent e2071b1 commit 3fcd502

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

.github/workflows/cleanup-stale-schemas.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ jobs:
6565
run: |
6666
# The cleanup job doesn't create schemas, but generate_profiles.py
6767
# requires --schema-name. Use a dummy value.
68-
python "$GITHUB_WORKSPACE/dbt-data-reliability/integration_tests/profiles/generate_profiles.py" \
69-
--template "$GITHUB_WORKSPACE/dbt-data-reliability/integration_tests/profiles/profiles.yml.j2" \
68+
python "${{ github.workspace }}/dbt-data-reliability/integration_tests/profiles/generate_profiles.py" \
69+
--template "${{ github.workspace }}/dbt-data-reliability/integration_tests/profiles/profiles.yml.j2" \
7070
--output ~/.dbt/profiles.yml \
7171
--schema-name "cleanup_placeholder"
7272
@@ -75,13 +75,13 @@ jobs:
7575
run: dbt deps
7676

7777
- name: Symlink local elementary package
78-
run: ln -sfn "$GITHUB_WORKSPACE/dbt-data-reliability" "$TESTS_DIR/dbt_project/dbt_packages/elementary"
78+
run: ln -sfn "${{ github.workspace }}/dbt-data-reliability" "${{ env.TESTS_DIR }}/dbt_project/dbt_packages/elementary"
7979

8080
- name: Drop stale CI schemas
8181
working-directory: ${{ env.TESTS_DIR }}/dbt_project
8282
# Only dbt_ prefixed schemas are created in this repo's CI.
8383
# The elementary repo has its own workflow for py_ prefixed schemas.
8484
run: |
8585
dbt run-operation drop_stale_ci_schemas \
86-
--args "{prefixes: [\"dbt_\"], max_age_hours: ${MAX_AGE_HOURS}}" \
86+
--args '{prefixes: ["dbt_"], max_age_hours: '"$MAX_AGE_HOURS"'}' \
8787
-t "$WAREHOUSE"

.github/workflows/test-warehouse.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -194,17 +194,21 @@ jobs:
194194
curl -fsSL https://public.cdn.getdbt.com/fs/install/install.sh | sh -s --
195195
196196
- name: Install Elementary
197-
env:
198-
ELEMENTARY_EXTRA: ${{ (inputs.warehouse-type == 'databricks_catalog' && 'databricks') || inputs.warehouse-type }}
199197
run: |
200198
# For Vertica, dbt-vertica is already installed with --no-deps above;
201199
# using ".[vertica]" would re-resolve dbt-vertica's deps and downgrade
202200
# dbt-core to ~=1.8. Install elementary without the adapter extra.
203-
if [ "$WAREHOUSE" = "vertica" ]; then
204-
pip install "./elementary"
205-
else
206-
pip install "./elementary[${ELEMENTARY_EXTRA}]"
207-
fi
201+
case "$WAREHOUSE" in
202+
vertica)
203+
pip install "./elementary"
204+
;;
205+
databricks_catalog)
206+
pip install "./elementary[databricks]"
207+
;;
208+
*)
209+
pip install "./elementary[$WAREHOUSE]"
210+
;;
211+
esac
208212
209213
- name: Write dbt profiles
210214
env:
@@ -226,8 +230,8 @@ jobs:
226230
227231
echo "Schema name: $SCHEMA_NAME (branch='${BRANCH_NAME}', timestamp=${DATE_STAMP}, hash of concurrency group)"
228232
229-
python "$GITHUB_WORKSPACE/dbt-data-reliability/integration_tests/profiles/generate_profiles.py" \
230-
--template "$GITHUB_WORKSPACE/dbt-data-reliability/integration_tests/profiles/profiles.yml.j2" \
233+
python "${{ github.workspace }}/dbt-data-reliability/integration_tests/profiles/generate_profiles.py" \
234+
--template "${{ github.workspace }}/dbt-data-reliability/integration_tests/profiles/profiles.yml.j2" \
231235
--output ~/.dbt/profiles.yml \
232236
--schema-name "$SCHEMA_NAME"
233237
@@ -236,7 +240,7 @@ jobs:
236240
run: |
237241
if [ "$DBT_VERSION" = "fusion" ]; then DBT_BIN="$HOME/.local/bin/dbt"; else DBT_BIN="dbt"; fi
238242
"$DBT_BIN" deps --project-dir dbt_project
239-
ln -sfn "$GITHUB_WORKSPACE/dbt-data-reliability" dbt_project/dbt_packages/elementary
243+
ln -sfn "${{ github.workspace }}/dbt-data-reliability" dbt_project/dbt_packages/elementary
240244
pip install -r requirements.txt
241245
242246
- name: Start Vertica

0 commit comments

Comments
 (0)