Skip to content

Commit

Permalink
chore: assited changelog pre-generation, auto-label PR (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
heitorlessa authored May 28, 2021
1 parent 995c56e commit b2b3e42
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 20 deletions.
56 changes: 56 additions & 0 deletions .chglog/CHANGELOG.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{{ if .Versions -}}
<a name="unreleased"></a>
## [Unreleased]

{{ if .Unreleased.CommitGroups -}}
{{ range .Unreleased.CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ upperFirst .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}

{{- if .RevertCommits -}}
### Reverts
{{ range .RevertCommits -}}
- {{ .Revert.Header }}
{{ end }}
{{ end -}}

{{- if .MergeCommits -}}
### Pull Requests
{{ range .MergeCommits -}}
- {{ .Header }}
{{ end }}
{{ end -}}

{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

{{- if .Versions }}
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
{{ range .Versions -}}
{{ if .Tag.Previous -}}
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
{{ end -}}
{{ end -}}
{{ end -}}
32 changes: 32 additions & 0 deletions .chglog/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/awslabs/aws-lambda-powertools-python
options:
commits:
filters:
Type:
- feat
- fix
- perf
- refactor
- docs
- chore
commit_groups:
title_maps:
feat: Features
fix: Bug Fixes
perf: Performance Improvements
refactor: Code Refactoring
docs: Documentation
chore: Project maintenance
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE
10 changes: 0 additions & 10 deletions .github/auto-label.json

This file was deleted.

49 changes: 40 additions & 9 deletions .github/boring-cyborg.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,52 @@
##### Labeler ##########################################################################################################
labelPRBasedOnFilePath:
area/utilities:
- aws_lambda_powertools/utilities/*
- aws_lambda_powertools/utilities/**/*
- aws_lambda_powertools_python/middleware_factory/*
- aws_lambda_powertools_python/middleware_factory/**/*
area/logger:
- aws_lambda_powertools_python/logging/*
- aws_lambda_powertools_python/logging/**/*
- aws_lambda_powertools_python/package_logger.py
area/tracer:
- aws_lambda_powertools_python/tracing/*
- aws_lambda_powertools_python/tracing/**/*
area/metrics:
- aws_lambda_powertools_python/metrics/*
- aws_lambda_powertools_python/metrics/**/*
area/event_handlers:
- aws_lambda_powertools_python/event_handler/*
- aws_lambda_powertools_python/event_handler/**/*

# Add 'label2' to any file changes within 'example2' folder
documentation:
- docs/*
- docs/**/*
- mkdocs.yml

# # Complex: Add 'area/core' label to any change within the 'core' package
# area/core:
# - src/core/*
# - src/core/**/*
#
# # Add 'test' label to any change to *.spec.js files within the source dir
# test:
# - src/**/*.spec.js
internal:
- .github/*
- .github/**/*
- .chglog/*
- .flake8
- .gitignore
- .pre-commit-config.yaml
- Makefile
- CONTRIBUTING.md
- CODE_OF_CONDUCT.md
- LICENSE
- aws_lambda_powertools_python/shared/*
- aws_lambda_powertools_python/shared/**

dependencies:
- pyproject.toml
- poetry.lock

tests:
- tests/*
- tests/**/*
- benchmark/*
- benchmark/**/*

##### Greetings ########################################################################################################
firstPRWelcomeComment: >
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Publish to PyPi
#
# === Manual activities ===
#
# 1. Document human readable changes in CHANGELOG
# 1. Document human readable changes in CHANGELOG (pre-generate unreleased changes with `make changelog`)
# 2. Bump package version using poetry version <major|minor|patch|specific version>
# 3. Merge version changes to develop branch
# 4. Edit the current draft release notes
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ test_report
wheelhouse
/.idea/*
*.html
TMP_CHANGELOG.md

# Docs files
docs/.cache/
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,7 @@ release: pr
poetry build
$(MAKE) release-test
$(MAKE) release-prod

changelog:
@echo "[+] Pre-generating CHANGELOG for tag: $$(git describe --abbrev=0 --tag)"
docker run -v ${PWD}:/workdir quay.io/git-chglog/git-chglog $$(git describe --abbrev=0 --tag).. -o TMP_CHANGELOG.md

0 comments on commit b2b3e42

Please sign in to comment.