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 release flow #251

Merged
merged 2 commits into from
Jul 30, 2020
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
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/dbt_minor_release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: dbt Minor Release Follow-Up
about: A checklist of tasks to complete after a minor release is made to dbt
title: 'dbt Minor Release Follow up for dbt v0.x.0'
labels:
assignees: ''
---

<!---
This template is to be used once a new dbt minor release is available on pypi.
In the future, we will consider doing pre-releases.
-->

First, check if this is a breaking change
- [ ] Increase the upper bound of the `require-dbt-version` config in the `dbt_project.yml`
- [ ] Increase the upper bound of the dbt version in `run_test.sh`
- [ ] Create a PR against the `main` branch to see if tests pass

If test pass, this is _not_ a breaking change. You should:
- [ ] Merge into `main`
- [ ] Create a patch release

If tests fail, this _is_ a breaking change. You'll need to create a minor release:
- [ ] Change the PR base to be against the next `dev` branch.
- [ ] Increase the lower bound to the current dbt minor version in both the `dbt_project.yml` and `run_test.sh` files
- [ ] Fix any errors
- [ ] Merge `dev` into `main`
- [ ] Create a minor release
- [ ] Once the release is available on hub, [create a new issue](https://github.com/fishtown-analytics/dbt-utils/issues/new/choose) using the "dbt-utils Minor Release Checklist" template
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/utils_minor_release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: dbt-utils Minor Release Follow-up
about: A checklist of tasks to complete after making a dbt-utils minor release
title: 'dbt Minor Release Follow up for dbt-utils v0.x.0'
labels:
assignees: ''
---

<!---
This template is to be used once a new dbt-utils release is available on hub.
In the future, we will consider automating this.
-->

## Process for each dependent package
First, check if this is a breaking change
- [ ] Increase the upper bound of the `dbt-utils` `version:` config in the `packages.yml` of the dependent package, e.g.:
```yml
# packages.yml
packages:
- package: fishtown-analytics/dbt_utils
version: [">=0.4.0", "<0.6.0"]

```
- [ ] Push to a new branch to see if tests pass

If this is _not_ a breaking change:
- [ ] Create a patch release

If this _is_ a breaking change:
- [ ] Fix any breaking changes
- [ ] Increase the lower bound to the current dbt-utils minor version
- [ ] Create a minor release for the package

## Checklist of dependent packages
- [ ] [audit-helper](https://github.com/fishtown-analytics/dbt-audit-helper)
- [ ] [codegen](https://github.com/fishtown-analytics/dbt-codegen)
- [ ] [redshift](https://github.com/fishtown-analytics/redshift)
- [ ] [event-logging](https://github.com/fishtown-analytics/dbt-event-logging)
- [ ] [snowplow](https://github.com/fishtown-analytics/snowplow)
- [ ] [external-tables](https://github.com/fishtown-analytics/dbt-external-tables)
- [ ] [segment](https://github.com/fishtown-analytics/segment)
- [ ] [facebook-ads](https://github.com/fishtown-analytics/facebook-ads)
- [ ] [stitch-utils](https://github.com/fishtown-analytics/stitch-utils)
12 changes: 11 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
This is a:
- [ ] bug fix PR with no breaking changes (please change the base branch to `main`)
- [ ] new functionality
- [ ] a breaking change

## Description & motivation
<!---
Describe your changes, and why you're making them.
-->

## Checklist
- [ ] I have verified that these changes work locally
- [ ] I have verified that these changes work locally on the following warehouses (Note: it's okay if you do not have access to all warehouses, this helps us understand what has been covered)
- [ ] BigQuery
- [ ] Postgres
- [ ] Redshift
- [ ] Snowflake
- [ ] I have updated the README.md (if applicable)
- [ ] I have added tests & descriptions to my models (and macros if applicable)
- [ ] I have added an entry to the changelog
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## dbt-utils v0.6.0 (unreleased)

## Fixes

## Features

## Quality of life
* Improve release process (#251)
35 changes: 35 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# dbt-utils releases

## When do we release?
There's a few scenarios that might prompt a release:

| Scenario | Release type |
|--------------------------------------------|--------------|
| New functionality¹ | minor |
| Breaking changes to existing macros | minor |
| Fixes to existing macros | patch |
| dbt minor release with no breaking changes | patch |
| dbt minor release with breaking changes | minor |

¹New macros were previously considered patch releases — we have brought them up to minor releases to make versioning for dependencies clearer.

## Branching strategy

At any point, there should be two long-lived branches:
- `main`: This reflects the most recent release of dbt-utils
Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking, "Shouldn't this be dev/0.x-1.0 (currently dev/0.5.0)? But I think having a safe, clear, main branch to PR against for small fixes or README updates is going to be much more user-friendly.

- `dev/0.x.0`: This reflects the next minor release, where `x` will be replaced with the minor version number

The `dev/` branch should be merged into `main` branch when new minor releases are created.

## Process for minor releases
e.g. for releasing `0.6.0`
1. Create the PR to merge `dev/0.6.0` into `main`. Also update the `Changelog` as part of this PR, and merge it
2. Create the GitHub release
3. Delete the `dev/0.6.0` branch, and create a new branch `dev/0.7.0` from `main`, setting it as the default branch in GitHub.
4. [Create a new issue](https://github.com/fishtown-analytics/dbt-utils/issues/new/choose) from the "dbt-utils Minor Release Follow-Up" template to also update any dependencies

## Process for patch releases
1. Create the release
2. Then rebase the current `dev/` branch on top of the `main` branch so that any fixes will be included in the next minor release

No dependencies need to be updated for patch releases.
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'dbt_utils'
version: '0.1.0'

require-dbt-version: ">=0.17.0"
require-dbt-version: [">=0.17.0", "<0.18.0"]
config-version: 2

target-path: "target"
Expand Down
8 changes: 4 additions & 4 deletions integration_tests/ci/sample.profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ integration_tests:
host: "{{ env_var('POSTGRES_TEST_HOST') }}"
user: "{{ env_var('POSTGRES_TEST_USER') }}"
pass: "{{ env_var('POSTGRES_TEST_PASS') }}"
port: "{{ env_var('POSTGRES_TEST_PORT') }}"
port: "{{ env_var('POSTGRES_TEST_PORT') | as_number }}"
dbname: "{{ env_var('POSTGRES_TEST_DBNAME') }}"
schema: dbt_utils_integration_tests_postgres
threads: 1
Expand All @@ -25,7 +25,7 @@ integration_tests:
user: "{{ env_var('REDSHIFT_TEST_USER') }}"
pass: "{{ env_var('REDSHIFT_TEST_PASS') }}"
dbname: "{{ env_var('REDSHIFT_TEST_DBNAME') }}"
port: "{{ env_var('REDSHIFT_TEST_PORT') }}"
port: "{{ env_var('REDSHIFT_TEST_PORT') | as_number }}"
schema: dbt_utils_integration_tests_redshift
threads: 1

Expand All @@ -36,7 +36,7 @@ integration_tests:
project: "{{ env_var('BIGQUERY_TEST_DATABASE') }}"
schema: dbt_utils_integration_tests_bigquery
threads: 1

snowflake:
type: snowflake
account: "{{ env_var('SNOWFLAKE_TEST_ACCOUNT') }}"
Expand All @@ -46,4 +46,4 @@ integration_tests:
database: "{{ env_var('SNOWFLAKE_TEST_DATABASE') }}"
warehouse: "{{ env_var('SNOWFLAKE_TEST_WAREHOUSE') }}"
schema: dbt_utils_integration_tests_snowflake
threads: 1
threads: 1
2 changes: 1 addition & 1 deletion run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if [[ ! -f $VENV ]]; then
. $VENV

pip install --upgrade pip setuptools
pip install dbt
pip install "dbt>=0.17.0,<0.18.0"
clrcrl marked this conversation as resolved.
Show resolved Hide resolved
fi

. $VENV
Expand Down