Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing go-changelog for Vault #10363

Merged
merged 3 commits into from
Nov 16, 2020
Merged

Introducing go-changelog for Vault #10363

merged 3 commits into from
Nov 16, 2020

Conversation

mladlow
Copy link
Collaborator

@mladlow mladlow commented Nov 9, 2020

This PR contains templates and 1 example, see hashicorp/consul#8387 for more examples.

@@ -0,0 +1,3 @@
```release-note:bug
core: Fix client.Clone() to include the address
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that changelog entries are sort of "staged", and doesn't really appear on CHANGELOG.md until right before release, when changelog-build is ran?

Copy link
Collaborator Author

@mladlow mladlow Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's correct. I plan on adding an update to the "next" section of the changelog on every minor release so that periodic updates do show up there. I'll add this to the release procedure.

Copy link
Contributor

@kalafut kalafut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think most issues will only be revealed once we start using it, so I'm 👍 to begin. Seems very low risk to iterate on too.

@mladlow
Copy link
Collaborator Author

mladlow commented Nov 16, 2020

I generated a changelog with the following command, and it was identical to the current changelog "Next" section.
changelog-build -changelog-template changelog/changelog.tmpl -entries-dir changelog/ -last-release 3bc7d15e6b985cffa177ad7188df4c4e2e80d4db -note-template changelog/note.tmpl -this-release 86b980518746de16b9deb5f5969a31d00962272a

@mladlow mladlow merged commit 1d61999 into master Nov 16, 2020
@mladlow mladlow deleted the vlt-130-changelog branch November 16, 2020 19:05
mladlow added a commit that referenced this pull request Dec 11, 2020
mladlow added a commit that referenced this pull request Dec 11, 2020
mladlow added a commit that referenced this pull request Dec 11, 2020
mladlow added a commit that referenced this pull request Dec 11, 2020
notnoop pushed a commit to hashicorp/nomad that referenced this pull request Jul 6, 2021
Adopts [`go-changelog`](https://github.com/hashicorp/go-changelog) for managing Nomad's changelog. `go-changelog` is becoming the HashiCorp defacto standard tool for managing changelog, e.g. [Consul](hashicorp/consul#8387), [Vault](hashicorp/vault#10363), [Waypoint](hashicorp/waypoint#1179). [Consul](hashicorp/consul#8387) seems to be the first product to adopt it, and its PR has the most context - though I've updated `.changelog/README.md` with the relevant info here.

## Changes to developers workflow

When opening PRs, developers should add a changelog entry in `.changelog/<PR#>.txt`. Check [`.changelog/README.md`](https://github.com/hashicorp/nomad/blob/docs-adopt-gochangelog/.changelog/README.md#developer-guide). 

For the WIP release, entries can be amended even after the PR merged, and new files may be added post-hoc (e.g. during transition period, missed accidentally, community PRs, etc).

### Transitioning

Pending PRs can start including the changelog entry files immediately.

For 1.1.3/1.0.9 cycle, the release coordinator should create the entries for any PR that gets merged without a changelog entry file. They should also move any 1.1.3 entry in CHANGELOG.md to a changelog entry file, as this PR done for GH-10818.

## Changes to release process

Before cutting a release, release coordinator should update the changelog by inserting the output of `make changelog` to CHANGELOG.md with appropriate headers. See [`.changelog/README.md`](https://github.com/hashicorp/nomad/blob/docs-adopt-gochangelog/.changelog/README.md#how-to-generate-changelog-entries-for-release) for more details.


## Details

go-changelog is a basic templating engine for maintaining changelog in HashiCorp environment.

It expects the changelog entries as files indexed by their PR number. The CLI generates the changelog section for a release by comparing two git references (e.g. `HEAD` and the latest release, e.g. `v1.1.2`), and still requires manual process for updating CHANGELOG.md and final formatting.

The approach has many nice advantages:
* Avoids changelog related merge conflicts: Each PR touches different file!
* Copes with amendments and post-PR updates: Just add or update a changelog entry file using the original PR numbers.
* Addresses the release backporting scenario: Cherry-picking PRs will cherry-pick the relevant changelog entry automatically!
* Only relies on data available through `git` - no reliance on GitHub metadata or require GitHub credentials

The approach has few downsides though:
* CHANGELOG.md going stale during development and must be updated manually before cutting the release
  * Repository watchers can no longer glance at the CHANGELOG.md to see upcoming changes
  * We can periodically update the file, but `go-changelog` tool does not aid with that
* `go-changelog` tool does not offer good error reporting. If an entry is has an invalid tag (e.g. uses `release-note:bugfix` instead of `release-note:bug`), the entry will be dropped silently
  * We should update go-changelog to warn against unexpected entry tags
  * TODO: Meanwhile, PR reviewers and release coordinators should watch out

## Potential follow ups

We should follow up with CI checks to ensure PR changes include a warning. I've opted not to include that now. We still make many non-changelog-worth PRs for website/docs, for large features that get merged in multiple small PRs. I did not want to include a check that fails often.

Also, we should follow up to have `go-changelog` emit better warnings on unexpected tag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants