Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CircleCI contexts for environment variables #754

Merged
merged 1 commit into from
Jan 6, 2023

Conversation

dbeatty10
Copy link
Contributor

@dbeatty10 dbeatty10 commented Jan 6, 2023

resolves N/A

This is a:

  • ci change

All pull requests from community contributors should target the main branch (default).

Description & motivation

CircleCI has a capability of creating a named collection of environment variables called "contexts".

We've created one CircleCI Context per hosted data platform used in our integration tests:

  • profile-redshift
  • profile-snowflake
  • profile-bigquery
  • profile-databricks

CircleCI contexts included in a CI workflow take priority over project-level environment variables (according to this order of precedence). So if ENV_VAR_123 is defined both at the project level and within a context, the project-specific one is not utilized.

Checklist

  • This code is associated with an Issue which has been triaged and accepted for development.
  • I have verified that these changes work locally on the following warehouses (Note: it's okay if you do not have access to all warehouses, this helps us understand what has been covered)
    • BigQuery
    • Postgres
    • Redshift
    • Snowflake
  • I followed guidelines to ensure that my changes will work on "non-core" adapters by:
    • dispatching any new macro(s) so non-core adapters can also use them (e.g. the star() source)
    • using the limit_zero() macro in place of the literal string: limit 0
    • using dbt.type_* macros instead of explicit datatypes (e.g. dbt.type_timestamp() instead of TIMESTAMP
  • I have updated the README.md (if applicable)
  • I have added tests & descriptions to my models (and macros if applicable)
  • I have added an entry to CHANGELOG.md

@dave-connors-3 dave-connors-3 marked this pull request as ready for review January 6, 2023 23:06
Copy link
Contributor

@dave-connors-3 dave-connors-3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dbeatty10 dbeatty10 merged commit 30515ef into main Jan 6, 2023
@joellabes
Copy link
Contributor

This is obviously resolved, but for my enrichment: how is this only additive? What did it replace and where did that go?

@dbeatty10
Copy link
Contributor Author

This is obviously resolved, but for my enrichment: how is this only additive? What did it replace and where did that go?

This replaces project-level environment variables in the case that the same environment variable is also defined within an imported context. The description above has been updated to add more detail.

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.

3 participants