Skip to content

Commit b2b3e42

Browse files
authored
chore: assited changelog pre-generation, auto-label PR (#443)
1 parent 995c56e commit b2b3e42

File tree

7 files changed

+134
-20
lines changed

7 files changed

+134
-20
lines changed

.chglog/CHANGELOG.tpl.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{{ if .Versions -}}
2+
<a name="unreleased"></a>
3+
## [Unreleased]
4+
5+
{{ if .Unreleased.CommitGroups -}}
6+
{{ range .Unreleased.CommitGroups -}}
7+
### {{ .Title }}
8+
{{ range .Commits -}}
9+
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
10+
{{ end }}
11+
{{ end -}}
12+
{{ end -}}
13+
{{ end -}}
14+
15+
{{ range .Versions }}
16+
<a name="{{ .Tag.Name }}"></a>
17+
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
18+
{{ range .CommitGroups -}}
19+
### {{ .Title }}
20+
{{ range .Commits -}}
21+
- {{ if .Scope }}**{{ upperFirst .Scope }}:** {{ end }}{{ .Subject }}
22+
{{ end }}
23+
{{ end -}}
24+
25+
{{- if .RevertCommits -}}
26+
### Reverts
27+
{{ range .RevertCommits -}}
28+
- {{ .Revert.Header }}
29+
{{ end }}
30+
{{ end -}}
31+
32+
{{- if .MergeCommits -}}
33+
### Pull Requests
34+
{{ range .MergeCommits -}}
35+
- {{ .Header }}
36+
{{ end }}
37+
{{ end -}}
38+
39+
{{- if .NoteGroups -}}
40+
{{ range .NoteGroups -}}
41+
### {{ .Title }}
42+
{{ range .Notes }}
43+
{{ .Body }}
44+
{{ end }}
45+
{{ end -}}
46+
{{ end -}}
47+
{{ end -}}
48+
49+
{{- if .Versions }}
50+
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
51+
{{ range .Versions -}}
52+
{{ if .Tag.Previous -}}
53+
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
54+
{{ end -}}
55+
{{ end -}}
56+
{{ end -}}

.chglog/config.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
style: github
2+
template: CHANGELOG.tpl.md
3+
info:
4+
title: CHANGELOG
5+
repository_url: https://github.com/awslabs/aws-lambda-powertools-python
6+
options:
7+
commits:
8+
filters:
9+
Type:
10+
- feat
11+
- fix
12+
- perf
13+
- refactor
14+
- docs
15+
- chore
16+
commit_groups:
17+
title_maps:
18+
feat: Features
19+
fix: Bug Fixes
20+
perf: Performance Improvements
21+
refactor: Code Refactoring
22+
docs: Documentation
23+
chore: Project maintenance
24+
header:
25+
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
26+
pattern_maps:
27+
- Type
28+
- Scope
29+
- Subject
30+
notes:
31+
keywords:
32+
- BREAKING CHANGE

.github/auto-label.json

-10
This file was deleted.

.github/boring-cyborg.yml

+40-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,52 @@
11
##### Labeler ##########################################################################################################
22
labelPRBasedOnFilePath:
33
area/utilities:
4+
- aws_lambda_powertools/utilities/*
45
- aws_lambda_powertools/utilities/**/*
6+
- aws_lambda_powertools_python/middleware_factory/*
7+
- aws_lambda_powertools_python/middleware_factory/**/*
8+
area/logger:
9+
- aws_lambda_powertools_python/logging/*
10+
- aws_lambda_powertools_python/logging/**/*
11+
- aws_lambda_powertools_python/package_logger.py
12+
area/tracer:
13+
- aws_lambda_powertools_python/tracing/*
14+
- aws_lambda_powertools_python/tracing/**/*
15+
area/metrics:
16+
- aws_lambda_powertools_python/metrics/*
17+
- aws_lambda_powertools_python/metrics/**/*
18+
area/event_handlers:
19+
- aws_lambda_powertools_python/event_handler/*
20+
- aws_lambda_powertools_python/event_handler/**/*
521

6-
# Add 'label2' to any file changes within 'example2' folder
722
documentation:
823
- docs/*
924
- docs/**/*
25+
- mkdocs.yml
1026

11-
# # Complex: Add 'area/core' label to any change within the 'core' package
12-
# area/core:
13-
# - src/core/*
14-
# - src/core/**/*
15-
#
16-
# # Add 'test' label to any change to *.spec.js files within the source dir
17-
# test:
18-
# - src/**/*.spec.js
27+
internal:
28+
- .github/*
29+
- .github/**/*
30+
- .chglog/*
31+
- .flake8
32+
- .gitignore
33+
- .pre-commit-config.yaml
34+
- Makefile
35+
- CONTRIBUTING.md
36+
- CODE_OF_CONDUCT.md
37+
- LICENSE
38+
- aws_lambda_powertools_python/shared/*
39+
- aws_lambda_powertools_python/shared/**
40+
41+
dependencies:
42+
- pyproject.toml
43+
- poetry.lock
44+
45+
tests:
46+
- tests/*
47+
- tests/**/*
48+
- benchmark/*
49+
- benchmark/**/*
1950

2051
##### Greetings ########################################################################################################
2152
firstPRWelcomeComment: >

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Publish to PyPi
44
#
55
# === Manual activities ===
66
#
7-
# 1. Document human readable changes in CHANGELOG
7+
# 1. Document human readable changes in CHANGELOG (pre-generate unreleased changes with `make changelog`)
88
# 2. Bump package version using poetry version <major|minor|patch|specific version>
99
# 3. Merge version changes to develop branch
1010
# 4. Edit the current draft release notes

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ test_report
295295
wheelhouse
296296
/.idea/*
297297
*.html
298+
TMP_CHANGELOG.md
298299

299300
# Docs files
300301
docs/.cache/

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,7 @@ release: pr
7979
poetry build
8080
$(MAKE) release-test
8181
$(MAKE) release-prod
82+
83+
changelog:
84+
@echo "[+] Pre-generating CHANGELOG for tag: $$(git describe --abbrev=0 --tag)"
85+
docker run -v ${PWD}:/workdir quay.io/git-chglog/git-chglog $$(git describe --abbrev=0 --tag).. -o TMP_CHANGELOG.md

0 commit comments

Comments
 (0)