github-release-notes icon indicating copy to clipboard operation
github-release-notes copied to clipboard

Allow manual changes to persist across --override

Open YellowKirby opened this issue 7 years ago • 3 comments

Hello,

We've been happily using GREN on an enterprise Github instance to generate release notes based on PR data. We have a use-case where we'd like to add additional, hand-crafted release notes on top of the GREN-generated data that could be persisted even when using --override. This would be really useful in adding migration guides for major/breaking releases. We often end up regenerating the GREN release notes in order to add clarifications to PR titles.

Would it be possible to have the GREN-generated data live in a special block that GREN could replace rather than overwriting the entire body?

e.g., for the following release body:

// Hand-crafted release notes here
# Migration Guide
...

<!-- GREN-BEGIN -->
// Generated GREN data goes here
<!-- GREN-END -->

When using --override, GREN would only replace/regenerate the contents between the GREN-BEGIN and GREN-END comment blocks so that any manual additions to the release notes are not overwritten. Since these blocks are just HTML comments, they wouldn't end up visible in the overall release page.

FWIW, here's the .grenrc that we're using. Unfortunately I can't share the specific repo data because enterprise 😕

module.exports = {
	dataSource: 'prs',
	prefix: '',
	onlyMilestones: false,
	groupBy: {
		'💥 Breaking Changes 💥': ['Major (Breaking Change)'],
		'✨ Non-Breaking New Features ✨': ['Minor (New Feature)'],
		'🛠️ Bug Fixes + Misc 🛠️': ['Patch (Bug Fix)']
	},
	changelogFilename: 'CHANGELOG.md'
};

Thanks!

YellowKirby avatar Feb 28 '18 21:02 YellowKirby

@YellowKirby I'm glad you're enjoying the tool!

That is a brilliant idea!! I do agree that is something very helpful.

Have you considered the other way around too (i.e. have a block for personal comments)? This would mean that gren would just not touch whatever is in the comment block.

As this is coming from your experience, I'm just suggesting another solution to understand which one would suit your case more.

alexcanessa avatar Mar 01 '18 14:03 alexcanessa

For our specific use-case, having the gren data in a comment block would probably be simpler. That way we can just start adding more notes to the top of the release without needing to remember to enclose them in a special comment, kind of like how git commit works:

Freeform commit message here

# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.

But either approach would be fine. If you think that a special comment block for personal comments would be more flexible, then that would work for us too 👍

YellowKirby avatar Mar 01 '18 18:03 YellowKirby

Love to have that!

xetra11 avatar Dec 23 '20 08:12 xetra11