codelog icon indicating copy to clipboard operation
codelog copied to clipboard

Add pending changelog for unreleased changes

Open joeyparis opened this issue 4 years ago • 4 comments

Objective

Solves #50. Adds the ability to generate a "pending changelog" of all unreleased changes. Our personal use case for this is so we can easily display a list of changes that should be tested but are not ready to be committed as a "release" yet.

Notes

Adds two new setting config options: default_pending_changelog_filename which defaults to CHANGELOG_PENDING.md default_pending_changelog_title which defaults to Pending Changes

I chose CHANGELOG_PENDING over PENDING_CHANGELOG so that CHANGELOG.md and CHANGELOG_PENDING.md are right next to each other in the file directory.

I'm not super happy with the naming conventions so I'm definitely open to suggestions about different names than just "pending".

How to test

Run rake for automated testing. To test manually run bundle exec bin/codelog pending while you have unreleased changes then check CHANGELOG_PENDING.md for a list of your unreleased changes.

Breaking changes

No breaking changes.

Checklist

  • [x] I have read the CONTRIBUTING document.
  • [x] I have created a Codelog changefile with the changes made to the branch.
  • [x] I have created a test proving that my feature/fix does what it intends to do.
  • [x] I have updated the documentation accordingly. (If needed)

joeyparis avatar Apr 07 '21 17:04 joeyparis

Hey @joeyparis,

First of all I would like to thank you for the time and effort you put creating these issues and PRs, your contributions are greatly appreciated!

Secondly, my first reaction upon seeing this PR was

doesn't release --preview and bump --preview already cover this use case?

Maybe you didn't know about this flag?

Assuming you did know about the flag:

  • Could you please elaborate as to why the flag is not sufficient?
  • Is there any reason you opted for creating a separate file (CHANGELOG_PENDING.md) instead of only adding a section at the top of CHANGELOG.md? I believe that adding a section in CHANGELOG.md is simpler and less "intrusive" than creating a whole separate file.

emilianoLeite avatar Apr 16 '21 13:04 emilianoLeite

Hey @emilianoLeite,

I did actually know about that flag which is what I used as an example for creating this pull request! The reason that flag is not sufficient for us is that it only works in the CLI, but the people at our company who it benefits the most have no CLI/programming experience.

Basically, our deployment process involves us deploying a bunch of changes to our staging environment where it is then tested. This pending changelog is what the testers use as a sort of checklist on what to test. The testers don't have access to any source code or CLI experience, so this is an easy way for them to know exactly what's included in this staging deployment without having to commit those changes to an actual release, as some may not pass testing.

I opted for creating a separate file because it made it easier to include the pending changelog on stage only and not production. That being said, from the perspective of just this ruby gem I agree that adding a section in CHANGELOG.md is the better solution. I'll go ahead and adjust this PR to instead add a section at the top of the changelog. I'll make it an optional flag though so the default behavior doesn't change.

joeyparis avatar Apr 16 '21 14:04 joeyparis

Okay, I believe I've adjusted the PR to work as requested.

There are also two minor unrelated changes included in this PR request. I added a test for the release preview flag, and additional regenerate tests to increase coverage to 100%, and fixed 2 Rubocop offenses for 100% rubocop satisfaction.

joeyparis avatar Apr 16 '21 15:04 joeyparis

I just wanted to check-in to see if we could get this merged into the official release! I've been using it locally now for a while and it's been very helpful. Thanks!

joeyparis avatar Oct 07 '21 14:10 joeyparis