From f10b7f54550a36093a6cdf2172dd6a5a6aeb7232 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Fri, 12 Apr 2024 09:02:48 -0500 Subject: [PATCH] Fix changlogs, remove PR reference (#9887) * stop referencing PRs * convert PR to Issue in older yaml # Conflicts: # .changes/1.8.0/Dependencies-20231005-151848.yaml # .changes/1.8.0/Dependencies-20231031-131954.yaml # .changes/1.8.0/Dependencies-20231106-130051.yaml # .changes/1.8.0/Dependencies-20231122-001840.yaml # .changes/1.8.0/Dependencies-20231204-000945.yaml # .changes/1.8.0/Dependencies-20231211-005651.yaml # .changes/1.8.0/Dependencies-20240115-012030.yaml # .changes/1.8.0/Dependencies-20240123-105843.yaml # .changes/1.8.0/Dependencies-20240129-005734.yaml # .changes/1.8.0/Dependencies-20240129-005743.yaml # .changes/1.8.0/Dependencies-20240212-011324.yaml # .changes/1.8.0/Dependencies-20240222-102947.yaml # .changes/1.8.0/Dependencies-20240226-004412.yaml # .changes/1.8.0/Dependencies-20240226-123502.yaml # .changes/1.8.0/Dependencies-20240227-151115.yaml # .changes/1.8.0/Security-20240222-152445.yaml # .changes/unreleased/Dependencies-20240117-100818.yaml --- .changie.yaml | 52 +++-------------------------- .github/workflows/bot-changelog.yml | 2 +- 2 files changed, 5 insertions(+), 49 deletions(-) diff --git a/.changie.yaml b/.changie.yaml index ba0590da8d3..23e802f190d 100644 --- a/.changie.yaml +++ b/.changie.yaml @@ -31,43 +31,7 @@ kinds: - {{.Body}} ({{ range $index, $element := $IssueList }}{{if $index}}, {{end}}{{$element}}{{end}}) - label: Under the Hood - label: Dependencies - changeFormat: |- - {{- $PRList := list }} - {{- $changes := splitList " " $.Custom.PR }} - {{- range $pullrequest := $changes }} - {{- $changeLink := "[#nbr](https://github.com/dbt-labs/dbt-core/pull/nbr)" | replace "nbr" $pullrequest }} - {{- $PRList = append $PRList $changeLink }} - {{- end -}} - - {{.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 - label: Security - changeFormat: |- - {{- $PRList := list }} - {{- $changes := splitList " " $.Custom.PR }} - {{- range $pullrequest := $changes }} - {{- $changeLink := "[#nbr](https://github.com/dbt-labs/dbt-core/pull/nbr)" | replace "nbr" $pullrequest }} - {{- $PRList = append $PRList $changeLink }} - {{- end -}} - - {{.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 newlines: afterChangelogHeader: 1 @@ -106,18 +70,10 @@ footerFormat: | {{- $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-core/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-core/issues/nbr)" | replace "nbr" $issueNbr }} - {{- $IssueList = append $IssueList $changeLink }} - {{- end -}} + {{- $changes := splitList " " $change.Custom.Issue }} + {{- range $issueNbr := $changes }} + {{- $changeLink := "[#nbr](https://github.com/dbt-labs/dbt-core/issues/nbr)" | replace "nbr" $issueNbr }} + {{- $IssueList = append $IssueList $changeLink }} {{- end }} {{- /* check if this contributor has other changes associated with them already */}} {{- if hasKey $contributorDict $author }} diff --git a/.github/workflows/bot-changelog.yml b/.github/workflows/bot-changelog.yml index c6d2a1507a3..0550798802c 100644 --- a/.github/workflows/bot-changelog.yml +++ b/.github/workflows/bot-changelog.yml @@ -58,4 +58,4 @@ jobs: 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 PR: ${{ github.event.pull_request.number }}" + custom_changelog_string: "custom:\n Author: ${{ github.event.pull_request.user.login }}\n Issue: ${{ github.event.pull_request.number }}"