Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Mar 1, 2020
1 parent 75c2879 commit f68a391
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 2 additions & 0 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class CLI {
this.figureIndent = ' '.repeat(indent);
}

// TODO(codebytere): fold this into an options object
// for cli.prompt() ans refactor accordingly.
async promptInput(question, showSeparator = true) {
if (showSeparator) this.separator();
const { answer } = await inquirer.prompt([{
Expand Down
24 changes: 19 additions & 5 deletions lib/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class Release {
} else if (line.includes('#define NODE_VERSION_IS_RELEASE')) {
arr[idx] = '#define NODE_VERSION_IS_RELEASE 1';
} else if (line.includes('#define NODE_VERSION_IS_LTS')) {
this.isLTS = arr[idx].split(' ')[2] === 1;
this.isLTS = arr[idx].split(' ')[2] === '1';
this.ltsCodename = arr[idx + 1].split(' ')[2];
}
});
Expand Down Expand Up @@ -354,34 +354,48 @@ class Release {
}

checkBranchDiff(onlyNotableChanges = false) {
const { versionComponents, stagingBranch, upstream, newVersion } = this;
const {
versionComponents,
stagingBranch,
upstream,
newVersion,
isLTS
} = this;

let branchDiffOptions;
if (onlyNotableChanges) {
const proposalBranch = `v${newVersion}-proposal`;
const releaseBranch = `v${versionComponents.major}.x`;

const notableLabels = [
'notable-change',
'semver-minor'
];

branchDiffOptions = [
'branch-diff',
`${upstream}/${releaseBranch}`,
proposalBranch,
'--require-label=notable-change',
`--require-label=${notableLabels.join(',')}`,
'-format=simple'
];
} else {
const excludeLabels = [
'semver-major',
`dont-land-on-v${versionComponents.major}.x`,
`backport-requested-v${versionComponents.major}.x`
`backport-requested-v${versionComponents.major}.x`,
`backported-to-v${versionComponents.major}.x`,
`backport-blocked-v${versionComponents.major}.x`
];

if (versionComponents.patch !== 0) {
if (isLTS) {
excludeLabels.push('semver-minor');
}

branchDiffOptions = [
'branch-diff',
stagingBranch,
// TODO(codebytere): use Current branch instead of master for LTS
'master',
`--exclude-label=${excludeLabels.join(',')}`,
'--filter-release',
Expand Down

0 comments on commit f68a391

Please sign in to comment.