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

Prefix secrets with DBT_ENV_SECRET_ for test env vars #1025

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20240425-154527.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: Add secrets prefix for handling of secrets during testing
time: 2024-04-25T15:45:27.986709-04:00
custom:
Author: mikealfare
Issue: "1025"
6 changes: 3 additions & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ jobs:
DD_ENV: ci
DD_SERVICE: ${{ github.event.repository.name }}
DBT_DATABRICKS_CLUSTER_NAME: ${{ secrets.DBT_DATABRICKS_CLUSTER_NAME }}
DBT_DATABRICKS_HOST_NAME: ${{ secrets.DBT_DATABRICKS_HOST_NAME }}
DBT_DATABRICKS_ENDPOINT: ${{ secrets.DBT_DATABRICKS_ENDPOINT }}
DBT_DATABRICKS_TOKEN: ${{ secrets.DBT_DATABRICKS_TOKEN }}
DBT_ENV_SECRET_DATABRICKS_HOST_NAME: ${{ secrets.DBT_DATABRICKS_HOST_NAME }}
DBT_ENV_SECRET_DATABRICKS_ENDPOINT: ${{ secrets.DBT_DATABRICKS_ENDPOINT }}
DBT_ENV_SECRET_DATABRICKS_TOKEN: ${{ secrets.DBT_DATABRICKS_TOKEN }}
DBT_DATABRICKS_USER: ${{ secrets.DBT_DATABRICKS_USERNAME }}
DBT_TEST_USER_1: "[email protected]"
DBT_TEST_USER_2: "[email protected]"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ jobs:
DD_ENV: ci
DD_SERVICE: ${{ github.event.repository.name }}
DBT_DATABRICKS_CLUSTER_NAME: ${{ secrets.DBT_DATABRICKS_CLUSTER_NAME }}
DBT_DATABRICKS_HOST_NAME: ${{ secrets.DBT_DATABRICKS_HOST_NAME }}
DBT_DATABRICKS_ENDPOINT: ${{ secrets.DBT_DATABRICKS_ENDPOINT }}
DBT_DATABRICKS_TOKEN: ${{ secrets.DBT_DATABRICKS_TOKEN }}
DBT_ENV_SECRET_DATABRICKS_HOST_NAME: ${{ secrets.DBT_DATABRICKS_HOST_NAME }}
DBT_ENV_SECRET_DATABRICKS_ENDPOINT: ${{ secrets.DBT_DATABRICKS_ENDPOINT }}
DBT_ENV_SECRET_DATABRICKS_TOKEN: ${{ secrets.DBT_DATABRICKS_TOKEN }}
DBT_DATABRICKS_USER: ${{ secrets.DBT_DATABRICKS_USERNAME }}
DBT_TEST_USER_1: "[email protected]"
DBT_TEST_USER_2: "[email protected]"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-prep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,9 @@ jobs:
DD_ENV: ci
DD_SERVICE: ${{ github.event.repository.name }}
DBT_DATABRICKS_CLUSTER_NAME: ${{ secrets.DBT_DATABRICKS_CLUSTER_NAME }}
DBT_DATABRICKS_HOST_NAME: ${{ secrets.DBT_DATABRICKS_HOST_NAME }}
DBT_DATABRICKS_ENDPOINT: ${{ secrets.DBT_DATABRICKS_ENDPOINT }}
DBT_DATABRICKS_TOKEN: ${{ secrets.DBT_DATABRICKS_TOKEN }}
DBT_ENV_SECRET_DATABRICKS_HOST_NAME: ${{ secrets.DBT_DATABRICKS_HOST_NAME }}
DBT_ENV_SECRET_DATABRICKS_ENDPOINT: ${{ secrets.DBT_DATABRICKS_ENDPOINT }}
DBT_ENV_SECRET_DATABRICKS_TOKEN: ${{ secrets.DBT_DATABRICKS_TOKEN }}
DBT_DATABRICKS_USER: ${{ secrets.DBT_DATABRICKS_USERNAME }}
DBT_TEST_USER_1: "[email protected]"
DBT_TEST_USER_2: "[email protected]"
Expand Down
6 changes: 3 additions & 3 deletions test.env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Cluster ID
DBT_DATABRICKS_CLUSTER_NAME=
# SQL Endpoint
DBT_DATABRICKS_ENDPOINT=
DBT_ENV_SECRET_DATABRICKS_ENDPOINT=
# Server Hostname value
DBT_DATABRICKS_HOST_NAME=
DBT_ENV_SECRET_DATABRICKS_HOST_NAME=
# personal token
DBT_DATABRICKS_TOKEN=
DBT_ENV_SECRET_DATABRICKS_TOKEN=
# file path to local ODBC driver
ODBC_DRIVER=

Expand Down
14 changes: 7 additions & 7 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def databricks_cluster_target():
return {
"type": "spark",
"method": "odbc",
"host": os.getenv("DBT_DATABRICKS_HOST_NAME"),
"host": os.getenv("DBT_ENV_SECRET_DATABRICKS_HOST_NAME"),
"cluster": os.getenv("DBT_DATABRICKS_CLUSTER_NAME"),
"token": os.getenv("DBT_DATABRICKS_TOKEN"),
"token": os.getenv("DBT_ENV_SECRET_DATABRICKS_TOKEN"),
"driver": os.getenv("ODBC_DRIVER"),
"port": 443,
"connect_retries": 3,
Expand All @@ -68,9 +68,9 @@ def databricks_sql_endpoint_target():
return {
"type": "spark",
"method": "odbc",
"host": os.getenv("DBT_DATABRICKS_HOST_NAME"),
"endpoint": os.getenv("DBT_DATABRICKS_ENDPOINT"),
"token": os.getenv("DBT_DATABRICKS_TOKEN"),
"host": os.getenv("DBT_ENV_SECRET_DATABRICKS_HOST_NAME"),
"endpoint": os.getenv("DBT_ENV_SECRET_DATABRICKS_ENDPOINT"),
"token": os.getenv("DBT_ENV_SECRET_DATABRICKS_TOKEN"),
"driver": os.getenv("ODBC_DRIVER"),
"port": 443,
"connect_retries": 3,
Expand All @@ -82,9 +82,9 @@ def databricks_sql_endpoint_target():
def databricks_http_cluster_target():
return {
"type": "spark",
"host": os.getenv("DBT_DATABRICKS_HOST_NAME"),
"host": os.getenv("DBT_ENV_SECRET_DATABRICKS_HOST_NAME"),
"cluster": os.getenv("DBT_DATABRICKS_CLUSTER_NAME"),
"token": os.getenv("DBT_DATABRICKS_TOKEN"),
"token": os.getenv("DBT_ENV_SECRET_DATABRICKS_TOKEN"),
"method": "http",
"port": 443,
"connect_retries": 3,
Expand Down
Loading