Skip to content

When a new release is made, bump the CHANGELOG version in the next release branch and the originating release branch #40

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

Merged
merged 9 commits into from
Aug 12, 2020

Conversation

weierophinney
Copy link
Member

Q A
New Feature yes
RFC #33
BC Break ?

This patch adds a new interface, BumpAndCommitChangelogVersion, which describes classes that can update a changelog file to add a new version, and then commit and push the changes. I have included one implementation, BumpAndCommitChangelogVersionViaKeepAChangelog which uses utilities from phly/keep-a-changelog, as well as internal utilities, to do this.

I have added BumpAndCommitChangelogVersion as a dependency on SwitchDefaultBranchToNextMinor. The functionality is invoked only if a new release branch is made, and then immediately following that operation. At that time, the changelog is updated with a stub for the next minor version.

I have created a new command, laminas:releases:bump-changelog, implemented by BumpChangelogForReleaseBranch, which determines the release version and release branch, and uses those to call the composed BumpAndCommitChangelogVersion, this time bumping the changelog to the next patch version on the originating release branch.

Finally, I updated the sample workflow to call laminas:releases:bump-changelog as the final action in the workflow. This approach guarantees that the newly-created vNEXT release branch does NOT contain a stub for the next patch release; only the originating branch will.

Fixes #33

… version entries

This patch introduces the interface `BumpAndCommitChangelogVersion`,
describing an operation where a new changelog entry is injected into the
changelog file, if it exists; the new version is determined by the first
argument passed, which must be one of a set of known constant values
describing patch and minor release bumps.

This patch also introduces the `CheckoutBranch` interface, describing
how to checkout a specific branch of a repository. It has one
implementation, `CheckoutBranchViaConsole`.

The new class `BumpAndCommitChangelogVersionViaKeepAChangelog` composes
a `CheckoutBranch` instance, as well as `CommitFile`, `Push`, and
`LoggerInterface` instances, to assist in the work of updating the
changelog. If no changelog is detected in the branch, no work is done.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
…ts, bump the changelog file to the next minor release, commit, and push.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
Command determines the name of the release from the closed milestone,
and uses it to bump the changelog version, commit, and push back to the
associated release branch.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
…ion of other actions

By doing this as a separate command, we can delay adding the patch-level
changelog stub to the originating release branch until **after** we have
created the next release branch.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
…Type` argument

Can use `{class}::TYPE_*` annotations instead of declaring an additional
constant.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
- Details new laminas:automatic-releases:bump-changelog command
- Details changes to "switch default branch to next minor" command

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
@weierophinney
Copy link
Member Author

@Ocramius I've pushed changes addressing the feedback!

Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

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

Excellent, thanks @weierophinney!

@Ocramius Ocramius self-assigned this Aug 12, 2020
@Ocramius Ocramius merged commit 6e9cab0 into laminas:1.2.x Aug 12, 2020
@Ocramius Ocramius changed the title When a new release is made, bump the CHANGELOG version in the next release branch and the originating release branch When a new release is made, bump the CHANGELOG version in the next release branch and the originating release branch Aug 12, 2020
@weierophinney weierophinney deleted the feature/33-bump-changelog branch August 12, 2020 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Whenever a CHANGELOG.md release date is set, also create a new "next release" block with the TBD in the date
2 participants