Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update import-a-project-by-git-url.md #5419

Merged
merged 13 commits into from
Jun 6, 2024
19 changes: 16 additions & 3 deletions website/docs/docs/cloud/git/import-a-project-by-git-url.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ In dbt Cloud, you can import a git repository from any valid git URL that points
## Git protocols
You must use the `git@...` or `ssh:..`. version of your git URL, not the `https://...` version. dbt Cloud uses the SSH protocol to clone repositories, so dbt Cloud will be unable to clone repos supplied with the HTTP protocol.


## Managing Deploy Keys

After importing a project by Git URL, dbt Cloud will generate a Deploy Key for your repository. To find the deploy key in dbt Cloud:
Expand Down Expand Up @@ -83,7 +82,8 @@ dbt Cloud can work with dbt projects hosted on AWS CodeCommit, but there are som
- Copy the SSH URL from that page.
- Next, navigate to the **New Repository** page in dbt Cloud.
- Choose the **Git Clone** tab, and paste in the SSH URL you copied from the console.
- In the newly created Repository details page, you'll see a **Deploy Key** field. Copy the contents of this field as you'll need it for [Step 3](#step-3-grant-dbt-cloud-aws-user-access)
- In the newly created Repository details page, you'll see a **Deploy Key** field.
- Copy the contents of this field as you'll need it for [Step 3](#step-3-grant-dbt-cloud-aws-user-access).

**Note:** The dbt Cloud-generated public key is the only key that will work in the next step. Any other key that has been generated outside of dbt Cloud will not work.

Expand All @@ -102,7 +102,20 @@ CodeCommit uses `master` as its default branch, and to initialize your project,
- Select **Settings** -> **Edit** and under **General Settings**, check the **Default to a custom branch** checkbox.
- Specify the custom branch as `master` and click **Save**.

🎉 **You're all set!** Once dbt Support handles your request and you've set your custom branch, your project is ready to execute dbt runs on dbt Cloud.
#### Step 5: Configure pull request template URLs (Optional)

To prevent users from directly merging code changes into the default branch, configure the [PR Template URL](/docs/collaborate/git/pr-template) in the **Repository details** page for your project. Once configured, dbt Cloud will prompt users to open a new PR after committing and synching code changes on the branch in the IDE, before merging any changes into the default branch.

- Go to **Account Settings** -> **Projects** -> Select the project.
- Click the repository link under **Repository**.
- In the **Repository details** page, click **Edit** in the lower right.
<Lightbox src="/img/docs/collaborate/repo-details.jpg" width="80%" title="Configure PR template in the 'Repository details' page." />
- In the **Pull request URL** field, set the URL based on the suggested [PR template format](/docs/collaborate/git/pr-template#aws-codecommit).
- Replace `<repo>` with the name of your repository (Note that it is case sensitive). In the following example, the repository name is `New_Repo`.
<Lightbox src="/img/docs/collaborate/pr-template-example.jpg" width="60%" title="In the Pull request URL field example, the repository name is 'New_Repo'." />
- After filling the **Pull request URL** field, click **Save**.

🎉 **You're all set!** Once dbt Support handles your request and you've set your custom branch, your project is ready to execute dbt runs on dbt Cloud.

## Azure DevOps
:::info Use Azure DevOps?
Expand Down
12 changes: 5 additions & 7 deletions website/docs/docs/collaborate/git/pr-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@ id: "pr-template"
---
## Configure pull request (PR) template URLs

When changes are committed on a branch in the IDE, dbt Cloud can prompt users to
open a new Pull Request for the code changes. To enable this functionality, ensure
that a PR Template URL is configured in the Repository details page in your
Account Settings. If this setting is blank, the IDE will prompt users to merge the changes directly into their default branch.
When you commit changes to a branch in the IDE, dbt Cloud can prompt users to open a new Pull Request for the code changes. To enable this functionality, ensure that a PR Template URL is configured in the **Repository details** page in your **Account Settings**. If this setting is blank, the IDE will prompt users to merge the changes directly into their default branch.

<Lightbox src="/img/docs/dbt-cloud/cloud-configuring-dbt-cloud/configure-template-url-new-ide.png" title="Open a PR in the IDE"/>
<Lightbox src="/img/docs/collaborate/repo-details.jpg" width="90%" title="Configure a PR template in the 'Repository details' page." />

### PR Template URL by git provider

The PR Template URL setting will be automatically set for most repositories, depending on the connection method.

- If you connect to your repository via in-app integrations with your git provider or the "Git Clone" method via SSH, this URL setting will be auto-populated and editable.
- If you connect via a dbt Cloud [Managed repository](/docs/collaborate/git/managed-repository), this URL will not be set, and the IDE will prompt users to merge the changes directly into their default branch.
- For AWS CodeCommit, this URL setting isn't auto-populated and must be [manually configured](/docs/cloud/git/import-a-project-by-git-url#step-5-configure-pull-request-template-urls-optional).
- If you connect via a dbt Cloud [Managed repository](/docs/collaborate/git/managed-repository), this URL will not be set, and the IDE will prompt users to merge the changes directly into their default branch.

The PR template URL supports two variables which can be used to build a URL string.
The PR template URL supports two variables that can be used to build a URL string.
These variables, `{{source}}` and `{{destination}}` return branch names based on the
state of the configured Environment and active branch open in the IDE. The `{{source}}`
variable represents the active development branch, and the `{{destination}}` variable
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading