Skip to content
Merged
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
22 changes: 22 additions & 0 deletions .changes/1.5.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 1.5.0
pr_number: 85
schema_data_changes:
entries:
- models:
- '[github__issue_label_history](https://fivetran.github.io/dbt_github/#!/model/model.github.github__issue_label_history)'
change_type: New model
notes: One row per period a label is applied to an issue or pull request, with
consecutive duplicate events collapsed. See the [DECISIONLOG](https://github.com/fivetran/dbt_github/blob/main/DECISIONLOG.md)
for details. Requires the `ISSUE_LABEL_HISTORY` and `LABEL` source tables. See
the [README](https://github.com/fivetran/dbt_github/#disable-models-for-non-existent-sources)
for details.
- models:
- '[stg_github__issue_label_history](https://fivetran.github.io/dbt_github/#!/model/model.github.stg_github__issue_label_history)'
- '[stg_github__issue_label_history_tmp](https://fivetran.github.io/dbt_github/#!/model/model.github.stg_github__issue_label_history_tmp)'
Comment on lines +14 to +15

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could probably combine these

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Don't they usually get their own entries?

@fivetran-savage fivetran-savage Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looks like we're not consistent. Combined them.

change_type: New staging and tmp models
notes: Stages the `ISSUE_LABEL_HISTORY` source table.
new_features:
- description: Adds the `github__using_issue_label_history` variable, which is dynamically
configured in Quickstart and defaults to `true` for self-managed dbt projects.
Set to `false` to disable if you don't sync the `ISSUE_LABEL_HISTORY` table.
date: '2026-11-04'
5 changes: 4 additions & 1 deletion .quickstart/quickstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ table_variables:
- team
github__using_requested_reviewer_history:
- requested_reviewer_history
github__using_issue_label_history:
- issue_label_history

_fivetran_quickstart_issue_closed_history:
- issue_closed_history
Expand All @@ -37,5 +39,6 @@ public_models: [
"github__quarterly_metrics",
"github__pull_requests",
"github__daily_metrics",
"github__issues"
"github__issues",
"github__issue_label_history"
]
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# dbt_github v1.5.0

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

## Schema/Data Change
**2 total changes • 0 possible breaking changes**

| Data Model(s) | Change type | Old | New | Notes |
| ------------- | ----------- | --- | --- | ----- |
| [github__issue_label_history](https://fivetran.github.io/dbt_github/#!/model/model.github.github__issue_label_history) | New model | | | One row per period a label is applied to an issue or pull request, with consecutive duplicate events collapsed. See the [DECISIONLOG](https://github.com/fivetran/dbt_github/blob/main/DECISIONLOG.md) for details. Requires the `ISSUE_LABEL_HISTORY` and `LABEL` source tables. See the [README](https://github.com/fivetran/dbt_github/#disable-models-for-non-existent-sources) for details. |
| [stg_github__issue_label_history](https://fivetran.github.io/dbt_github/#!/model/model.github.stg_github__issue_label_history)<br>[stg_github__issue_label_history_tmp](https://fivetran.github.io/dbt_github/#!/model/model.github.stg_github__issue_label_history_tmp) | New staging and tmp models | | | Stages the `ISSUE_LABEL_HISTORY` source table. |

## Feature Update
- Adds the `github__using_issue_label_history` variable, which is dynamically configured in Quickstart and defaults to `true` for self-managed dbt projects. Set to `false` to disable if you don't sync the `ISSUE_LABEL_HISTORY` table.

# dbt_github v1.4.1

[PR #82](https://github.com/fivetran/dbt_github/pull/82) includes the following updates:
Expand Down
14 changes: 14 additions & 0 deletions DECISIONLOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Decision Log

### Building label intervals in `github__issue_label_history`
The `ISSUE_LABEL_HISTORY` source table records one event each time a label is added to or removed from an issue or pull request. The `github__issue_label_history` model turns these events into one row for each period a label is applied. We made the following decisions when building those periods:

- **Consecutive duplicate events are collapsed.** The source can record the same action more than once in a row. For example, a label is added twice with no removal in between. We keep only the first event in each run of duplicates. A repeated add does not start a new period, and a repeated removal does not end one.

- **Removals with no earlier add are dropped.** If the first event for an issue and label is a removal, the label was applied before the history starts. We drop that removal because the start of its period is unknown.

- **Events with a null `label_id` are excluded.** The source can record an event with only the label name and no `label_id`. Including them would add a second, merged set of periods with no label ID, so we exclude them.

- **Adds sort before removals on the same timestamp.** When an add and a removal share the same `updated_at` value, we order the add first. This produces a zero-length period instead of an orphan removal followed by an open period.

Each period starts at `valid_from`, the time of the add. It ends at `valid_until`, the time of the next removal. If the label is still applied, `valid_until` is `null` and `is_currently_applied` is `true`. `label_application_number` counts how many times the label has been applied to the issue, starting at 1.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This dbt package transforms data from Fivetran's GitHub connector into analytics

## Resources

- Number of materialized models¹: 34
- Number of materialized models¹: 37
- Connector documentation
- [GitHub connector documentation](https://fivetran.com/docs/connectors/applications/github)
- [GitHub ERD](https://fivetran.com/docs/connectors/applications/github#schemainformation)
Expand Down Expand Up @@ -39,6 +39,7 @@ By default, this package materializes the following final tables:
| [github__weekly_metrics](https://fivetran.github.io/dbt_github/#!/model/model.github.github__weekly_metrics) | Aggregates weekly repository activity to analyze sprint-level productivity, track week-over-week trends, and understand development patterns at the weekly cadence. <br></br>**Example Analytics Questions:**<ul><li>What is the weekly throughput of pull requests and issues by repository?</li><li>How do weekly development metrics trend over time?</li><li>Which weeks show the highest productivity in terms of PRs merged and issues resolved?</li></ul>|
| [github__monthly_metrics](https://fivetran.github.io/dbt_github/#!/model/model.github.github__monthly_metrics) | Summarizes monthly repository activity to track long-term development trends, measure team productivity over time, and identify seasonal patterns in contribution activity. <br></br>**Example Analytics Questions:**<ul><li>How do monthly pull request and issue volumes trend across repositories?</li><li>What is the month-over-month growth in development activity and code contributions?</li><li>Which months show the highest productivity and how does this align with roadmap milestones?</li></ul>|
| [github__quarterly_metrics](https://fivetran.github.io/dbt_github/#!/model/model.github.github__quarterly_metrics) | Provides quarterly repository performance metrics to support strategic planning, measure progress against OKRs, and understand high-level development trends by quarter. <br></br>**Example Analytics Questions:**<ul><li>What is the quarterly velocity of feature development and issue resolution by repository?</li><li>How do quarterly metrics align with product roadmap goals and release cycles?</li><li>Which quarters show the strongest team performance and code contribution activity?</li></ul>|
| [github__issue_label_history](https://fivetran.github.io/dbt_github/#!/model/model.github.github__issue_label_history) | Tracks each period a label is applied to an issue or pull request, including when the label was added and removed and who added and removed it. <br></br>**Example Analytics Questions:**<ul><li>How long do issues typically keep a given label, such as `needs triage` or `blocked`?</li><li>How often is a label removed and re-applied to the same issue?</li><li>Which contributors apply and remove labels most often?</li></ul>|

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you update the model count in the README?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, interesting...that wasn't caught by the data model builder. Will open a PR for that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated


¹ Each Quickstart transformation job run materializes these models if all components of this data model are enabled. This count includes all staging, intermediate, and final models materialized as `view`, `table`, or `incremental`.

Expand All @@ -65,7 +66,7 @@ Include the following github package version in your `packages.yml` file.
```yaml
packages:
- package: fivetran/github
version: [">=1.4.0", "<1.5.0"] # we recommend using ranges to capture non-breaking changes automatically
version: [">=1.5.0", "<1.6.0"] # we recommend using ranges to capture non-breaking changes automatically
```

> 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.
Expand Down Expand Up @@ -115,14 +116,15 @@ If you use [Fivetran Transformations for dbt Core™](https://fivetran.com/docs/
### Disable models for non-existent sources
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.

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:
If you do not have the `TEAM`, `REPO_TEAM`, `ISSUE_ASSIGNEE`, `ISSUE_LABEL`, `ISSUE_LABEL_HISTORY`, `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:

```yml
vars:
github__using_repo_team: false # by default this is assumed to be true. Set to false if missing TEAM or REPO_TEAM
github__using_issue_assignee: false # by default this is assumed to be true
github__using_issue_label: false # by default this is assumed to be true
github__using_label: false # by default this is assumed to be true
github__using_issue_label_history: false # by default this is assumed to be true
github__using_label: false # by default this is assumed to be true. Setting this to false also disables github__issue_label_history
github__using_requested_reviewer_history: false # by default this is assumed to be true
```

Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config-version: 2
name: 'github'
version: '1.4.1'
version: '1.5.0'
require-dbt-version: [">=1.3.0", "<3.0.0"]
models:
github:
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions integration_tests/ci/test_scenarios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ test_scenarios:
github__using_issue_label: false
github__using_requested_reviewer_history: false
github__using_label: false
github__using_issue_label_history: false
include_incremental: false

- name: "MDLS"
Expand Down
10 changes: 9 additions & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'github_integration_tests'
version: '1.4.1'
version: '1.5.0'
config-version: 2
profile: 'integration_tests'
vars:
Expand All @@ -9,6 +9,7 @@ vars:
github_issue_closed_history_identifier: "github_issue_closed_history_data"
github_issue_comment_identifier: "github_issue_comment_data"
github_issue_label_identifier: "github_issue_label_data"
github_issue_label_history_identifier: "github_issue_label_history_data"
github_label_identifier: "github_label_data"
github_issue_merged_identifier: "github_issue_merged_data"
github_issue_identifier: "github_issue_data"
Expand Down Expand Up @@ -53,6 +54,13 @@ seeds:
issue_id: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"
label_id: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"
_fivetran_synced: timestamp
github_issue_label_history_data:
+column_types:
issue_id: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"
label_id: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"
actor_id: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"
updated_at: timestamp
_fivetran_synced: timestamp
github_label_data:
+column_types:
id: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"
Expand Down
14 changes: 14 additions & 0 deletions integration_tests/seeds/github_issue_label_history_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
issue_id,label_id,updated_at,labeled,actor_id,_fivetran_synced
735542695,2856837944,2020-01-10 09:00:00,TRUE,20294432,2020-03-01 00:00:00
735542695,2856837944,2020-01-10 09:05:00,TRUE,10001014,2020-03-01 00:00:00
735542695,2856837944,2020-01-15 14:30:00,FALSE,10001014,2020-03-01 00:00:00
735542695,2856837944,2020-02-01 11:00:00,TRUE,20294432,2020-03-01 00:00:00
735542695,2022377955,2020-01-05 08:00:00,FALSE,57712,2020-03-01 00:00:00
735542695,2022377955,2020-01-06 10:00:00,TRUE,57712,2020-03-01 00:00:00
735542695,2022377955,2020-01-08 16:00:00,FALSE,57712,2020-03-01 00:00:00
735542695,2022377955,2020-01-09 12:00:00,FALSE,57712,2020-03-01 00:00:00
595308957,2059419268,2019-12-10 13:00:00,TRUE,1261230,2020-03-01 00:00:00
595308957,2059419268,2019-12-20 17:45:00,FALSE,2722259,2020-03-01 00:00:00
595308957,2059419264,2019-12-11 09:30:00,TRUE,1261230,2020-03-01 00:00:00
592970298,2022377951,2019-03-05 10:00:00,TRUE,5175328,2020-03-01 00:00:00
595308957,,2019-12-10 13:00:00,TRUE,1261230,2020-02-15 00:00:00
48 changes: 48 additions & 0 deletions integration_tests/tests/consistency_issue_label_history.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{{ config(
tags="fivetran_validations",
enabled=var('fivetran_validation_tests_enabled', false) and var('github__using_issue_label_history', true)
) }}

{% set exclude_cols = var('gh_consistency_exclude_columns', []) %}

-- this test ensures the github__issue_label_history end model matches the prior version
with prod as (
select {{ dbt_utils.star(from=ref('github__issue_label_history'), except=exclude_cols) }}
from {{ target.schema }}_github_prod.github__issue_label_history
),

dev as (
select {{ dbt_utils.star(from=ref('github__issue_label_history'), except=exclude_cols) }}
from {{ target.schema }}_github_dev.github__issue_label_history
),

prod_not_in_dev as (
-- rows from prod not found in dev
select * from prod
except distinct
select * from dev
),

dev_not_in_prod as (
-- rows from dev not found in prod
select * from dev
except distinct
select * from prod
),

final as (
select
*,
'from prod' as source
from prod_not_in_dev

union all -- union since we only care if rows are produced

select
*,
'from dev' as source
from dev_not_in_prod
)

select *
from final
14 changes: 14 additions & 0 deletions macros/staging/get_issue_label_history_columns.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% macro get_issue_label_history_columns() %}

{% set columns = [
{"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
{"name": "actor_id", "datatype": dbt.type_int()},
{"name": "issue_id", "datatype": dbt.type_int()},
{"name": "label_id", "datatype": dbt.type_int()},
{"name": "labeled", "datatype": "boolean"},
{"name": "updated_at", "datatype": dbt.type_timestamp()}
] %}

{{ return(columns) }}

{% endmacro %}
8 changes: 7 additions & 1 deletion models/docs.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
{% docs source_relation %} Identifies the record's source. {% enddocs %}
{% docs source_relation %} Identifies the record's source. {% enddocs %}

{% docs issue_id %} Foreign key that references the issue table. The issue can be a regular issue or a pull request. {% enddocs %}

{% docs label_id %} Foreign key that references the label table. {% enddocs %}

{% docs _fivetran_synced %} Timestamp of the record being synced by Fivetran. {% enddocs %}
59 changes: 57 additions & 2 deletions models/github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ models:
- name: milestone_id
description: Foreign key that references the milestone.
- name: is_pull_request
description: Boolean indiciating whether the issue is a pull request.
description: Boolean indicating whether the issue is a pull request.
- name: issue_number
description: The number of the pull request. Unique within a repository, but not accross.
description: The number of the pull request. Unique within a repository, but not across.
- name: repository_id
description: Foreign key that references the repository table
- name: updated_at
Expand Down Expand Up @@ -234,6 +234,61 @@ models:
tests:
- not_null

- name: github__issue_label_history
description: >
Each period a label was applied to an issue or pull request, with when it was added, when it was removed, and who added and removed it.
One row per issue, label, and interval start (valid_from). Repeated adds or removals in a row are collapsed to the first event,
and a removal with no earlier add is dropped because its start is unknown. Events with a null label_id are excluded because
they duplicate an event that has the label_id. See the DECISIONLOG for details.
columns:
- name: issue_label_history_id
description: Surrogate key derived from source_relation, issue_id, label_id, and valid_from.
tests:
- not_null
- unique
- name: source_relation
description: "{{ doc('source_relation') }}"
- name: issue_id
description: "{{ doc('issue_id') }}"
tests:
- not_null
- name: issue_number
description: The number of the issue. Is unique within a repository, but not across repositories.
- name: is_pull_request
description: Boolean indicating whether the issue is a pull request.
- name: repository_id
description: Foreign key that references the repository table.
- name: repository
description: The full name of the repository the issue belongs to.
- name: label_id
description: "{{ doc('label_id') }}"
- name: label_name
description: Name of the label.
- name: label_description
description: Description of the label.
- name: is_default_label
description: Boolean indicating whether the label is a default label created with the repository.
- name: valid_from
description: Timestamp of when the label was added to the issue.
- name: valid_until
description: Timestamp of when the label was removed from the issue. Null if the label is still applied.
- name: is_currently_applied
description: Boolean indicating whether the label is still applied to the issue.
- name: label_application_number
description: The number of times this label has been applied to the issue, up to and including this interval. Starts at 1.
- name: actor_id
description: Foreign key that references the user table, representing the user who added the label.
- name: actor_login_name
description: Login name of the user who added the label.
- name: actor_name
description: Name of the user who added the label.
- name: removed_by_actor_id
description: Foreign key that references the user table, representing the user who removed the label. Null if the label is still applied.
- name: removed_by_actor_login_name
description: Login name of the user who removed the label.
- name: removed_by_actor_name
description: Name of the user who removed the label.

- name: github__quarterly_metrics
description: >
Summary numbers for issues and pull requests by quarter
Expand Down
Loading
Loading