Skip to content

Provide the connection id to the integration tests as a project variable - #9

Merged
mattsenicksigma merged 1 commit into
mainfrom
connection-id-var
Sep 29, 2026
Merged

mattsenicksigma merged 1 commit into
mainfrom
connection-id-var

Conversation

@mattsenicksigma

Copy link
Copy Markdown
Collaborator

What this changes

The Sigma connection id used by the integration tests was a real-looking value, copied into the three golden files (17 places) and the README example. It was already a project var, but its value was baked in everywhere the output was recorded. Now it is provided by the integration tests' project variable and appears nowhere else.

  • integration_tests/dbt_project.yml: sigma_connection_id reads SIGMA_CONNECTION_ID and otherwise defaults to an all-zeros placeholder, so no real id lives in the repo and a maintainer can still supply theirs (for example before export_workbooks.py --push --dry-run).
  • Golden files store <connectionId>. check_golden.py replaces connectionId values with that placeholder on both sides and writes goldens the same way, so the suite passes whatever id is supplied. Only connectionId is normalized; every other value, including folderId, is still compared exactly.
  • assert_workbooks now checks that every warehouse source carries exactly var('sigma_connection_id').
  • A new last step in the test script re-runs assert_workbooks under a --vars override, which passes only if the id flows from the var and is not baked into the macros or tests.
  • The README's dbt_project.yml example uses <your-sigma-connection-id>.

Verification

  • The golden diff is exactly 17 connectionId lines changed and nothing else, and the old id appears nowhere in the repo (excluding build output).
  • Passes on dbt 1.x with --warn-error and on dbt 2.x with the default placeholder, and on dbt 1.x with SIGMA_CONNECTION_ID set to a different value with no golden churn. 30 negative cases; 35 Python tests (4 new for the normalization, including one that fails if a real connection id is committed into a golden file).
  • Mutation-checked: hardcoding an id in warehouse_table fails assert_workbooks with "carries the sigma_connection_id project var, not a hardcoded id".

Not changed

sigma_folder_id and the data model id in the same file are also environment-style values and are still committed as-is; they were outside this request. The same approach would apply if you want them handled too.

🤖 Generated with Claude Code

The id was a real-looking value copied into the golden files and the README. Now:
- integration_tests/dbt_project.yml reads SIGMA_CONNECTION_ID with an all-zeros placeholder default.
- Golden files store <connectionId>; check_golden.py normalizes that field on both sides.
- assert_workbooks checks every warehouse source carries var('sigma_connection_id'), and the test
  script re-runs it under a --vars override to prove nothing is baked in.
- The README example uses a placeholder.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mattsenicksigma
mattsenicksigma merged commit d4de18a into main Sep 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant