Skip to content

Commit

Permalink
- fix grants
Browse files Browse the repository at this point in the history
- enforce dbt target
  • Loading branch information
juls858 committed Oct 17, 2023
1 parent 38680a5 commit 935052e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dbt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
dbt deps
- name: Run DBT Jobs
run: |
dbt ${{ inputs.command }}
dbt ${{ inputs.command }} --target ${{ inputs.environment }}
- name: Store logs
uses: actions/upload-artifact@v3
with:
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/dbt_integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
options:
- dev
- prod
- hosted
default: dev
warehouse:
type: choice
Expand All @@ -28,7 +29,16 @@ concurrency:
group: ${{ github.workflow }}

jobs:
scheduled:
hosted:
uses: ./.github/workflows/dbt.yml
if: github.event_name == 'schedule' || github.event_name == 'push'
secrets: inherit
with:
warehouse: DBT_CLOUD
environment: hosted
command: test -s test___utils_udf_introspect

prod:
uses: ./.github/workflows/dbt.yml
if: github.event_name == 'schedule' || github.event_name == 'push'
secrets: inherit
Expand All @@ -37,11 +47,11 @@ jobs:
environment: prod
command: test -s test___utils_udf_introspect

dispached:
dispatched:
uses: ./.github/workflows/dbt.yml
if: github.event_name == 'workflow_dispatch'
secrets: inherit
with:
warehouse: ${{ inputs.warehouse }}
environment: workflow_${{ inputs.environment }}
environment: ${{ inputs.environment }}
command: test -s test___utils_udf_introspect
4 changes: 2 additions & 2 deletions .github/workflows/dbt_udf_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ jobs:
environment: prod
command: test --selector test_udfs --threads 24

dispached:
dispatched:
uses: ./.github/workflows/dbt.yml
if: github.event_name == 'workflow_dispatch'
secrets: inherit
with:
warehouse: ${{ inputs.warehouse }}
environment: workflow_${{ inputs.environment }}
environment: ${{ inputs.environment }}
command: test --selector test_udfs --threads 24
2 changes: 1 addition & 1 deletion models/mapping_tables/_evm__contracts_map.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ config(
materialized = 'view',
grants = {'+select': ['INTERNAL_DEV'] if target.name != "hosted" else ['DATA_READER'] }
grants = {'+select': var('ROLES')}
) }}

SELECT
Expand Down

0 comments on commit 935052e

Please sign in to comment.