Skip to content

Commit

Permalink
[BACKPORT] #152 to 1.2.latest (#157)
Browse files Browse the repository at this point in the history
* init backport to 1.2.0 for #152

* add changelog

* no-issue fix

* changes on feedback
  • Loading branch information
McKnight-42 authored Aug 11, 2022
1 parent f82a9da commit ce93eae
Show file tree
Hide file tree
Showing 12 changed files with 217 additions and 83 deletions.
4 changes: 4 additions & 0 deletions .changes/0.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Previous Releases
For information on prior major and minor releases, see their changelogs:
- [1.1](https://github.com/dbt-labs/dbt-redshift/blob/1.1.latest/CHANGELOG.md)
- [1.0](https://github.com/dbt-labs/dbt-redshift/blob/1.0.latest/CHANGELOG.md)
12 changes: 12 additions & 0 deletions .changes/1.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## dbt-redshift 1.2.0 - July 26, 2022

### Features
- Add grants to materializations ([#128](https://github.com/dbt-labs/dbt-redshift/issues/128), [#131](https://github.com/dbt-labs/dbt-redshift/pull/131))


### Under the hood
- Lift + shift for cross-db macros ([#120](https://github.com/dbt-labs/dbt-redshift/pull/120))
- Remove duplicated parts of unit test ([#100](https://github.com/dbt-labs/dbt-redshift/pull/100))

### Contributors
- [@dbeatty10](https://github.com/dbeatty10) ([#120](https://github.com/dbt-labs/dbt-redshift/pull/120))
3 changes: 3 additions & 0 deletions .changes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# CHANGELOG

To view information about the changelog operation we suggest reading this [README](https://github.com/dbt-labs/dbt-redshift/blob/main/.changes/README.md) found in `dbt-redshift`.
6 changes: 6 additions & 0 deletions .changes/header.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# dbt-redshift Changelog

- This file provides a full account of all changes to `dbt-redshift`.
- Changes are listed under the (pre)release in which they first appear. Subsequent releases include changes from previous releases.
- "Breaking changes" listed under a version may require action from end users or external maintainers when upgrading to that version.
- Do not edit this file directly. This file is auto-generated using [changie](https://github.com/miniscruff/changie). For details on how to document a change, see [the contributing guide](https://github.com/dbt-labs/dbt-redshift/blob/main/CONTRIBUTING.md#adding-changelog-entry)
Empty file added .changes/unreleased/.gitkeep
Empty file.
7 changes: 7 additions & 0 deletions .changes/unreleased/Features-20220810-134336.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: Features
body: 'backport changie to 1.2.latest'
time: 2022-08-10T13:43:36.182465-05:00
custom:
Author: mcknight-42
Issue: "150"
PR: "157"
62 changes: 62 additions & 0 deletions .changie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
changesDir: .changes
unreleasedDir: unreleased
headerPath: header.tpl.md
versionHeaderPath: ""
changelogPath: CHANGELOG.md
versionExt: md
versionFormat: '## dbt-redshift {{.Version}} - {{.Time.Format "January 02, 2006"}}'
kindFormat: '### {{.Kind}}'
changeFormat: '- {{.Body}} ([#{{.Custom.Issue}}](https://github.com/dbt-labs/dbt-redshift/issues/{{.Custom.Issue}}), [#{{.Custom.PR}}](https://github.com/dbt-labs/dbt-redshift/pull/{{.Custom.PR}}))'
kinds:
- label: Breaking Changes
- label: Features
- label: Fixes
- label: Under the Hood
- label: Dependencies
changeFormat: '- {{.Body}} ({{if ne .Custom.Issue ""}}[#{{.Custom.Issue}}](https://github.com/dbt-labs/dbt-redshift/issues/{{.Custom.Issue}}), {{end}}[#{{.Custom.PR}}](https://github.com/dbt-labs/dbt-redshift/pull/{{.Custom.PR}}))'
- label: Security
changeFormat: '- {{.Body}} ({{if ne .Custom.Issue ""}}[#{{.Custom.Issue}}](https://github.com/dbt-labs/dbt-redshift/issues/{{.Custom.Issue}}), {{end}}[#{{.Custom.PR}}](https://github.com/dbt-labs/dbt-redshift/pull/{{.Custom.PR}}))'
custom:
- key: Author
label: GitHub Username(s) (separated by a single space if multiple)
type: string
minLength: 3
- key: Issue
label: GitHub Issue Number
type: int
minLength: 4
- key: PR
label: GitHub Pull Request Number
type: int
minLength: 4
footerFormat: |
{{- $contributorDict := dict }}
{{- /* any names added to this list should be all lowercase for later matching purposes */}}
{{- $core_team := list "emmyoop" "nathaniel-may" "gshank" "leahwicz" "chenyulinx" "stu-k" "iknox-fa" "versusfacit" "mcknight-42" "jtcohen6" "dependabot[bot]" "snyk-bot" }}
{{- range $change := .Changes }}
{{- $authorList := splitList " " $change.Custom.Author }}
{{- /* loop through all authors for a PR */}}
{{- range $author := $authorList }}
{{- $authorLower := lower $author }}
{{- /* we only want to include non-core team contributors */}}
{{- if not (has $authorLower $core_team)}}
{{- $pr := $change.Custom.PR }}
{{- /* check if this contributor has other PRs associated with them already */}}
{{- if hasKey $contributorDict $author }}
{{- $prList := get $contributorDict $author }}
{{- $prList = append $prList $pr }}
{{- $contributorDict := set $contributorDict $author $prList }}
{{- else }}
{{- $prList := list $change.Custom.PR }}
{{- $contributorDict := set $contributorDict $author $prList }}
{{- end }}
{{- end}}
{{- end}}
{{- end }}
{{- /* no indentation here for formatting so the final markdown doesn't have unneeded indentations */}}
{{- if $contributorDict}}
### Contributors
{{- range $k,$v := $contributorDict }}
- [@{{$k}}](https://github.com/{{$k}}) ({{ range $index, $element := $v }}{{if $index}}, {{end}}[#{{$element}}](https://github.com/dbt-labs/dbt-redshift/pull/{{$element}}){{end}})
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ resolves #
- [ ] I have signed the [CLA](https://docs.getdbt.com/docs/contributor-license-agreements)
- [ ] I have run this code in development and it appears to resolve the stated issue
- [ ] This PR includes tests, or tests are not required/relevant for this PR
- [ ] I have updated the `CHANGELOG.md` and added information about my change to the "dbt-redshift next" section.
- [ ] I have run `changie new` to [create a changelog entry](https://github.com/dbt-labs/dbt-redshift/blob/main/CONTRIBUTING.md#Adding-CHANGELOG-Entry)
61 changes: 61 additions & 0 deletions .github/workflows/bot-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# **what?**
# When bots create a PR, this action will add a corresponding changie yaml file to that
# PR when a specific label is added.
#
# The file is created off a template:
#
# kind: <per action matrix>
# body: <PR title>
# time: <current timestamp>
# custom:
# Author: <PR User Login (generally the bot)>
# Issue: 4904
# PR: <PR number>
#
# **why?**
# Automate changelog generation for more visability with automated bot PRs.
#
# **when?**
# Once a PR is created, label should be added to PR before or after creation. You can also
# manually trigger this by adding the appropriate label at any time.
#
# **how to add another bot?**
# Add the label and changie kind to the include matrix. That's it!
#

name: Bot Changelog

on:
pull_request:
# catch when the PR is opened with the label or when the label is added
types: [opened, labeled]

permissions:
contents: write
pull-requests: read

jobs:
generate_changelog:
strategy:
matrix:
include:
- label: "dependencies"
changie_kind: "Dependency"
- label: "snyk"
changie_kind: "Security"
runs-on: ubuntu-latest

steps:

- name: Create and commit changelog on bot PR
if: "contains(github.event.pull_request.labels.*.name, ${{ matrix.label }})"
id: bot_changelog
uses: emmyoop/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.FISHTOWN_BOT_PAT }}
commit_author_name: "Github Build Bot"
commit_author_email: "<[email protected]>"
commit_message: "Add automated changelog yaml from template for bot PR"
changie_kind: ${{ matrix.changie_kind }}
label: ${{ matrix.label }}
custom_changelog_string: "custom:\n Author: ${{ github.event.pull_request.user.login }}\n Issue: 150\n PR: ${{ github.event.pull_request.number }}\n"
41 changes: 41 additions & 0 deletions .github/workflows/changelog-existence.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# **what?**
# Checks that a file has been committed under the /.changes directory
# as a new CHANGELOG entry. Cannot check for a specific filename as
# it is dynamically generated by change type and timestamp.
# This workflow should not require any secrets since it runs for PRs
# from forked repos.
# By default, secrets are not passed to workflows running from
# a forked repo.

# **why?**
# Ensure code change gets reflected in the CHANGELOG.

# **when?**
# This will run for all PRs going into main and *.latest. It will
# run when they are opened, reopened, when any label is added or removed
# and when new code is pushed to the branch. The action will then get
# skipped if the 'Skip Changelog' label is present is any of the labels.

name: Check Changelog Entry

on:
pull_request:
types: [opened, reopened, labeled, unlabeled, synchronize]
workflow_dispatch:

defaults:
run:
shell: bash

permissions:
contents: read
pull-requests: write


jobs:
changelog:
uses: dbt-labs/actions/.github/workflows/changelog-existence.yml@main
with:
changelog_comment: 'Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the [dbt-redshift contributing guide](https://github.com/dbt-labs/dbt-redshift/blob/main/CONTRIBUTING.MD).'
skip_label: 'Skip Changelog'
secrets: inherit # this is only acceptable because we own the action we're calling
93 changes: 11 additions & 82 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,94 +1,23 @@
## dbt-redshift 1.2.0 (July 26, 2022)
# dbt-redshift Changelog

## dbt-redshift 1.2.0rc1 (July 12, 2022)
- This file provides a full account of all changes to `dbt-redshift`.
- Changes are listed under the (pre)release in which they first appear. Subsequent releases include changes from previous releases.
- "Breaking changes" listed under a version may require action from end users or external maintainers when upgrading to that version.
- Do not edit this file directly. This file is auto-generated using [changie](https://github.com/miniscruff/changie). For details on how to document a change, see [the contributing guide](https://github.com/dbt-labs/dbt-redshift/blob/main/CONTRIBUTING.md#adding-changelog-entry)

## dbt-redshift 1.2.0 - July 26, 2022

### Features
- Add grants to materializations ([#128](https://github.com/dbt-labs/dbt-redshift/issues/128), [#131](https://github.com/dbt-labs/dbt-redshift/pull/131))

## dbt-redshift 1.2.0b1 (June 24, 2022)

### Under the hood
- Lift + shift for cross-db macros ([#120](https://github.com/dbt-labs/dbt-redshift/pull/120))
- Remove duplicated parts of unit test ([#100](https://github.com/dbt-labs/dbt-redshift/pull/100))

### Contributors
- [@dbeatty10](https://github.com/dbeatty10) ([#120](https://github.com/dbt-labs/dbt-redshift/pull/120))

## dbt-redshift 1.1.0 (April 28, 2022)

### Under the hood
- Add precommits for this repo ([#72](https://github.com/dbt-labs/dbt-redshift/issues/72), [#106](https://github.com/dbt-labs/dbt-redshift/pull/106))

## dbt-redshift 1.0.1 (April 19, 2022)

### Fixes
- Fix table creation statement ordering when including both the BACKUP parameter as well as the dist/sort keys ([#60](https://github.com/dbt-labs/dbt-redshift/issues/60), [#63](https://github.com/dbt-labs/dbt-redshift/pull/63))

### Under the hood
- Install compatible branch of dbt-core in unit/integration tests based on merge target ([#80](https://github.com/dbt-labs/dbt-redshift/pull/80))
- Fix test related to preventing coercion of boolean values (True,False) to numeric values (0,1) in query results ([#58](https://github.com/dbt-labs/dbt-redshift/pull/58))

### Contributors
- [@SMeltser](https://github.com/SMeltser) ([#63](https://github.com/dbt-labs/dbt-redshift/pull/63))

## dbt-redshift 1.1.0rc1 (April 13, 2022)

### Under the hood
- Use dbt.tests.adapter.basic in test suite ([#78](https://github.com/dbt-labs/dbt-redshift/issues/78), [#81](https://github.com/dbt-labs/dbt-redshift/pull/81))

## dbt-redshift 1.0.1rc1 (April 6, 2022)

### Fixes
- Fix table creation statement ordering when including both the BACKUP parameter as well as the dist/sort keys ([#60](https://github.com/dbt-labs/dbt-redshift/issues/60), [#63](https://github.com/dbt-labs/dbt-redshift/pull/63))

### Under the hood
- Install compatible branch of dbt-core in unit/integration tests based on merge target ([#80](https://github.com/dbt-labs/dbt-redshift/pull/80))
- Fix test related to preventing coercion of boolean values (True,False) to numeric values (0,1) in query results ([#58](https://github.com/dbt-labs/dbt-redshift/pull/58))

### Contributors
- [@SMeltser](https://github.com/SMeltser) ([#63](https://github.com/dbt-labs/dbt-redshift/pull/63))

## dbt-redshift 1.1.0b1 (March 23, 2022)

### Fixes
- Fix test related to preventing coercion of boolean values (True,False) to numeric values (0,1) in query results ([#58](https://github.com/dbt-labs/dbt-redshift/pull/58))
- Fix table creation statement ordering when including both the BACKUP parameter as well as the dist/sort keys ([#23](https://github.com/dbt-labs/dbt-redshift/issues/60)),([#63](https://github.com/dbt-labs/dbt-redshift/pull/63))
- Add unique\_id field to docs generation test catalogs; a follow-on PR to core PR ([#4168](https://github.com/dbt-labs/dbt-core/pull/4618)) and core PR ([#4701](https://github.com/dbt-labs/dbt-core/pull/4701))

### Under the hood
- Removes unused installs of dbt-core outside of tox env as it clutters up gha and can lead to misunderstanding of which version of dbt-core is being installed.([#90](https://github.com/dbt-labs/dbt-redshift/pull/90))
- Add stale pr/issue github action ([#65](https://github.com/dbt-labs/dbt-redshift/pull/65))
- Add env example file ([#69](https://github.com/dbt-labs/dbt-redshift/pull/69))

### Contributors
- [@SMeltser](https://github.com/SMeltser)([#63](https://github.com/dbt-labs/dbt-redshift/pull/63))

## dbt-redshift 1.0.0 (December 3, 2021)

## dbt-redshift 1.0.0rc2 (November 24, 2021)

### Under the hood
- Add optional Redshift parameter to create tables with BACKUP NO set, to exclude them from snapshots. ([#18](https://github.com/dbt-labs/dbt-redshift/issues/18), [#42](https://github.com/dbt-labs/dbt-redshift/pull/42))

### Contributors
- [@dlb8685](https://github.com/dlb8685) ([#42](https://github.com/dbt-labs/dbt-redshift/pull/42))

## dbt-redshift 1.0.0rc1 (November 10, 2021)

### Under the hood
- Remove official support for python 3.6, which is reaching end of life on December 23, 2021 ([dbt-core#4134](https://github.com/dbt-labs/dbt-core/issues/4134), [#38](https://github.com/dbt-labs/dbt-redshift/pull/38))
- Add support for structured logging [#34](https://github.com/dbt-labs/dbt-redshift/pull/34)

## dbt-redshift v1.0.0b2 (October 25, 2021)

### Under the hood
- Replace `sample_profiles.yml` with `profile_template.yml`, for use with new `dbt init` ([#29](https://github.com/dbt-labs/dbt-redshift/pull/29))

### Contributors
- [@NiallRees](https://github.com/NiallRees) ([#29](https://github.com/dbt-labs/dbt-redshift/pull/29))

## dbt-redshift v1.0.0b1 (October 11, 2021)

### Under the hood

- Initial adapter split out
## Previous Releases
For information on prior major and minor releases, see their changelogs:
- [1.1](https://github.com/dbt-labs/dbt-redshift/blob/1.1.latest/CHANGELOG.md)
- [1.0](https://github.com/dbt-labs/dbt-redshift/blob/1.0.latest/CHANGELOG.md)
9 changes: 9 additions & 0 deletions CONTRIBUTING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ Many changes will require an update to the `dbt-redshift` docs. If so, here are
- The changes made are likely to impact one or both of [Redshift Profile](https://docs.getdbt.com/reference/warehouse-profiles/redshift-profile), or [Redshift Configs](https://docs.getdbt.com/reference/resource-configs/redshift-configs).
- We ask every community member who makes a user-facing change to open an issue or PR regarding doc changes.

## Adding CHANGELOG Entry

We use [changie](https://changie.dev) to generate `CHANGELOG` entries. **Note:** Do not edit the `CHANGELOG.md` directly. Your modifications will be lost.

Follow the steps to [install `changie`](https://changie.dev/guide/installation/) for your system.

Once changie is installed and your PR is created, simply run `changie new` and changie will walk you through the process of creating a changelog entry. Commit the file that's created and your changelog entry is complete!

You don't need to worry about which `dbt-redshift` version your change will go into. Just create the changelog entry with `changie`, and open your PR against the `main` branch. All merged changes will be included in the next minor version of `dbt-redshift`. The Core maintainers _may_ choose to "backport" specific changes in order to patch older minor versions. In that case, a maintainer will take care of that backport after merging your PR, before releasing the new version of `dbt-redshift`.


## Submitting a Pull Request
Expand Down

0 comments on commit ce93eae

Please sign in to comment.