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

Use imperative mood in changelog entry #131

Merged
merged 6 commits into from
Feb 24, 2023

Conversation

andrross
Copy link
Contributor

@andrross andrross commented Feb 9, 2023

Apologies in advance for being a pedant, but we in the OpenSearch project like to keep our changelog entries consistent and the dependabot changelog helper is an outlier here. Matching the style of the commit message from dependabot seems appropriate, but please feel free to let me know if you disagree :)


The imperative mood is generally recommended for git commit messages. Git uses it for things like "Revert ..." or "Merge ..." and dependabot uses it in the commit message. This changes the changelog helper to use the imperative mood for consistency.

The imperative mood is generally recommended for git commit messages.
Git uses it for things like "Revert ..." or "Merge ..." and dependabot
uses it in the [commit message][1]. This changes the changelog helper to
use the imperative mood for consistency.

[1]: dangoslen@11616d3

Signed-off-by: Andrew Ross <andrross@amazon.com>
@github-actions
Copy link

github-actions bot commented Feb 9, 2023

Preview of Release Notes to be Created

Added

  • Adds support for Changelogs containing blank lines between sections

Changed

  • Small fixes for contributing guide
  • Use imperative mood in changelog entry

Dependencies

  • Bumps typescript from 4.9.3 to 4.9.4
  • Bumps actions/checkout from 3.1.0 to 3.3.0
  • Bumps prettier from 2.8.0 to 2.8.3
  • Bumps @types/node from 14.18.33 to 18.11.18
  • Bumps eslint-plugin-jest from 27.1.6 to 27.2.1
  • Bumps eslint from 8.28.0 to 8.32.0

@andrross
Copy link
Contributor Author

andrross commented Feb 9, 2023

Dependencies

  • Bumps typescript from 4.9.3 to 4.9.4
  • Bumps actions/checkout from 3.1.0 to 3.3.0
  • Bumps prettier from 2.8.0 to 2.8.3
  • Bumps @types/node from 14.18.33 to 18.11.18
  • Bumps eslint-plugin-jest from 27.1.6 to 27.2.1
  • Bumps eslint from 8.28.0 to 8.32.0

Obviously this PR would result in a bit of a jarring change in existing CHANGELOGs...

src/changelog-updater.ts Outdated Show resolved Hide resolved
@dangoslen
Copy link
Owner

@andrross not being a pedant at all. I think it could be a good idea to make this a configuration option of entryLinePrefix that defaults to - Bump

I do think we would need to mark this as a breaking change since it changes the behavior and I could see other teams wanting the opposite.

@andrross
Copy link
Contributor Author

andrross commented Feb 9, 2023

@andrross not being a pedant at all. I think it could be a good idea to make this a configuration option of entryLinePrefix that defaults to - Bump

I do think we would need to mark this as a breaking change since it changes the behavior and I could see other teams wanting the opposite.

I agree with all of this. It's definitely a breaking change but I like the idea of making it the new default. Configuration options do add complexity but it seems likely there will be other users who prefer the original so giving them the option will be important. There may even be other pedants who prefer - Update or something else :)

@dangoslen
Copy link
Owner

Yep - I had thought about this early on (even wrote an issue for it), but decided I'd rather get something out.

And while I'd like to create a more general "format string" pattern, there are some complications around finding matching lines. Using the idea of a prefix might be the easiest way to give some control, but not have to rethink several aspects of the tool (which I'm already working on a refactor or too).

If you want to add the config option here I'm happy to collab on it! Or also happy to accept these changes as is and I can work adding that config before creating a 3.0 release

@andrross
Copy link
Contributor Author

@dangoslen Let me take a crack at adding this flag to this PR. If it becomes too involved I'll follow up here and we can do the two step approach you suggested.

Signed-off-by: Andrew Ross <andrross@amazon.com>
@github-actions
Copy link

Hey @andrross, the Changelog Enforcer failed. Can you take a look at the error below and correct it? Thanks!

The latest version in the changelog does not match the expected latest version of 3.0.0!

@andrross
Copy link
Contributor Author

@dangoslen I made an attempt, including updating the version to 3.0. As you can see I don't really know what I'm doing here :)

npm test is passing, but npm run all is failing for reasons I can't decipher.

package.json Outdated
@@ -1,6 +1,6 @@
{
"name": "dependabot-helper",
"version": "2.2.0",
"version": "3.0.0",
Copy link
Owner

Choose a reason for hiding this comment

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

I'll bump the version in a different PR. Can you put this back to 2.2.0?

The check for if the latest version is in the changelog is broken (deals with how tags get pulled across forks..) This is a good reminder I need to remove that (and a few other things) for v3.0 - 😅

}

function buildEntryLineStartRegex(entry: DependabotEntry): RegExp {
return new RegExp("- \\w+ `" + entry.package + "` from ")
Copy link
Owner

Choose a reason for hiding this comment

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

oh clever. 👍🏼

action.yml Outdated Show resolved Hide resolved
Signed-off-by: Andrew Ross <andrross@amazon.com>
@github-actions
Copy link

Preview of Release Notes to be Created

Added

  • Adds support for Changelogs containing blank lines between sections

Changed

  • Small fixes for contributing guide

Dependencies

  • Bumps typescript from 4.9.3 to 4.9.4
  • Bumps actions/checkout from 3.1.0 to 3.3.0
  • Bumps prettier from 2.8.0 to 2.8.3
  • Bumps @types/node from 14.18.33 to 18.11.18
  • Bumps eslint-plugin-jest from 27.1.6 to 27.2.1
  • Bumps eslint from 8.28.0 to 8.32.0

Signed-off-by: Andrew Ross <andrross@amazon.com>
@github-actions
Copy link

Preview of Release Notes to be Created

Added

  • Adds support for Changelogs containing blank lines between sections

Changed

  • Small fixes for contributing guide

Dependencies

  • Bumps typescript from 4.9.3 to 4.9.4
  • Bumps actions/checkout from 3.1.0 to 3.3.0
  • Bumps prettier from 2.8.0 to 2.8.3
  • Bumps @types/node from 14.18.33 to 18.11.18
  • Bumps eslint-plugin-jest from 27.1.6 to 27.2.1
  • Bumps eslint from 8.28.0 to 8.32.0


## [v1.0.0]
### Dependencies
- Bump \`package\` from v1 to v2`)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note there is some subtlety here regarding finding existing entries/duplicates. I've chosen not to change the prefix word of an existing entry if a different prefix word is provided.

@dangoslen
Copy link
Owner

@andrross I think this looks good! Thanks for the contribution.

I do have a patch release in another PR that I will merge later tonight/tomorrow morning and then will get to merging this later this week.

You PR is forcing me to do the clean-up I've been needing to do, so apologies that this won't get super fast, but I'd like to get some dependencies updated and the CI cleaned back up before doing a v3.0. Is that acceptable to you?

@andrross
Copy link
Contributor Author

You PR is forcing me to do the clean-up I've been needing to do, so apologies that this won't get super fast, but I'd like to get some dependencies updated and the CI cleaned back up before doing a v3.0. Is that acceptable to you?

Yeah, no problem at all!

@dangoslen
Copy link
Owner

Hey @andrross after merging the patch PR and upgrading some deps, there looks to be a view conflicts. I don't think they are too bad though. Do you mind fixing those up?

For the dist/index.js.map file, you can just accept the incoming changes and I'll generate that file when I cut the release.

Signed-off-by: Andrew Ross <andrross@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants