-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Auto-generating the CHANGELOG and Migration Guide #2761
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
Auto-generating the CHANGELOG and Migration Guide #2761
Conversation
|
from a users POV, is the idea we copy the template to a new file and that becomes our changelog entry? |
|
depending on what has to be done, I'm lazy enough to add a |
|
depending on what has to be done, I'm lazy enough to add a |
|
The idea is that we run
It would be a similar process for the migration guide, but that isn't in the |
|
Yeah, we would want to integrate it into the release process somehow. As is, it requires a So we would have to do |
5dcc127 to
f564ea4
Compare
|
Also, from a contributor's point of view, there would no longer be updates directly to This is the change that would help avoid the CHANGELOG.md merge conflicts that we see pretty often. Every time we have to resolve these conflicts requires another run of CI, so this would be a big time-saver for contributors and would help PRs merge faster. |
|
@joelanford today we have marker checking all of the docs including the CHANGELOG. Presumably with the fragments this might no longer work. Do we still need that type of functionality? Would that just be another part of the release? Or a longer running job that runs nightly and files github issues with broken links. I prefer this option honestly :) |
I thought about that too. I think as part of the sanity test in every PR, we would re-generate the CHANGELOG and migration guides without consuming the fragments and without committing the regenerated files, and then run marker after that. That way we can allow markdown in the fragments AND still test that the links are valid. |
changelog/generate.go
Outdated
| for _, e := range c.Entries { | ||
| if e.Migration != nil { | ||
| haveMigrations = true | ||
| bb.WriteString(fmt.Sprintf("### %s\n\n", e.Migration.Header)) | ||
| bb.WriteString(fmt.Sprintf("%s\n\n", strings.Trim(e.Migration.Body, "\n"))) | ||
| bb.WriteString(fmt.Sprintf("See %s for more details.\n\n", e.PullRequestLink())) | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to arrange these under headers based on kind like we do in the CHANGELOG? Or just flatten the migration entries out and list them one-by-one in the order they're read from the files.
On a separate but related note, do we want to do any sorting of CHANGELOG and migration guide entries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we do any sorting of the migration guide now? I've just always added stuff at the end anyway. Though we may want to consider putting the migration guide into version specific upgrade guides when we build, since I think it's starting to get a bit unwieldy. Might be out of scope although if we do want to go that way may be better to do it now than have to rework the tooling later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we do any sorting of the migration guide now?
No, but depending on how we name the fragment files, entries will show up semi-randomly, just based on a lexicographical sort of the filenames.
Though we may want to consider putting the migration guide into version specific upgrade guides when we build, since I think it's starting to get a bit unwieldy.
Yeah I had the same thought. Scrolling to the bottom of a very long migration guide is not the best UX. We could at least reverse the order so that new migration steps are always at the top.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, but if you're two or three versions behind then you need to go to the middle of the document somewhere to find your upgrade instructions, which I think is still just a worse experience than seeing migration_guide-v0.16.md or whatever naming scheme we'd use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with this change. And it actually makes the generation simpler since there's no need to deal with an existing file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migration guides will now be generated in a separate file for each release. In a follow-up, we can split the existing migration guide into separate files per release.
…ELOG and migration guide (operator-framework#2761)
aaaf7fd to
c4ad017
Compare
…ELOG and migration guide (operator-framework#2761)
e1f1122 to
844d0ff
Compare
…ELOG and migration guide (operator-framework#2761)
…nerate migration guide update
f2ce1c5 to
b39497c
Compare
estroz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits, otherwise LGTM.
estroz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
New changes are detected. LGTM label has been removed. |
jmrodri
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no additional comments from me. Looking forward to this.
|
/cherry-pick v0.17.x |
|
@joelanford: new pull request created: #2849 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
…ELOG and migration guide (operator-framework#2761)
Description of the change:
Add template, examples, and prototype generator program to auto-generate CHANGELOG and migration guide.
Motivation for the change:
Too often, we run into merge conflicts because multiple PRs are updating the CHANGELOG in the same area at the same time.
With this PR (or something like it), we would add separate fragment files for each PR that would be much less likely to conflict. Then we would generate the CHANGELOG and migration guide from these files.
Another benefit of this approach is that we can standardize formatting and policy (e.g. breaking changes require a migration guide section)
Tasks:
version.Versionends with "+git"?