Skip to content

Commit

Permalink
Update import-a-project-by-git-url.md (#5419)
Browse files Browse the repository at this point in the history
## What are you changing in this pull request and why?

Adding an optional step 5 under AWS CodeCommit. 
When customers (and myself) import CodeCommit repo via Git URL, the PR
URL field did not auto populate. As such in the IDE, we were prompted to
merge directly to primary branch. We needed to add the URL manually.

It is a common and good practice to open a PR for code changes to be
reviewed before merging them into default branch. Since importing via
Git URL for CodeCommit does not auto-populate the field, it would be
good if we can give a heads up to our customers about it.

## Checklist
<!--
Uncomment when publishing docs for a prerelease version of dbt:
- [ ] Add versioning components, as described in [Versioning
Docs](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-entire-pages)
- [ ] Add a note to the prerelease version [Migration
Guide](https://github.com/dbt-labs/docs.getdbt.com/tree/current/website/docs/docs/dbt-versions/core-upgrade)
-->
- [ ] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
- [ ] For [docs
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#about-versioning),
review how to [version a whole
page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
and [version a block of
content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content).
- [ ] Add a checklist item for anything that needs to happen before this
PR is merged, such as "needs technical review" or "change base branch."

Adding or removing pages (delete if not applicable):
- [ ] Add/remove page in `website/sidebars.js`
- [ ] Provide a unique filename for new pages
- [ ] Add an entry for deleted pages in `website/vercel.json`
- [ ] Run link testing locally with `npm run build` to update the links
that point to deleted pages
  • Loading branch information
mirnawong1 authored Jun 6, 2024
2 parents 9d5fed2 + cbcce90 commit 82cc6e8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
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.

0 comments on commit 82cc6e8

Please sign in to comment.