Skip to content

Commit be9e3ff

Browse files
authored
land: optional deprecations update (#450)
node-core-utils is also used on other repositories across the Node.js Org where deprecations are not logged into a file. Making it opt-out allows node-core-utils to still be used on those repositories.
1 parent d63301e commit be9e3ff

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

lib/landing_session.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,20 @@ class LandingSession extends Session {
9595
}
9696

9797
// Check for and maybe assign any unmarked deprecations in the codebase.
98-
const unmarkedDeprecations = await getUnmarkedDeprecations();
99-
const unmarkedDepCount = unmarkedDeprecations.length;
100-
if (unmarkedDepCount > 0) {
101-
cli.startSpinner('Assigning deprecation numbers to DEPOXXX items');
102-
103-
// Update items then stage files and amend the last commit.
104-
await updateDeprecations(unmarkedDeprecations);
105-
await runAsync('git', ['add', 'doc', 'lib', 'src', 'test']);
106-
await runAsync('git', ['commit', '--amend', '--no-edit']);
107-
108-
cli.stopSpinner(`Updated ${unmarkedDepCount} DEPOXXX items in codebase`);
98+
if (this.updateDeprecations !== 'yes') {
99+
const unmarkedDeprecations = await getUnmarkedDeprecations();
100+
const unmarkedDepCount = unmarkedDeprecations.length;
101+
if (unmarkedDepCount > 0) {
102+
cli.startSpinner('Assigning deprecation numbers to DEPOXXX items');
103+
104+
// Update items then stage files and amend the last commit.
105+
await updateDeprecations(unmarkedDeprecations);
106+
await runAsync('git', ['add', 'doc', 'lib', 'src', 'test']);
107+
await runAsync('git', ['commit', '--amend', '--no-edit']);
108+
109+
cli
110+
.stopSpinner(`Updated ${unmarkedDepCount} DEPOXXX items in codebase`);
111+
}
109112
}
110113

111114
cli.ok('Patches applied');

lib/session.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class Session {
6060
readme: this.readme,
6161
waitTimeSingleApproval: this.waitTimeSingleApproval,
6262
waitTimeMultiApproval: this.waitTimeMultiApproval,
63+
updateDeprecations: this.updateDeprecations,
6364
ciType: this.ciType,
6465
prid: this.prid
6566
};
@@ -109,6 +110,10 @@ class Session {
109110
return path.join(this.ncuDir, `${this.prid}`);
110111
}
111112

113+
get updateDeprecations() {
114+
return this.config.updateDeprecations || 'yes';
115+
}
116+
112117
startLanding() {
113118
writeJson(this.sessionPath, {
114119
state: STARTED,

0 commit comments

Comments
 (0)