Skip to content

Commit 4de793b

Browse files
fivetran-data-model-botfivetran-catfritzfivetran-avinashgithub-actions[bot]AK-Fivetran
authored
Consolidate source + remove tests (#67)
* Consolidate dbt source into transform * Q2 FY26 Automatic Package Updates (#65) * Q2 FY26: Apply automated update. * Q2 FY26: Update auto-release workflow only. --------- Co-authored-by: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Co-authored-by: Avinash Kunnath <108772760+fivetran-avinash@users.noreply.github.com> * packages, dbt_project, changelog, readme * Generate dbt docs via GitHub Actions * Correct capitalization of GitHub (#62) "GitHub" should be camelcase. The live version of the README inconsistently capitalizes it. This PR correct that issue. Co-authored-by: Avinash Kunnath <108772760+fivetran-avinash@users.noreply.github.com> * Changelog * Generate dbt docs via GitHub Actions --------- Co-authored-by: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Co-authored-by: Avinash Kunnath <108772760+fivetran-avinash@users.noreply.github.com> Co-authored-by: Avinash Kunnath <avinash.kunnath@fivetran.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: AK Krajewska <ak.krajewska@fivetran.com>
1 parent f68f209 commit 4de793b

68 files changed

Lines changed: 1403 additions & 103 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.buildkite/hooks/pre-command

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ export CI_SNOWFLAKE_DBT_USER=$(gcloud secrets versions access latest --secret="C
2121
export CI_SNOWFLAKE_DBT_WAREHOUSE=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_WAREHOUSE" --project="dbt-package-testing-363917")
2222
export CI_DATABRICKS_DBT_HOST=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_HOST" --project="dbt-package-testing-363917")
2323
export CI_DATABRICKS_DBT_HTTP_PATH=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_HTTP_PATH" --project="dbt-package-testing-363917")
24-
export CI_DATABRICKS_DBT_TOKEN=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_TOKEN" --project="dbt-package-testing-363917")
24+
export CI_DATABRICKS_DBT_TOKEN=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_TOKEN" --project="dbt-package-testing-363917")
25+
export CI_DATABRICKS_DBT_CATALOG=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_CATALOG" --project="dbt-package-testing-363917")

.buildkite/pipeline.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,6 @@ steps:
6969
- "CI_DATABRICKS_DBT_HOST"
7070
- "CI_DATABRICKS_DBT_HTTP_PATH"
7171
- "CI_DATABRICKS_DBT_TOKEN"
72+
- "CI_DATABRICKS_DBT_CATALOG"
7273
commands: |
7374
bash .buildkite/scripts/run_models.sh databricks

.github/PULL_REQUEST_TEMPLATE/maintainer_pull_request_template.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ Before marking this PR as "ready for review":
1212

1313
## PR Overview
1414
**Package version introduced in this PR:**
15-
15+
-
16+
1617
**This PR addresses the following Issue/Feature(s):**
1718
<!-- Add Issue # or internal ticket reference -->
19+
-
1820

1921
**Summary of changes:**
2022
<!-- 1-2 sentences describing PR changes. -->
21-
23+
-
2224

2325
### Submission Checklist
2426
- [ ] Alignment meeting with the reviewer (if needed)
@@ -27,9 +29,10 @@ Before marking this PR as "ready for review":
2729
- [ ] **Validation Steps:** Check for unintentional effects (e.g., add/run consistency & integrity tests)
2830
- [ ] **Testing Instructions:** Confirm the change addresses the issue(s)
2931
- [ ] **Focus Areas:** Complex logic or queries that need extra attention
32+
- [ ] Merge any relevant open PRs into this PR
3033

3134
### Changelog
3235
<!-- Recommend drafting changelog notes, then refining via ChatGPT using:
3336
"Draft a changelog entry based on the following notes." -->
3437
- [ ] Draft changelog for PR
35-
- [ ] Final changelog for release review
38+
- [ ] Final changelog for release review

.github/workflows/auto-release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ on:
33
pull_request:
44
types:
55
- closed
6-
branches:
7-
- main
6+
- labeled
87

98
jobs:
10-
call-workflow-passing-data:
11-
if: github.event.pull_request.merged
9+
release:
10+
if: |
11+
(github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main') ||
12+
github.event.label.name == 'pre-release'
1213
uses: fivetran/dbt_package_automations/.github/workflows/auto-release.yml@main
13-
secrets: inherit
14+
secrets: inherit
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 'generate dbt docs'
2+
on:
3+
pull_request:
4+
types:
5+
- labeled
6+
7+
jobs:
8+
generate-docs:
9+
if: github.event.label.name == 'docs:ready'
10+
uses: fivetran/dbt_package_automations/.github/workflows/generate-docs.yml@main
11+
secrets: inherit
12+
with:
13+
schema_var_name: github_schema

.gitignore

Lines changed: 69 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,73 @@
1-
2-
target/
1+
# dbt
2+
**/package-lock.yml
3+
package-lock.yml
4+
.dbt/
35
dbt_modules/
6+
dbt_packages/
47
logs/
5-
keyfile.json
8+
profiles.yml
9+
target/
10+
*.log
11+
12+
# IDE files
13+
.idea/
14+
.vscode/
15+
*~
16+
*.swp
17+
*.swo
18+
19+
# Jupyter Notebook
20+
.ipynb_checkpoints
21+
22+
# OS generated files
23+
**/.DS_Store
624
.DS_Store
7-
develop/
8-
dbt_packages/
25+
.Spotlight-V100
26+
.Trashes
27+
._*
28+
Thumbs.db
29+
ehthumbs.db
30+
31+
# Python
32+
*.egg
33+
*.egg-info/
34+
*.py[cod]
35+
*.so
36+
*$py.class
37+
.Python
38+
__pycache__/
39+
build/
40+
develop-eggs/
41+
dist/
42+
downloads/
43+
eggs/
44+
.env
45+
.installed.cfg
46+
lib/
47+
lib64/
48+
MANIFEST
49+
parts/
50+
sdist/
51+
var/
52+
wheels/
53+
54+
# Secrets and credentials
55+
.env.*
56+
.secrets
57+
credentials.json
58+
service-account.json
59+
60+
# Temporary files
61+
.cache/
62+
*.temp
63+
*.tmp
64+
65+
# Virtual environments
66+
.conda/
67+
.env
68+
.venv
69+
ENV/
970
env/
10-
package-lock.yml
71+
env.bak/
72+
venv/
73+
venv.bak/

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# dbt_github v1.0.0
2+
3+
[PR #67](https://github.com/fivetran/dbt_github/pull/67) includes the following updates:
4+
5+
## Breaking Changes
6+
7+
### Source Package Consolidation
8+
- Removed the dependency on the `fivetran/github_source` package.
9+
- All functionality from the source package has been merged into this transformation package for improved maintainability and clarity.
10+
- If you reference `fivetran/github_source` in your `packages.yml`, you must remove this dependency to avoid conflicts.
11+
- Any source overrides referencing the `fivetran/github_source` package will also need to be removed or updated to reference this package.
12+
- Update any github_source-scoped variables to be scoped to only under this package. See the [README](https://github.com/fivetran/dbt_github/blob/main/README.md) for how to configure the build schema of staging models.
13+
- As part of the consolidation, vars are no longer used to reference staging models, and only sources are represented by vars. Staging models are now referenced directly with `ref()` in downstream models.
14+
15+
### dbt Fusion Compatibility Updates
16+
- Updated package to maintain compatibility with dbt-core versions both before and after v1.10.6, which introduced a breaking change to multi-argument test syntax (e.g., `unique_combination_of_columns`).
17+
- Temporarily removed unsupported tests to avoid errors and ensure smoother upgrades across different dbt-core versions. These tests will be reintroduced once a safe migration path is available.
18+
- Removed all `dbt_utils.unique_combination_of_columns` tests.
19+
- Moved `loaded_at_field: _fivetran_synced` under the `config:` block in `src_github.yml`.
20+
21+
### Under the Hood
22+
- Updated conditions in `.github/workflows/auto-release.yml`.
23+
- Added `.github/workflows/generate-docs.yml`.
24+
125
# dbt_github v0.9.1
226

327
[PR #64](https://github.com/fivetran/dbt_github/pull/64) includes the following updates:

README.md

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Github dbt Package ([Docs](https://fivetran.github.io/dbt_github/))
1+
# GitHub dbt Package ([Docs](https://fivetran.github.io/dbt_github/))
22

33
<p align="left">
44
<a alt="License"
55
href="https://github.com/fivetran/dbt_github/blob/main/LICENSE">
66
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" /></a>
77
<a alt="dbt-core">
8-
<img src="https://img.shields.io/badge/dbt_Core™_version->=1.3.0_<2.0.0-orange.svg" /></a>
8+
<img src="https://img.shields.io/badge/dbt_Core™_version->=1.3.0_,<2.0.0-orange.svg" /></a>
99
<a alt="Maintained?">
1010
<img src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" /></a>
1111
<a alt="PRs">
@@ -16,9 +16,7 @@
1616
</p>
1717

1818
## What does this dbt package do?
19-
20-
- Produces modeled tables that leverage Github data from [Fivetran's connector](https://fivetran.com/docs/applications/github) in the format described by [this ERD](https://fivetran.com/docs/applications/github#schemainformation) and builds off of the output from our [github source package](https://github.com/fivetran/dbt_github_source).
21-
19+
- Produces modeled tables that leverage GitHub data from [Fivetran's connector](https://fivetran.com/docs/applications/github) in the format described by [this ERD](https://fivetran.com/docs/applications/github#schemainformation).
2220
- Provides insight into GitHub issues and pull requests by enhancing these core objects with commonly used metrics.
2321
- Produces metrics tables, which increase understanding of your team's velocity over time. Metrics are available on a daily, weekly, monthly, and quarterly level.
2422
- Generates a comprehensive data dictionary of your source and modeled github data through the [dbt docs site](https://fivetran.github.io/dbt_github/).
@@ -44,7 +42,7 @@ Each Quickstart transformation job run materializes 34 models if all components
4442
### Step 1: Prerequisites
4543
To use this dbt package, you must have the following:
4644

47-
- At least one Fivetran Github connection syncing data into your destination.
45+
- At least one Fivetran GitHub connection syncing data into your destination.
4846
- A **BigQuery**, **Snowflake**, **Redshift**, **PostgreSQL**, or **Databricks** destination.
4947

5048
#### Databricks Dispatch Configuration
@@ -62,24 +60,23 @@ Include the following github package version in your `packages.yml` file.
6260
```yaml
6361
packages:
6462
- package: fivetran/github
65-
version: [">=0.9.0", "<0.10.0"] # we recommend using ranges to capture non-breaking changes automatically
63+
version: [">=1.0.0", "<1.1.0"] # we recommend using ranges to capture non-breaking changes automatically
6664
```
6765

68-
Do NOT include the `github_source` package in this file. The transformation package itself has a dependency on it and will install the source package as well.
69-
66+
> All required sources and staging models are now bundled into this transformation package. Do not include `fivetran/github_source` in your `packages.yml` since this package has been deprecated.
7067

7168
### Step 3: Define database and schema variables
72-
By default, this package runs using your [destination](https://docs.getdbt.com/docs/running-a-dbt-project/using-the-command-line-interface/configure-your-profile) and the `github` schema. If this is not where your Github data is (for example, if your github schema is named `github_fivetran`), add the following configuration to your root `dbt_project.yml` file:
69+
By default, this package runs using your [destination](https://docs.getdbt.com/docs/running-a-dbt-project/using-the-command-line-interface/configure-your-profile) and the `github` schema. If this is not where your GitHub data is (for example, if your github schema is named `github_fivetran`), add the following configuration to your root `dbt_project.yml` file:
7370

7471
```yml
7572
vars:
76-
github_source:
73+
github:
7774
github_database: your_database_name
7875
github_schema: your_schema_name
7976
```
8077

8178
### Step 4: Disable models for non-existent sources
82-
Your Github connection 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.
79+
Your GitHub connection 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.
8380

8481
If you do not have the `TEAM`, `REPO_TEAM`, `ISSUE_ASSIGNEE`, `ISSUE_LABEL`, `LABEL`, or `REQUESTED_REVIEWER_HISTORY` tables synced and are not running the package via Fivetran Quickstart, add the following variables to your `dbt_project.yml` file:
8582

@@ -99,19 +96,19 @@ vars:
9996
<details open><summary>Expand/collapse configurations</summary>
10097

10198
#### Change the build schema
102-
By default, this package builds the Github staging models within a schema titled (`<target_schema>` + `_github_source`) and your Github modeling models within a schema titled (`<target_schema>` + `_github`) in your destination. If this is not where you would like your Github data to be written to, add the following configuration to your root `dbt_project.yml` file:
99+
By default, this package builds the GitHub staging models within a schema titled (`<target_schema>` + `_github_source`) and your GitHub modeling models within a schema titled (`<target_schema>` + `_github`) in your destination. If this is not where you would like your GitHub data to be written to, add the following configuration to your root `dbt_project.yml` file:
103100

104101
```yml
105102
models:
106-
github_source:
107-
+schema: my_new_schema_name # leave blank for just the target_schema
108103
github:
109-
+schema: my_new_schema_name # leave blank for just the target_schema
104+
+schema: my_new_schema_name # Leave +schema: blank to use the default target_schema.
105+
staging:
106+
+schema: my_new_schema_name # Leave +schema: blank to use the default target_schema.
110107
```
111108
#### Change the source table references
112109
If an individual source table has a different name than the package expects, add the table name as it appears in your destination to the respective variable:
113110

114-
> IMPORTANT: See this project's [`dbt_project.yml`](https://github.com/fivetran/dbt_github_source/blob/main/dbt_project.yml) variable declarations to see the expected names.
111+
> IMPORTANT: See this project's [`dbt_project.yml`](https://github.com/fivetran/dbt_github/blob/main/dbt_project.yml) variable declarations to see the expected names.
115112

116113
```yml
117114
vars:
@@ -129,7 +126,7 @@ Fivetran offers the ability for you to orchestrate your dbt project through [Fiv
129126
## Does this package have dependencies?
130127
This dbt package is dependent on the following dbt packages. These dependencies are installed by default within this package. For more information on the following packages, refer to the [dbt hub](https://hub.getdbt.com/) site.
131128
> IMPORTANT: If you have any of these dependent packages in your own `packages.yml` file, we highly recommend that you remove them from your root `packages.yml` to avoid package version conflicts.
132-
129+
133130
```yml
134131
packages:
135132
- package: fivetran/fivetran_utils
@@ -138,9 +135,6 @@ packages:
138135
- package: dbt-labs/dbt_utils
139136
version: [">=1.0.0", "<2.0.0"]
140137
141-
- package: fivetran/github_source
142-
version: [">=0.9.0", "<0.10.0"]
143-
144138
- package: dbt-labs/spark_utils
145139
version: [">=0.3.0", "<0.4.0"]
146140
```

dbt_project.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
11
config-version: 2
22
name: 'github'
3-
version: '0.9.1'
3+
version: '1.0.0'
44
require-dbt-version: [">=1.3.0", "<2.0.0"]
55
models:
66
github:
77
+materialized: table
88
+schema: github
99
intermediate:
1010
+materialized: ephemeral
11+
staging:
12+
+schema: github_source
13+
+materialized: table
14+
tmp:
15+
+materialized: view
1116
vars:
1217
github:
13-
issue_assignee: "{{ ref('stg_github__issue_assignee') }}"
14-
issue_closed_history: "{{ ref('stg_github__issue_closed_history') }}"
15-
issue_comment: "{{ ref('stg_github__issue_comment') }}"
16-
issue_label: "{{ ref('stg_github__issue_label') }}"
17-
label: "{{ ref('stg_github__label') }}"
18-
issue_merged: "{{ ref('stg_github__issue_merged') }}"
19-
issue: "{{ ref('stg_github__issue') }}"
20-
pull_request_review: "{{ ref('stg_github__pull_request_review') }}"
21-
pull_request: "{{ ref('stg_github__pull_request') }}"
22-
repository: "{{ ref('stg_github__repository') }}"
23-
repo_team: "{{ ref('stg_github__repo_team') }}"
24-
requested_reviewer_history: "{{ ref('stg_github__requested_reviewer_history') }}"
25-
team: "{{ ref('stg_github__team') }}"
26-
user: "{{ ref('stg_github__user') }}"
18+
issue_assignee: "{{ source('github', 'issue_assignee') }}"
19+
issue_closed_history: "{{ source('github', 'issue_closed_history') }}"
20+
issue_comment: "{{ source('github', 'issue_comment') }}"
21+
issue_label: "{{ source('github', 'issue_label') }}"
22+
label: "{{ source('github', 'label') }}"
23+
issue_merged: "{{ source('github', 'issue_merged') }}"
24+
issue: "{{ source('github', 'issue') }}"
25+
pull_request_review: "{{ source('github', 'pull_request_review') }}"
26+
pull_request: "{{ source('github', 'pull_request') }}"
27+
repository: "{{ source('github', 'repository') }}"
28+
repo_team: "{{ source('github', 'repo_team') }}"
29+
requested_reviewer_history: "{{ source('github', 'requested_reviewer_history') }}"
30+
team: "{{ source('github', 'team') }}"
31+
user: "{{ source('github', 'user') }}"

docs/catalog.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)