Skip to content

Commit

Permalink
Merge pull request #13 from fivetran/disable_repo_team
Browse files Browse the repository at this point in the history
repo_team variable
  • Loading branch information
fivetran-jamie authored Jun 11, 2021
2 parents db121a5 + 81daef0 commit aae2e4a
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
dbt deps
dbt seed --target redshift --full-refresh
dbt run --target redshift --full-refresh
dbt run --vars '{github__using_repo_team: false}' --target redshift --full-refresh
dbt test --target redshift
- run:
name: "Run Tests - Snowflake"
Expand All @@ -40,6 +41,7 @@ jobs:
dbt deps
dbt seed --target snowflake --full-refresh
dbt run --target snowflake --full-refresh
dbt run --vars '{github__using_repo_team: false}' --target snowflake --full-refresh
dbt test --target snowflake
- run:
name: "Run Tests - BigQuery"
Expand All @@ -53,6 +55,7 @@ jobs:
dbt deps
dbt seed --target bigquery
dbt run --target bigquery --full-refresh
dbt run --vars '{github__using_repo_team: false}' --target bigquery --full-refresh
dbt test --target bigquery
- save_cache:
key: deps2-{{ .Branch }}
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,24 @@ vars:
github_schema: your_schema_name
```
### Disabling Models
Your Github connector might not sync every table that this package expects. If your syncs exclude certain tables, it is because you either don't use that functionality in Github or have actively excluded some tables from your syncs.
If you do not have the `REPO_TEAM` table synced, add the following variable to your `dbt_project.yml` file:

```yml
# dbt_project.yml
config-version: 2
vars:
github__using_repo_team: false # by default this is assumed to be true
```

*Note: This package only integrates the above variable. If you'd like to disable other models, please create an [issue](https://github.com/fivetran/dbt_github_source/issues) specifying which ones.*

## Database support
This package has been tested on BigQuery, Snowflake and Redshift.

## Contributions

Additional contributions to this package are very welcome! Please create issues
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config-version: 2

name: 'github_source'
version: '0.2.1'
version: '0.2.2'

require-dbt-version: [">=0.18.0", "<0.20.0"]

Expand Down
2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'github_source_integration_tests'
version: '0.2.1'
version: '0.2.2'
config-version: 2

profile: 'integration_tests'
Expand Down
2 changes: 2 additions & 0 deletions models/src_github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ sources:

- name: repo_team
description: Table representing the mapping relationships between repositiories and teams
meta:
is_enabled: "{{ var('github__using_repo_team', true) }}"
columns:
- name: repository_id
description: Reference to the respective repository for the record.
Expand Down
1 change: 1 addition & 0 deletions models/stg_github__repo_team.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ config(enabled=var('github__using_repo_team', True)) }}

with base as (

Expand Down
2 changes: 2 additions & 0 deletions models/tmp/stg_github__repo_team_tmp.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
{{ config(enabled=var('github__using_repo_team', True)) }}

select *
from {{ var('repo_team') }}

0 comments on commit aae2e4a

Please sign in to comment.