-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(milestones): add new options to exempt all milestones (#291)
* refactor: move and rename the interfaces/classes closes #272 * docs: update the readme and action to describe the new options for milestones * refactor: split the tests into multiple files * feat(milestones): add new options to exempt all milestones * test: add coverage for the default values * test(milestones): add more coverage (wip) * test(milestones): add more coverage for the multiple exempt milestones * test: reduce duplicated code * test: change some describes * test: add more coverage * test: add more coverage * test: add final coverage * build(tsc): add missing project flag to build with the right tsconfig * test(milestones): use each to reduce the complexity of the tests * chore: fix an eslint issue with prettier on windows the end of line was wrong each time the os process the files * docs: move the contribution section to a dedicated file add more content to help the debug * chore: make sure the rebase is ok
- Loading branch information
Showing
20 changed files
with
3,728 additions
and
420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
### Building and testing | ||
|
||
Install the dependencies. | ||
|
||
```bash | ||
$ npm install | ||
``` | ||
|
||
Build the typescript and package it for distribution. | ||
|
||
```bash | ||
$ npm run build && npm run pack | ||
``` | ||
|
||
Run the tests :heavy_check_mark: | ||
|
||
```bash | ||
$ npm test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import {IIssuesProcessorOptions} from '../../src/interfaces/issues-processor-options'; | ||
|
||
export const DefaultProcessorOptions: IIssuesProcessorOptions = Object.freeze({ | ||
repoToken: 'none', | ||
staleIssueMessage: 'This issue is stale', | ||
stalePrMessage: 'This PR is stale', | ||
closeIssueMessage: 'This issue is being closed', | ||
closePrMessage: 'This PR is being closed', | ||
daysBeforeStale: 1, | ||
daysBeforeIssueStale: NaN, | ||
daysBeforePrStale: NaN, | ||
daysBeforeClose: 30, | ||
daysBeforeIssueClose: NaN, | ||
daysBeforePrClose: NaN, | ||
staleIssueLabel: 'Stale', | ||
closeIssueLabel: '', | ||
exemptIssueLabels: '', | ||
stalePrLabel: 'Stale', | ||
closePrLabel: '', | ||
exemptPrLabels: '', | ||
onlyLabels: '', | ||
operationsPerRun: 100, | ||
debugOnly: true, | ||
removeStaleWhenUpdated: false, | ||
ascending: false, | ||
skipStaleIssueMessage: false, | ||
skipStalePrMessage: false, | ||
deleteBranch: false, | ||
startDate: '', | ||
exemptMilestones: '', | ||
exemptIssueMilestones: '', | ||
exemptPrMilestones: '', | ||
exemptAllMilestones: false, | ||
exemptAllIssueMilestones: undefined, | ||
exemptAllPrMilestones: undefined | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import {Issue} from '../../src/classes/issue'; | ||
import {IIssuesProcessorOptions} from '../../src/interfaces/issues-processor-options'; | ||
import {IsoDateString} from '../../src/types/iso-date-string'; | ||
|
||
export function generateIssue( | ||
options: IIssuesProcessorOptions, | ||
id: number, | ||
title: string, | ||
updatedAt: IsoDateString, | ||
createdAt: IsoDateString = updatedAt, | ||
isPullRequest = false, | ||
labels: string[] = [], | ||
isClosed = false, | ||
isLocked = false, | ||
milestone: string | undefined = undefined | ||
): Issue { | ||
return new Issue(options, { | ||
number: id, | ||
labels: labels.map(l => { | ||
return {name: l}; | ||
}), | ||
title, | ||
created_at: createdAt, | ||
updated_at: updatedAt, | ||
pull_request: isPullRequest ? {} : null, | ||
state: isClosed ? 'closed' : 'open', | ||
locked: isLocked, | ||
milestone: milestone | ||
? { | ||
title: milestone | ||
} | ||
: undefined | ||
}); | ||
} |
Oops, something went wrong.