Skip to content

Commit

Permalink
update the contributing guide to reference the branch migration script
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Jan 13, 2025
1 parent 1089d56 commit de3ec9a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,19 @@ The same process is followed whether the contributor is external or another `dbt
Once all tests are passing and the PR has been approved by the appropriate code owners,
a `dbt-adapters` maintainer will merge the changes into `main`.

### Migrating an existing pull request into the monorepo

You may have opened your pull request against an adapter prior to its migration into the monorepo.
In that case, you'll need to migrate that pull request into this repo.
Unfortunately, GitHub does not allow you to migrate a pull request; however, you can migrate your branch.
Here are the steps to do that:

1. Fork this repository if you haven't already and pull it down locally
2. Run the script `./scripts/migrate-branch.sh` (replacing the args with your versions):
```shell
source ./scripts/migrate-branch.sh dbt-labs dbt-postgres my-cool-feature-branch
```
3. Push your new feature branch back up to your fork of this repository
4. Open up a new pull request into `dbt-adapters` from your fork

And that's it! Happy developing :tada:
6 changes: 3 additions & 3 deletions scripts/migrate-branch.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 1. Run this script to migrate your feature branch from an adapter repo/fork to the dbt-adapters repo/fork, e.g.:
# $> source ./scripts/migrate-branch.sh dbt-labs dbt-postgres my-cool-feature-branch
# > source ./scripts/migrate-branch.sh dbt-labs dbt-postgres my-cool-feature-branch
# 2. Resolve any conflicts resulting from the rebase and re-run.
# 3. Push the resulting branch back up to the dbt-adapters repo/fork, e.g.:
# $> git push origin dbt-postgres/my-cool-feature-branch
# > git push origin dbt-postgres/my-cool-feature-branch
# 4. Once everything migrates successfully, remove the remote, e.g.:
# $> git remote remove adapter
# > git remote remove adapter

user=$1 # your github user (e.g. dbt-labs)
repo=$2 # the repo name (e.g. dbt-postgres)
Expand Down

0 comments on commit de3ec9a

Please sign in to comment.