Skip to content

Commit d3bfc50

Browse files
authored
Revert "feat(options): add new options to avoid stale base on comments (#494)" (#507)
This reverts commit 1efddcb.
1 parent f2ae27a commit d3bfc50

File tree

12 files changed

+79
-827
lines changed

12 files changed

+79
-827
lines changed

README.md

Lines changed: 51 additions & 75 deletions
Large diffs are not rendered by default.

__tests__/constants/default-processor-options.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ export const DefaultProcessorOptions: IIssuesProcessorOptions = Object.freeze({
2929
removeStaleWhenUpdated: false,
3030
removeIssueStaleWhenUpdated: undefined,
3131
removePrStaleWhenUpdated: undefined,
32-
removeStaleWhenCommented: false,
33-
removeIssueStaleWhenCommented: undefined,
34-
removePrStaleWhenCommented: undefined,
3532
ascending: false,
3633
deleteBranch: false,
3734
startDate: '',

__tests__/main.spec.ts

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ test('stale issues should not be closed if days is set to -1', async () => {
12201220
});
12211221

12221222
test('stale label should be removed if a comment was added to a stale issue', async () => {
1223-
const opts = {...DefaultProcessorOptions, removeStaleWhenCommented: true};
1223+
const opts = {...DefaultProcessorOptions, removeStaleWhenUpdated: true};
12241224
const TestIssueList: Issue[] = [
12251225
generateIssue(
12261226
opts,
@@ -1259,7 +1259,7 @@ test('when the option "labelsToAddWhenUnstale" is set, the labels should be adde
12591259
expect.assertions(4);
12601260
const opts = {
12611261
...DefaultProcessorOptions,
1262-
removeStaleWhenCommented: true,
1262+
removeStaleWhenUpdated: true,
12631263
labelsToAddWhenUnstale: 'test'
12641264
};
12651265
const TestIssueList: Issue[] = [
@@ -1299,37 +1299,8 @@ test('when the option "labelsToAddWhenUnstale" is set, the labels should be adde
12991299
expect(processor.addedLabelIssues).toHaveLength(1);
13001300
});
13011301

1302-
test('stale label should be removed if a stale issue was updated', async () => {
1303-
const opts = {...DefaultProcessorOptions, removeStaleWhenUpdated: true};
1304-
const TestIssueList: Issue[] = [
1305-
generateIssue(
1306-
opts,
1307-
1,
1308-
'An issue that should un-stale',
1309-
new Date().toDateString(),
1310-
'2020-01-01T17:00:00Z',
1311-
false,
1312-
['Stale']
1313-
)
1314-
];
1315-
const processor = new IssuesProcessorMock(
1316-
opts,
1317-
async () => 'abot',
1318-
async p => (p === 1 ? TestIssueList : []),
1319-
async () => [],
1320-
async () => '2020-01-02T17:00:00Z'
1321-
);
1322-
1323-
// process our fake issue list
1324-
await processor.processIssues(1);
1325-
1326-
expect(processor.closedIssues).toHaveLength(0);
1327-
expect(processor.staleIssues).toHaveLength(0);
1328-
expect(processor.removedLabelIssues).toHaveLength(1);
1329-
});
1330-
13311302
test('stale label should not be removed if a comment was added by the bot (and the issue should be closed)', async () => {
1332-
const opts = {...DefaultProcessorOptions, removeStaleWhenCommented: true};
1303+
const opts = {...DefaultProcessorOptions, removeStaleWhenUpdated: true};
13331304
github.context.actor = 'abot';
13341305
const TestIssueList: Issue[] = [
13351306
generateIssue(
@@ -1368,7 +1339,7 @@ test('stale label should not be removed if a comment was added by the bot (and t
13681339
test('stale label containing a space should be removed if a comment was added to a stale issue', async () => {
13691340
const opts: IIssuesProcessorOptions = {
13701341
...DefaultProcessorOptions,
1371-
removeStaleWhenCommented: true,
1342+
removeStaleWhenUpdated: true,
13721343
staleIssueLabel: 'stat: stale'
13731344
};
13741345
const TestIssueList: Issue[] = [
@@ -2307,7 +2278,7 @@ test('processing an issue stale since less than the daysBeforeStale with a stale
23072278
daysBeforeStale: 30,
23082279
daysBeforeClose: 7,
23092280
closeIssueMessage: 'close message',
2310-
removeStaleWhenCommented: false
2281+
removeStaleWhenUpdated: false
23112282
};
23122283
const now: Date = new Date();
23132284
const updatedAt: Date = new Date(now.setDate(now.getDate() - 9));
@@ -2349,7 +2320,7 @@ test('processing an issue stale since less than the daysBeforeStale without a st
23492320
daysBeforeStale: 30,
23502321
daysBeforeClose: 7,
23512322
closeIssueMessage: 'close message',
2352-
removeStaleWhenCommented: false
2323+
removeStaleWhenUpdated: false
23532324
};
23542325
const now: Date = new Date();
23552326
const updatedAt: Date = new Date(now.setDate(now.getDate() - 9));

0 commit comments

Comments
 (0)