Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions lib/landing_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,20 @@ class LandingSession extends Session {
}

// Check for and maybe assign any unmarked deprecations in the codebase.
const unmarkedDeprecations = await getUnmarkedDeprecations();
const unmarkedDepCount = unmarkedDeprecations.length;
if (unmarkedDepCount > 0) {
cli.startSpinner('Assigning deprecation numbers to DEPOXXX items');

// Update items then stage files and amend the last commit.
await updateDeprecations(unmarkedDeprecations);
await runAsync('git', ['add', 'doc', 'lib', 'src', 'test']);
await runAsync('git', ['commit', '--amend', '--no-edit']);

cli.stopSpinner(`Updated ${unmarkedDepCount} DEPOXXX items in codebase`);
if (this.updateDeprecations !== 'yes') {
const unmarkedDeprecations = await getUnmarkedDeprecations();
const unmarkedDepCount = unmarkedDeprecations.length;
if (unmarkedDepCount > 0) {
cli.startSpinner('Assigning deprecation numbers to DEPOXXX items');

// Update items then stage files and amend the last commit.
await updateDeprecations(unmarkedDeprecations);
await runAsync('git', ['add', 'doc', 'lib', 'src', 'test']);
await runAsync('git', ['commit', '--amend', '--no-edit']);

cli
.stopSpinner(`Updated ${unmarkedDepCount} DEPOXXX items in codebase`);
}
}

cli.ok('Patches applied');
Expand Down
5 changes: 5 additions & 0 deletions lib/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class Session {
readme: this.readme,
waitTimeSingleApproval: this.waitTimeSingleApproval,
waitTimeMultiApproval: this.waitTimeMultiApproval,
updateDeprecations: this.updateDeprecations,
ciType: this.ciType,
prid: this.prid
};
Expand Down Expand Up @@ -109,6 +110,10 @@ class Session {
return path.join(this.ncuDir, `${this.prid}`);
}

get updateDeprecations() {
return this.config.updateDeprecations || 'yes';
}

startLanding() {
writeJson(this.sessionPath, {
state: STARTED,
Expand Down