Skip to content

Commit

Permalink
[Internal] Improve Changelog by grouping changes (#3747)
Browse files Browse the repository at this point in the history
* [Internal] Improve Changelog by grouping changes

* Fixes
  • Loading branch information
hectorcast-db authored Jul 9, 2024
1 parent 77fc0b4 commit c16345e
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 14 deletions.
1 change: 1 addition & 0 deletions .codegen.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"formatter": "make fmt",
"changelog_config": ".codegen/changelog_config.yml",
"version": {
"common/version.go": "version = \"$VERSION\""
},
Expand Down
18 changes: 4 additions & 14 deletions .codegen/changelog.md.tmpl
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
# Version changelog

## {{.Version}}
{{- range .GroupChanges}}

### New Features and Improvements
{{range .Changes -}}
### {{.Type.Message}}
{{range .Changes}}
* {{.}}.
{{end}}

### Documentation Changes

### Exporter

### Internal Changes
{{if .DependencyUpdates}}
Dependency updates:
{{range .DependencyUpdates}}
* {{.}}.
{{- end -}}
{{- end}}
{{end}}

## {{.PrevVersion}}
15 changes: 15 additions & 0 deletions .codegen/changelog_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
change_types:
- message: New Features and Improvements
tag: "[Feature]"
- message: Bug Fixes
tag: "[Fix]"
- message: Documentation
tag: "[Doc]"
- message: Internal Changes
tag: "[Internal]"
- message: Dependency Updates
tag: "[Dependency]"
- message: Exporter
tag: "[Exporter]"
# Default for messages without a tag
- message: Other Changes
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ updates:
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "[Dependency] "
19 changes: 19 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,22 @@ jobs:
run: |
# Exit with status code 1 if there are differences (i.e. unformatted files)
git diff --exit-code
commit-message:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Validate Tag
run: |
TAG=$(echo ${{ github.event.pull_request.title }} | sed -ne 's/\[\(.*\)\].*/\1/p')
if grep -q "tag: \"[$TAG]\"" .codegen/changelog_config.yml; then
echo "Invalid or missing tag in commit message: [$TAG]"
exit 1
else
echo "Valid tag found: [$TAG]"
fi

0 comments on commit c16345e

Please sign in to comment.