Skip to content

Commit 4599194

Browse files
authored
Merge pull request #7207 from segmentio/git-dbt-sync-updates
Git Sync/dbt Extension Updates
2 parents 5268c51 + e01c6db commit 4599194

File tree

2 files changed

+81
-2
lines changed

2 files changed

+81
-2
lines changed

src/segment-app/extensions/dbt.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,44 @@ After you've successfully set up dbt with a warehouse and connected to your Git
6969
6. Enter your **Model Name**, then click **Create Model**.
7070

7171
To change a connected model, ensure that you've removed it from all active Reverse ETL syncs.
72+
73+
## Git Connections
74+
75+
Git Connections enable Segment to sync data with your preferred Git repository through supported like SSH and token-based authentication.
76+
77+
> info ""
78+
> Git Sync and the dbt integration operate independently. You don’t need to set up Git Sync to use dbt, and dbt Cloud can trigger its own syncs without relying on Git Sync.
79+
80+
### Supported connection types
81+
82+
Segment supports the following credential types for setting up a Git Connection:
83+
84+
- **SSH**: Compatible with GitHub, GitLab, and Bitbucket, SSH provides a secure method for connecting to your repository.
85+
- **Git token**: Git tokens are supported across GitHub, GitLab, and Bitbucket, enabling token-based authentication for added flexibility.
86+
- **GitHub App**: For GitHub users, GitHub App integrations offer enhanced security and functionality. This method is exclusive to GitHub and supports additional features, like [CI checks](#setting-up-ci-checks).
87+
88+
### Reusing Git Connections
89+
90+
Segment lets you set up multiple Git Connections, allowing you to reuse credentials across both dbt and Git Sync. You can either use the same credential for multiple configurations or create separate Git Connections for each product and environment as needed.
91+
92+
If you plan to reuse a Git token across both dbt and Git Sync, ensure it has the necessary read and write permissions for both integrations.
93+
94+
## Setting Up CI checks
95+
96+
> info "CI check availability"
97+
> CI checks are available only with the GitHub App connection.
98+
99+
CI checks in Segment help prevent breaking changes to active dbt models. Avoid changing dbt models currently in use with an active Reverse ETL sync, since changes could disrupt existing mappings and active syncs.
100+
101+
When CI checks are enabled, Segment monitors model changes in your Git repository. If a model already linked to an active Reverse ETL sync gets modified, Segment automatically rejects the change to maintain data integrity.
102+
103+
To enable CI Checks, authorize a GitHub App credential for your Git connection. Once connected, you can enable CI Checks in the dbt model sync configuration section.
104+
105+
## Troubleshooting dbt Extensions
106+
107+
The following table lists common dbt Extension errors, as well as their solutions:
108+
109+
| Error | Error message | Solution |
110+
| ----------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
111+
| Failed sync | `Sync Failed: Incorrect dbt Project File Path: dbt project file not found` | Verify that the path to your `dbt_project.yml` file is relative to the repository root, excluding the root branch. <br> For example, use `project/dbt_project.yml` instead of `main/project/dbt_project.yml`. |
112+
| Failed sync | `Sync Failed: remote: Write access to repository not granted` | Verify that the account associated with the token has a write role in the repository settings. Fine-grained tokens may require specific roles, depending on your Git provider. |

src/segment-app/extensions/git.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,21 @@ The Git sync extension syncs the following resources from Segment to your Git re
2323

2424
- [Sources](/docs/connections/sources/) and [Destinations](/docs/connections/destinations/)
2525
- [Warehouses](/docs/connections/storage/warehouses/)
26-
- [Destination Filters and Mappings](/docs/connections/destinations/destination-filters/)
26+
- [Destination Filters and Mappings](/docs/connections/destinations/destination-filters/) for Connections
2727
- [Tracking Plans](/docs/protocols/tracking-plan/create/)
2828
- [Functions](/docs/connections/functions/)
2929
- [Transformations](/docs/protocols/transform/)
3030
- [Reverse ETL](/docs/connections/reverse-etl/)
3131
- [Users](/docs/segment-app/iam/concepts/#team-members) and [User groups](/docs/segment-app/iam/concepts/#user-groups)
3232
- [Labels](/docs/segment-app/iam/labels/#where-can-i-create-labels)
3333

34+
The Git sync extension doesn't support the following resources:
35+
36+
- [Spaces](/docs/segment-app/workspace-home/)
37+
- [Audiences](/docs/engage/audiences/) and [Journeys](/docs/engage/journeys/)
38+
- [Data Graph](/docs/unify/data-graph/)
39+
- Mappings for [Linked Audiences](/docs/engage/audiences/linked-audiences/)
40+
3441
Reach out to [Segment support](https://app.segment.com/workspaces?contact=1){:target="blank"} to request support for additional Git Sync resources.
3542

3643
After you set up the Git sync extension for the first time, Segment performs an initial sync that sends the current state of your Segment workspace to the Git repository you connected. Segment automatically tracks all following workspace updates.
@@ -49,7 +56,7 @@ Using HCL makes it easier to document Segment's data model, especially for users
4956

5057
Segment supports one-way synchronization from Segment to Git, but you can set up two-way synchronization using the Segment Terraform provider.
5158

52-
Terraform offers an open-source way to manage Segment resources through a Git repository as an alternative to a fully managed two-way sync. However, this method requires third-party tools like [Atlantis](https://www.runatlantis.io/){:target="_blank"} for CI integration, which Segment doesn’t officially support.
59+
Terraform offers an open-source way to manage Segment resources through a Git repository as an alternative to a fully managed two-way sync. This method requires third-party tools like [Atlantis](https://www.runatlantis.io/){:target="_blank"} for CI integration.
5360

5461
To manage Segment resources using Git and Terraform, follow these steps:
5562

@@ -76,3 +83,34 @@ To manage Segment resources using Git and Terraform, follow these steps:
7683
7784
7885
For more information on using Terraform, visit [Terraform's documentation](https://developer.hashicorp.com/terraform/docs){:target="_blank"}.
86+
87+
## Git Connections
88+
89+
Git Connections enable Segment to sync data with your preferred Git repository through supported like SSH and token-based authentication.
90+
91+
> info ""
92+
> Git Sync and the dbt integration operate independently. You don’t need to set up Git Sync to use dbt, and dbt Cloud can trigger its own syncs without relying on Git Sync.
93+
94+
### Supported connection types
95+
96+
Segment supports the following credential types for setting up a Git Connection:
97+
98+
- **SSH**: Compatible with GitHub, GitLab, and Bitbucket, SSH provides a secure method for connecting to your repository.
99+
- **Git token**: Git tokens are also supported across GitHub, GitLab, and Bitbucket, enabling token-based authentication..
100+
- **GitHub App**: For GitHub users, GitHub App integrations offer enhanced security and functionality. This method is exclusive to GitHub and supports additional features, like CI checks.
101+
102+
### Reusing Git Connections
103+
104+
Segment lets you set up multiple Git Connections, allowing you to reuse credentials across both dbt and Git Sync. You can either use the same credential for multiple configurations or create separate Git Connections for each product and environment as needed.
105+
106+
If you plan to reuse a Git token across both dbt and Git Sync, ensure it has the necessary read and write permissions for both integrations.
107+
108+
## Troubleshooting Git Sync
109+
110+
When setting up Git Sync, you may run into an access error with the following message: `“Unable to create Git Sync due to Git connection issues. Please check your configuration and try again`.
111+
112+
This error can occur if there are issues with your Git connection settings or permissions. To resolve the error, verify that:
113+
114+
- Your credentials have write access to the Git repository, as Segment requires this to sync changes.
115+
- Your repository is hosted by GitHub, GitLab, or Bitbucket (Segment doesn't support self-hosted repositories).
116+
- Branch protections are disabled on the repository.

0 commit comments

Comments
 (0)