Skip to content

Commit

Permalink
chore: add Trop annotations to release notes.
Browse files Browse the repository at this point in the history
Manually backport #24644 to 10-x-y. See that PR for details.
  • Loading branch information
ckerr committed Jul 21, 2020
1 parent d08e31c commit 99d21f1
Show file tree
Hide file tree
Showing 3 changed files with 383 additions and 234 deletions.
12 changes: 5 additions & 7 deletions script/release/notes/index.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const getPreviousPoint = async (point) => {
}
};

async function getReleaseNotes (range, newVersion, explicitLinks) {
async function getReleaseNotes (range, newVersion) {
const rangeList = range.split('..') || ['HEAD'];
const to = rangeList.pop();
const from = rangeList.pop() || (await getPreviousPoint(to));
Expand All @@ -129,10 +129,9 @@ async function getReleaseNotes (range, newVersion, explicitLinks) {
newVersion = to;
}

console.log(`Generating release notes between ${from} and ${to} for version ${newVersion}`);
const notes = await notesGenerator.get(from, to, newVersion);
const ret = {
text: notesGenerator.render(notes, explicitLinks)
text: notesGenerator.render(notes)
};

if (notes.unknown.length) {
Expand All @@ -144,7 +143,7 @@ async function getReleaseNotes (range, newVersion, explicitLinks) {

async function main () {
const opts = minimist(process.argv.slice(2), {
boolean: ['explicit-links', 'help'],
boolean: ['help'],
string: ['version']
});
opts.range = opts._.shift();
Expand All @@ -153,14 +152,13 @@ async function main () {
console.log(`
easy usage: ${name} version
full usage: ${name} [begin..]end [--version version] [--explicit-links]
full usage: ${name} [begin..]end [--version version]
* 'begin' and 'end' are two git references -- tags, branches, etc --
from which the release notes are generated.
* if omitted, 'begin' defaults to the previous tag in end's branch.
* if omitted, 'version' defaults to 'end'. Specifying a version is
useful if you're making notes on a new version that isn't tagged yet.
* 'explicit-links' makes every note's issue, commit, or pull an MD link
For example, these invocations are equivalent:
${process.argv[1]} v4.0.1
Expand All @@ -169,7 +167,7 @@ For example, these invocations are equivalent:
return 0;
}

const notes = await getReleaseNotes(opts.range, opts.version, opts['explicit-links']);
const notes = await getReleaseNotes(opts.range, opts.version);
console.log(notes.text);
if (notes.warning) {
throw new Error(notes.warning);
Expand Down

0 comments on commit 99d21f1

Please sign in to comment.