From a902defd32b5dcb7d373e958e6e9322f784c4d0f Mon Sep 17 00:00:00 2001 From: maxim Date: Fri, 15 Oct 2021 17:16:18 +0600 Subject: [PATCH 1/6] doc: Add process of how to update changelog.md and create a new release --- .github/CONTRIBUTING.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index bff1403b..91ec9373 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -12,6 +12,7 @@ Please note we have a code of conduct, please follow it in all your interactions - [Pull Request Process](#pull-request-process) - [Checklists for contributions](#checklists-for-contributions) - [Semantic Pull Requests](#semantic-pull-requests) + - [Updating changelog](#updating-changelog) - [Coding conventions](#coding-conventions) - [Names and approaches used in code](#names-and-approaches-used-in-code) - [Base project name](#base-project-name) @@ -53,6 +54,38 @@ To generate changelog, Pull Requests or Commits must have semantic and must foll The `chore` prefix skipped during changelog generation. It can be used for `chore: update changelog` commit message by example. +## Updating changelog + +All changes had been made before version 1.0.0 described in **CHANGELOG.previous.md** file. Starting from that version our Pull Requests or Commits have semantic and follow conventional specs above. So, we decided to keep new changes in **CHANGELOG.md** file. + +**CHANGELOG.md** file should be updated after each change merged in the `main` branch. If there are several Pull Requests will be merged consistently, it's possible to update **CHANGELOG.md** once after merging all of them. + +How to generate CHANGELOG automatically: +1. Merge Pull Request using `Squash`. Your commit message must follow next rule: `doc: my commit message (#1)`, where + - `doc` - type of changes (see Semantic Pull Requests) + - `my commit message` - commit message + - `(#1)` - Pull Request number +2. Pull the latest changes from `main` branch +3. Create a tag with new version using the semver approach +```bash + git tag v1.10.0 +``` +4. Run next command: +```bash +git-chglog -o CHANGELOG.md v1.1.0..v1.10.0 +``` +This version `v1.1.0` must always be first. +5. Delete tag +``` +git tag -d v1.10.0 +``` +7. Create a new branch, commit and push your changes +8. Open Pull Request using prefix `chore:` +9. Merge Pull reques. Make sure your commit message starts with `chore:` +10. Create a new tag (v1.10.0) in Github UI +11. Create a new Release for new tag. + + ## Coding conventions This section contains the most basic recommendations for users and contributors on coding, naming, etc. The goal is consistent, standardized, readable code. Additions, suggestions and changes are welcome. From 93309de5ada2573443483d35757d22293efb154d Mon Sep 17 00:00:00 2001 From: maxim Date: Mon, 18 Oct 2021 11:06:56 +0600 Subject: [PATCH 2/6] doc: change changelog_template not to include v1.0.0. Fix documentation on how to update CHANGELOG.md. --- .chglog/CHANGELOG.tpl.md | 3 +++ .github/CONTRIBUTING.md | 37 ++++++++++++++++++++++--------------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md index 1af11b84..d9419a4f 100644 --- a/.chglog/CHANGELOG.tpl.md +++ b/.chglog/CHANGELOG.tpl.md @@ -36,6 +36,8 @@ project adheres to [Semantic Versioning](http://semver.org/). {{ end -}} {{ range .Versions }} +{{ if ne .Tag.Name "v1.0.0" }} + ## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }} {{ if .CommitGroups -}} @@ -64,6 +66,7 @@ project adheres to [Semantic Versioning](http://semver.org/). {{ end -}} {{ end -}} {{ end -}} +{{ end -}} {{- if .Versions }} [Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 91ec9373..dee73dcf 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -65,26 +65,33 @@ How to generate CHANGELOG automatically: - `doc` - type of changes (see Semantic Pull Requests) - `my commit message` - commit message - `(#1)` - Pull Request number -2. Pull the latest changes from `main` branch -3. Create a tag with new version using the semver approach +2. Rebase your local main branch on the latest changes from `main` branch +3. Run next command: ```bash - git tag v1.10.0 +git-chglog -o CHANGELOG.md --next-tag $(semtag final -s minor -o) ``` -4. Run next command: +4. Create a new branch, commit and push your changes +5. Open Pull Request using prefix `chore:` +6. Merge Pull request. Make sure your commit message looks like: `chore: Update CHANGELOG` +7. Create a new Release and create the new tag (you got it when ran `$(semtag final -s minor -o)`). Click `Auto-generate release notes` and edit message leaving only commit messages: ```bash -git-chglog -o CHANGELOG.md v1.1.0..v1.10.0 -``` -This version `v1.1.0` must always be first. -5. Delete tag -``` -git tag -d v1.10.0 +How it was: + +## What's Changed +* doc: Changelog process by @user_name in https://github.com/maddevsio/aws-eks-base/pull/#number +* chore: Update CHANGELOG by @user_name in https://github.com/maddevsio/aws-eks-base/pull/#number + + +**Full Changelog**: https://github.com/maddevsio/aws-eks-base/compare/previous_tag...new_tag ``` -7. Create a new branch, commit and push your changes -8. Open Pull Request using prefix `chore:` -9. Merge Pull reques. Make sure your commit message starts with `chore:` -10. Create a new tag (v1.10.0) in Github UI -11. Create a new Release for new tag. +```bash +How it should be: + +## What's Changed +* doc: Changelog process +* chore: Update CHANGELOG +``` ## Coding conventions From 268fe97121df08c182f1b2faa28cffef69011522 Mon Sep 17 00:00:00 2001 From: maxim Date: Mon, 18 Oct 2021 11:47:38 +0600 Subject: [PATCH 3/6] add utilities used to generate changelog --- .github/CONTRIBUTING.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index dee73dcf..27fbbad7 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -70,6 +70,12 @@ How to generate CHANGELOG automatically: ```bash git-chglog -o CHANGELOG.md --next-tag $(semtag final -s minor -o) ``` +where: +`minor` - is a type of changes related to the semver + +Utilities: +* [git-chlog](https://github.com/git-chglog/git-chglog) +* [semtag](https://github.com/nico2sh/semtag) 4. Create a new branch, commit and push your changes 5. Open Pull Request using prefix `chore:` 6. Merge Pull request. Make sure your commit message looks like: `chore: Update CHANGELOG` From 58dea39e178a7e52ebe501de7885725c3bb626c3 Mon Sep 17 00:00:00 2001 From: maxim Date: Mon, 18 Oct 2021 15:20:03 +0600 Subject: [PATCH 4/6] add notes on how to upgrade changelog --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 27fbbad7..691695c9 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -78,7 +78,7 @@ Utilities: * [semtag](https://github.com/nico2sh/semtag) 4. Create a new branch, commit and push your changes 5. Open Pull Request using prefix `chore:` -6. Merge Pull request. Make sure your commit message looks like: `chore: Update CHANGELOG` +6. Merge Pull request. Make sure your commit message looks like: `chore: Update CHANGELOG` and don't forget to clean `optional extended description` 7. Create a new Release and create the new tag (you got it when ran `$(semtag final -s minor -o)`). Click `Auto-generate release notes` and edit message leaving only commit messages: ```bash How it was: From 106b3ded8ada7487471fabdcdc30a34bcec2e3c0 Mon Sep 17 00:00:00 2001 From: maxim Date: Mon, 18 Oct 2021 16:23:31 +0600 Subject: [PATCH 5/6] doc: rename docs to doc for changes type. --- .chglog/config.yml | 6 +++--- .github/CONTRIBUTING.md | 2 +- .github/semantic.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.chglog/config.yml b/.chglog/config.yml index 9749bef4..0502208b 100644 --- a/.chglog/config.yml +++ b/.chglog/config.yml @@ -11,7 +11,7 @@ options: - feat - fix - improvement - - docs + - doc - refactor - test - ci @@ -24,14 +24,14 @@ options: - improvement - refactor - fix - - docs + - doc - test - ci title_maps: feat: FEATURES fix: BUG FIXES improvement: ENHANCEMENTS - docs: DOCS + doc: DOCS refactor: REFACTORS test: TESTS ci: CI diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 691695c9..7a177d18 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -46,7 +46,7 @@ To generate changelog, Pull Requests or Commits must have semantic and must foll - `feat:` for new features - `fix:` for bug fixes - `improvement:` for enhancements -- `docs:` for documentation and examples +- `doc:` for documentation and examples - `refactor:` for code refactoring - `test:` for tests - `ci:` for CI purpose diff --git a/.github/semantic.yml b/.github/semantic.yml index 376c06a6..8f5d0b1a 100644 --- a/.github/semantic.yml +++ b/.github/semantic.yml @@ -19,7 +19,7 @@ types: - feat - fix - improvement - - docs + - doc - refactor - test - ci From c7e4fd5cb9852f52cbe21a95ee45b1217f9d4ee0 Mon Sep 17 00:00:00 2001 From: maxim Date: Tue, 19 Oct 2021 09:46:14 +0600 Subject: [PATCH 6/6] Add new type of changes: enh. It is a duplicate for improvement --- .chglog/config.yml | 3 +++ .github/CONTRIBUTING.md | 1 + .github/semantic.yml | 1 + 3 files changed, 5 insertions(+) diff --git a/.chglog/config.yml b/.chglog/config.yml index 0502208b..642f416b 100644 --- a/.chglog/config.yml +++ b/.chglog/config.yml @@ -11,6 +11,7 @@ options: - feat - fix - improvement + - enh - doc - refactor - test @@ -22,6 +23,7 @@ options: title_order: - feat - improvement + - enh - refactor - fix - doc @@ -31,6 +33,7 @@ options: feat: FEATURES fix: BUG FIXES improvement: ENHANCEMENTS + enh: ENHANCEMENTS doc: DOCS refactor: REFACTORS test: TESTS diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 7a177d18..c9df4308 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -46,6 +46,7 @@ To generate changelog, Pull Requests or Commits must have semantic and must foll - `feat:` for new features - `fix:` for bug fixes - `improvement:` for enhancements +- `enh:` for enhancements - `doc:` for documentation and examples - `refactor:` for code refactoring - `test:` for tests diff --git a/.github/semantic.yml b/.github/semantic.yml index 8f5d0b1a..01388fe1 100644 --- a/.github/semantic.yml +++ b/.github/semantic.yml @@ -19,6 +19,7 @@ types: - feat - fix - improvement + - enh - doc - refactor - test