From f3af01f1c6dce9c222f15dfc097501ec81628470 Mon Sep 17 00:00:00 2001 From: Leah Antkiewicz Date: Tue, 23 Jul 2024 21:22:37 -0400 Subject: [PATCH 1/3] Updating changie.yaml to match Snowflake repo --- .../Under the Hood-20240723-212751.yaml | 6 ++ .changie.yaml | 92 +++++++++++++++---- 2 files changed, 80 insertions(+), 18 deletions(-) create mode 100644 .changes/unreleased/Under the Hood-20240723-212751.yaml diff --git a/.changes/unreleased/Under the Hood-20240723-212751.yaml b/.changes/unreleased/Under the Hood-20240723-212751.yaml new file mode 100644 index 00000000..d029a0d8 --- /dev/null +++ b/.changes/unreleased/Under the Hood-20240723-212751.yaml @@ -0,0 +1,6 @@ +kind: Under the Hood +body: Update changie config to match other repos +time: 2024-07-23T21:27:51.356365-04:00 +custom: + Author: leahwicz + Issue: "219" diff --git a/.changie.yaml b/.changie.yaml index 1198cfe0..e303e315 100644 --- a/.changie.yaml +++ b/.changie.yaml @@ -4,7 +4,7 @@ headerPath: header.tpl.md versionHeaderPath: "" changelogPath: CHANGELOG.md versionExt: md -envPrefix: CHANGIE_ +envPrefix: "CHANGIE_" versionFormat: '## dbt-adapters {{.Version}} - {{.Time.Format "January 02, 2006"}}' kindFormat: '### {{.Kind}}' changeFormat: |- @@ -15,11 +15,11 @@ changeFormat: |- {{- $IssueList = append $IssueList $changeLink }} {{- end -}} - {{.Body}} ({{ range $index, $element := $IssueList }}{{if $index}}, {{end}}{{$element}}{{end}}) + kinds: - label: Breaking Changes - label: Features - label: Fixes -- label: Docs - label: Under the Hood - label: Dependencies changeFormat: |- @@ -32,14 +32,14 @@ kinds: - {{.Body}} ({{ range $index, $element := $PRList }}{{if $index}}, {{end}}{{$element}}{{end}}) skipGlobalChoices: true additionalChoices: - - key: Author - label: GitHub Username(s) (separated by a single space if multiple) - type: string - minLength: 3 - - key: PR - label: GitHub Pull Request Number (separated by a single space if multiple) - type: string - minLength: 1 + - key: Author + label: GitHub Username(s) (separated by a single space if multiple) + type: string + minLength: 3 + - key: PR + label: GitHub Pull Request Number (separated by a single space if multiple) + type: string + minLength: 1 - label: Security changeFormat: |- {{- $PRList := list }} @@ -51,20 +51,22 @@ kinds: - {{.Body}} ({{ range $index, $element := $PRList }}{{if $index}}, {{end}}{{$element}}{{end}}) skipGlobalChoices: true additionalChoices: - - key: Author - label: GitHub Username(s) (separated by a single space if multiple) - type: string - minLength: 3 - - key: PR - label: GitHub Pull Request Number (separated by a single space if multiple) - type: string - minLength: 1 + - key: Author + label: GitHub Username(s) (separated by a single space if multiple) + type: string + minLength: 3 + - key: PR + label: GitHub Pull Request Number (separated by a single space if multiple) + type: string + minLength: 1 + newlines: afterChangelogHeader: 1 afterKind: 1 afterChangelogVersion: 1 beforeKind: 1 endOfVersion: 1 + custom: - key: Author label: GitHub Username(s) (separated by a single space if multiple) @@ -74,3 +76,57 @@ custom: label: GitHub Issue Number (separated by a single space if multiple) type: string minLength: 1 + + +footerFormat: | + {{- $contributorDict := dict }} + {{- /* ensure all names in this list are all lowercase for later matching purposes */}} + {{- $core_team := splitList " " .Env.CORE_TEAM }} + {{- /* ensure we always skip snyk and dependabot in addition to the core team */}} + {{- $maintainers := list "dependabot[bot]" "snyk-bot"}} + {{- range $team_member := $core_team }} + {{- $team_member_lower := lower $team_member }} + {{- $maintainers = append $maintainers $team_member_lower }} + {{- end }} + {{- range $change := .Changes }} + {{- $authorList := splitList " " $change.Custom.Author }} + {{- /* loop through all authors for a single changelog */}} + {{- range $author := $authorList }} + {{- $authorLower := lower $author }} + {{- /* we only want to include non-core team contributors */}} + {{- if not (has $authorLower $maintainers)}} + {{- $changeList := splitList " " $change.Custom.Author }} + {{- $IssueList := list }} + {{- $changeLink := $change.Kind }} + {{- if or (eq $change.Kind "Dependencies") (eq $change.Kind "Security") }} + {{- $changes := splitList " " $change.Custom.PR }} + {{- range $issueNbr := $changes }} + {{- $changeLink := "[#nbr](https://github.com/dbt-labs/dbt-adapters/pull/nbr)" | replace "nbr" $issueNbr }} + {{- $IssueList = append $IssueList $changeLink }} + {{- end -}} + {{- else }} + {{- $changes := splitList " " $change.Custom.Issue }} + {{- range $issueNbr := $changes }} + {{- $changeLink := "[#nbr](https://github.com/dbt-labs/dbt-adapters/issues/nbr)" | replace "nbr" $issueNbr }} + {{- $IssueList = append $IssueList $changeLink }} + {{- end -}} + {{- end }} + {{- /* check if this contributor has other changes associated with them already */}} + {{- if hasKey $contributorDict $author }} + {{- $contributionList := get $contributorDict $author }} + {{- $contributionList = concat $contributionList $IssueList }} + {{- $contributorDict := set $contributorDict $author $contributionList }} + {{- else }} + {{- $contributionList := $IssueList }} + {{- $contributorDict := set $contributorDict $author $contributionList }} + {{- 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}}{{end}}) + {{- end }} + {{- end }} \ No newline at end of file From 96a883ffc8de45663c29163abf84a6fd90c43840 Mon Sep 17 00:00:00 2001 From: Leah Antkiewicz Date: Thu, 1 Aug 2024 22:08:31 -0400 Subject: [PATCH 2/3] Adding changie file --- .changes/unreleased/Under the Hood-20240801-220551.yaml | 6 ++++++ .changie.yaml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Under the Hood-20240801-220551.yaml diff --git a/.changes/unreleased/Under the Hood-20240801-220551.yaml b/.changes/unreleased/Under the Hood-20240801-220551.yaml new file mode 100644 index 00000000..25b54a65 --- /dev/null +++ b/.changes/unreleased/Under the Hood-20240801-220551.yaml @@ -0,0 +1,6 @@ +kind: Under the Hood +body: Updating changie.yaml to add contributors and PR links +time: 2024-08-01T22:05:51.327652-04:00 +custom: + Author: leahwicz + Issue: "219" diff --git a/.changie.yaml b/.changie.yaml index e303e315..8f1d8615 100644 --- a/.changie.yaml +++ b/.changie.yaml @@ -129,4 +129,4 @@ footerFormat: | {{- range $k,$v := $contributorDict }} - [@{{$k}}](https://github.com/{{$k}}) ({{ range $index, $element := $v }}{{if $index}}, {{end}}{{$element}}{{end}}) {{- end }} - {{- end }} \ No newline at end of file + {{- end }} From 6cefd59dd69753bff1c1ef3a2b39be326203f0f4 Mon Sep 17 00:00:00 2001 From: Leah Antkiewicz Date: Thu, 1 Aug 2024 22:10:34 -0400 Subject: [PATCH 3/3] Remove duplicate changie file --- .changes/unreleased/Under the Hood-20240723-212751.yaml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .changes/unreleased/Under the Hood-20240723-212751.yaml diff --git a/.changes/unreleased/Under the Hood-20240723-212751.yaml b/.changes/unreleased/Under the Hood-20240723-212751.yaml deleted file mode 100644 index d029a0d8..00000000 --- a/.changes/unreleased/Under the Hood-20240723-212751.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kind: Under the Hood -body: Update changie config to match other repos -time: 2024-07-23T21:27:51.356365-04:00 -custom: - Author: leahwicz - Issue: "219"