feat: remove the ignore-updates option
BREAKING CHANGE: The option ignore-updates was removed
This commit is contained in:
parent
b98591d49e
commit
3021a55a47
122
README.md
122
README.md
|
@ -28,58 +28,57 @@ You can find more information about the required permissions under the correspon
|
||||||
|
|
||||||
Every argument is optional.
|
Every argument is optional.
|
||||||
|
|
||||||
| Input | Description | Default |
|
| Input | Description | Default |
|
||||||
| ------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------- |
|
| ------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------- |
|
||||||
| [repo-token](#repo-token) | PAT for GitHub API authentication | `${{ github.token }}` |
|
| [repo-token](#repo-token) | PAT for GitHub API authentication | `${{ github.token }}` |
|
||||||
| [days-before-stale](#days-before-stale) | Idle number of days before marking issues/PRs stale | `60` |
|
| [days-before-stale](#days-before-stale) | Idle number of days before marking issues/PRs stale | `60` |
|
||||||
| [days-before-issue-stale](#days-before-issue-stale) | Override [days-before-stale](#days-before-stale) for issues only | |
|
| [days-before-issue-stale](#days-before-issue-stale) | Override [days-before-stale](#days-before-stale) for issues only | |
|
||||||
| [days-before-pr-stale](#days-before-pr-stale) | Override [days-before-stale](#days-before-stale) for PRs only | |
|
| [days-before-pr-stale](#days-before-pr-stale) | Override [days-before-stale](#days-before-stale) for PRs only | |
|
||||||
| [days-before-close](#days-before-close) | Idle number of days before closing stale issues/PRs | `7` |
|
| [days-before-close](#days-before-close) | Idle number of days before closing stale issues/PRs | `7` |
|
||||||
| [days-before-issue-close](#days-before-issue-close) | Override [days-before-close](#days-before-close) for issues only | |
|
| [days-before-issue-close](#days-before-issue-close) | Override [days-before-close](#days-before-close) for issues only | |
|
||||||
| [days-before-pr-close](#days-before-pr-close) | Override [days-before-close](#days-before-close) for PRs only | |
|
| [days-before-pr-close](#days-before-pr-close) | Override [days-before-close](#days-before-close) for PRs only | |
|
||||||
| [stale-issue-message](#stale-issue-message) | Comment on the staled issues | |
|
| [stale-issue-message](#stale-issue-message) | Comment on the staled issues | |
|
||||||
| [stale-pr-message](#stale-pr-message) | Comment on the staled PRs | |
|
| [stale-pr-message](#stale-pr-message) | Comment on the staled PRs | |
|
||||||
| [close-issue-message](#close-issue-message) | Comment on the staled issues while closed | |
|
| [close-issue-message](#close-issue-message) | Comment on the staled issues while closed | |
|
||||||
| [close-pr-message](#close-pr-message) | Comment on the staled PRs while closed | |
|
| [close-pr-message](#close-pr-message) | Comment on the staled PRs while closed | |
|
||||||
| [stale-issue-label](#stale-issue-label) | Label to apply on staled issues | `Stale` |
|
| [stale-issue-label](#stale-issue-label) | Label to apply on staled issues | `Stale` |
|
||||||
| [close-issue-label](#close-issue-label) | Label to apply on closed issues | |
|
| [close-issue-label](#close-issue-label) | Label to apply on closed issues | |
|
||||||
| [stale-pr-label](#stale-pr-label) | Label to apply on staled PRs | `Stale` |
|
| [stale-pr-label](#stale-pr-label) | Label to apply on staled PRs | `Stale` |
|
||||||
| [close-pr-label](#close-pr-label) | Label to apply on closed PRs | |
|
| [close-pr-label](#close-pr-label) | Label to apply on closed PRs | |
|
||||||
| [exempt-issue-labels](#exempt-issue-labels) | Labels on issues exempted from stale | |
|
| [exempt-issue-labels](#exempt-issue-labels) | Labels on issues exempted from stale | |
|
||||||
| [exempt-pr-labels](#exempt-pr-labels) | Labels on PRs exempted from stale | |
|
| [exempt-pr-labels](#exempt-pr-labels) | Labels on PRs exempted from stale | |
|
||||||
| [only-labels](#only-labels) | Only issues/PRs with ALL these labels are checked | |
|
| [only-labels](#only-labels) | Only issues/PRs with ALL these labels are checked | |
|
||||||
| [only-issue-labels](#only-issue-labels) | Override [only-labels](#only-labels) for issues only | |
|
| [only-issue-labels](#only-issue-labels) | Override [only-labels](#only-labels) for issues only | |
|
||||||
| [only-pr-labels](#only-pr-labels) | Override [only-labels](#only-labels) for PRs only | |
|
| [only-pr-labels](#only-pr-labels) | Override [only-labels](#only-labels) for PRs only | |
|
||||||
| [any-of-labels](#any-of-labels) | Only issues/PRs with ANY of these labels are checked | |
|
| [any-of-labels](#any-of-labels) | Only issues/PRs with ANY of these labels are checked | |
|
||||||
| [any-of-issue-labels](#any-of-issue-labels) | Override [any-of-labels](#any-of-labels) for issues only | |
|
| [any-of-issue-labels](#any-of-issue-labels) | Override [any-of-labels](#any-of-labels) for issues only | |
|
||||||
| [any-of-pr-labels](#any-of-pr-labels) | Override [any-of-labels](#any-of-labels) for PRs only | |
|
| [any-of-pr-labels](#any-of-pr-labels) | Override [any-of-labels](#any-of-labels) for PRs only | |
|
||||||
| [operations-per-run](#operations-per-run) | Max number of operations per run | `30` |
|
| [operations-per-run](#operations-per-run) | Max number of operations per run | `30` |
|
||||||
| [remove-stale-when-updated](#remove-stale-when-updated) | Remove stale label from issues/PRs on updates | `true` |
|
| [remove-stale-when-updated](#remove-stale-when-updated) | Remove stale label from issues/PRs on updates | `true` |
|
||||||
| [remove-issue-stale-when-updated](#remove-issue-stale-when-updated) | Remove stale label from issues on updates/comments | |
|
| [remove-issue-stale-when-updated](#remove-issue-stale-when-updated) | Remove stale label from issues on updates/comments | |
|
||||||
| [remove-pr-stale-when-updated](#remove-pr-stale-when-updated) | Remove stale label from PRs on updates/comments | |
|
| [remove-pr-stale-when-updated](#remove-pr-stale-when-updated) | Remove stale label from PRs on updates/comments | |
|
||||||
| [labels-to-add-when-unstale](#labels-to-add-when-unstale) | Add specified labels from issues/PRs when they become unstale | |
|
| [labels-to-add-when-unstale](#labels-to-add-when-unstale) | Add specified labels from issues/PRs when they become unstale | |
|
||||||
| [labels-to-remove-when-unstale](#labels-to-remove-when-unstale) | Remove specified labels from issues/PRs when they become unstale | |
|
| [labels-to-remove-when-unstale](#labels-to-remove-when-unstale) | Remove specified labels from issues/PRs when they become unstale | |
|
||||||
| [debug-only](#debug-only) | Dry-run | `false` |
|
| [debug-only](#debug-only) | Dry-run | `false` |
|
||||||
| [ascending](#ascending) | Order to get issues/PRs | `false` |
|
| [ascending](#ascending) | Order to get issues/PRs | `false` |
|
||||||
| [start-date](#start-date) | Skip stale action for issues/PRs created before it | |
|
| [start-date](#start-date) | Skip stale action for issues/PRs created before it | |
|
||||||
| [delete-branch](#delete-branch) | Delete branch after closing a stale PR | `false` |
|
| [delete-branch](#delete-branch) | Delete branch after closing a stale PR | `false` |
|
||||||
| [exempt-milestones](#exempt-milestones) | Milestones on issues/PRs exempted from stale | |
|
| [exempt-milestones](#exempt-milestones) | Milestones on issues/PRs exempted from stale | |
|
||||||
| [exempt-issue-milestones](#exempt-issue-milestones) | Override [exempt-milestones](#exempt-milestones) for issues only | |
|
| [exempt-issue-milestones](#exempt-issue-milestones) | Override [exempt-milestones](#exempt-milestones) for issues only | |
|
||||||
| [exempt-pr-milestones](#exempt-pr-milestones) | Override [exempt-milestones](#exempt-milestones) for PRs only | |
|
| [exempt-pr-milestones](#exempt-pr-milestones) | Override [exempt-milestones](#exempt-milestones) for PRs only | |
|
||||||
| [exempt-all-milestones](#exempt-all-milestones) | Exempt all issues/PRs with milestones from stale | `false` |
|
| [exempt-all-milestones](#exempt-all-milestones) | Exempt all issues/PRs with milestones from stale | `false` |
|
||||||
| [exempt-all-issue-milestones](#exempt-all-issue-milestones) | Override [exempt-all-milestones](#exempt-all-milestones) for issues only | |
|
| [exempt-all-issue-milestones](#exempt-all-issue-milestones) | Override [exempt-all-milestones](#exempt-all-milestones) for issues only | |
|
||||||
| [exempt-all-pr-milestones](#exempt-all-pr-milestones) | Override [exempt-all-milestones](#exempt-all-milestones) for PRs only | |
|
| [exempt-all-pr-milestones](#exempt-all-pr-milestones) | Override [exempt-all-milestones](#exempt-all-milestones) for PRs only | |
|
||||||
| [exempt-assignees](#exempt-assignees) | Assignees on issues/PRs exempted from stale | |
|
| [exempt-assignees](#exempt-assignees) | Assignees on issues/PRs exempted from stale | |
|
||||||
| [exempt-issue-assignees](#exempt-issue-assignees) | Override [exempt-assignees](#exempt-assignees) for issues only | |
|
| [exempt-issue-assignees](#exempt-issue-assignees) | Override [exempt-assignees](#exempt-assignees) for issues only | |
|
||||||
| [exempt-pr-assignees](#exempt-pr-assignees) | Override [exempt-assignees](#exempt-assignees) for PRs only | |
|
| [exempt-pr-assignees](#exempt-pr-assignees) | Override [exempt-assignees](#exempt-assignees) for PRs only | |
|
||||||
| [exempt-all-assignees](#exempt-all-assignees) | Exempt all issues/PRs with assignees from stale | `false` |
|
| [exempt-all-assignees](#exempt-all-assignees) | Exempt all issues/PRs with assignees from stale | `false` |
|
||||||
| [exempt-all-issue-assignees](#exempt-all-issue-assignees) | Override [exempt-all-assignees](#exempt-all-assignees) for issues only | |
|
| [exempt-all-issue-assignees](#exempt-all-issue-assignees) | Override [exempt-all-assignees](#exempt-all-assignees) for issues only | |
|
||||||
| [exempt-all-pr-assignees](#exempt-all-pr-assignees) | Override [exempt-all-assignees](#exempt-all-assignees) for PRs only | |
|
| [exempt-all-pr-assignees](#exempt-all-pr-assignees) | Override [exempt-all-assignees](#exempt-all-assignees) for PRs only | |
|
||||||
| [exempt-draft-pr](#exempt-draft-pr) | Skip the stale action for draft PRs | `false` |
|
| [exempt-draft-pr](#exempt-draft-pr) | Skip the stale action for draft PRs | `false` |
|
||||||
| [enable-statistics](#enable-statistics) | Display statistics in the logs | `true` |
|
| [enable-statistics](#enable-statistics) | Display statistics in the logs | `true` |
|
||||||
| [ignore-updates](#ignore-updates) | Any update (update/comment) can reset the stale idle time on the issues/PRs | `false` |
|
| [ignore-issue-updates](#ignore-issue-updates) | Any update (update/comment) can reset the stale idle time on the issues | |
|
||||||
| [ignore-issue-updates](#ignore-issue-updates) | Override [ignore-updates](#ignore-updates) for issues only | |
|
| [ignore-pr-updates](#ignore-pr-updates) | Any update (update/comment) can reset the stale idle time on the PRs | |
|
||||||
| [ignore-pr-updates](#ignore-pr-updates) | Override [ignore-updates](#ignore-updates) for PRs only | |
|
|
||||||
|
|
||||||
### List of output options
|
### List of output options
|
||||||
|
|
||||||
|
@ -102,7 +101,7 @@ Default value: `${{ github.token }}`
|
||||||
The idle number of days before marking the issues or the pull requests as stale (by adding a label).
|
The idle number of days before marking the issues or the pull requests as stale (by adding a label).
|
||||||
The issues or the pull requests will be marked as stale if the last update (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`) is older than the idle number of days.
|
The issues or the pull requests will be marked as stale if the last update (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`) is older than the idle number of days.
|
||||||
It means that any updates made, or any comments added to the issues or to the pull requests will restart the counter of days before marking as stale.
|
It means that any updates made, or any comments added to the issues or to the pull requests will restart the counter of days before marking as stale.
|
||||||
However, if you wish to ignore this behaviour so that the creation date (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `created_at`) only matters, you can disable the [ignore-updates](#ignore-updates) option.
|
However, if you wish to ignore this behaviour so that the creation date (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `created_at`) only matters, you can disable the [ignore-issue-updates](#ignore-issue-updates) and [ignore-pr-updates](#ignore-pr-updates) options.
|
||||||
|
|
||||||
If set to a negative number like `-1`, no issues or pull requests will be marked as stale automatically.
|
If set to a negative number like `-1`, no issues or pull requests will be marked as stale automatically.
|
||||||
In that case, you can still add the stale label manually to mark as stale.
|
In that case, you can still add the stale label manually to mark as stale.
|
||||||
|
@ -128,7 +127,8 @@ You can fine tune which issues or pull requests should be marked as stale based
|
||||||
- [exempt-all-milestones](#exempt-all-milestones)
|
- [exempt-all-milestones](#exempt-all-milestones)
|
||||||
- [exempt-assignees](#exempt-assignees)
|
- [exempt-assignees](#exempt-assignees)
|
||||||
- [exempt-all-assignees](#exempt-all-assignees)
|
- [exempt-all-assignees](#exempt-all-assignees)
|
||||||
- [ignore-updates](#ignore-updates)
|
- [ignore-issue-updates](#ignore-issue-updates)
|
||||||
|
- [ignore-pr-updates](#ignore-pr-updates)
|
||||||
|
|
||||||
Default value: `60`
|
Default value: `60`
|
||||||
|
|
||||||
|
@ -488,7 +488,7 @@ This option is only useful if the debug output secret `ACTIONS_STEP_DEBUG` is se
|
||||||
|
|
||||||
Default value: `true`
|
Default value: `true`
|
||||||
|
|
||||||
#### ignore-updates
|
#### ignore-issue-updates
|
||||||
|
|
||||||
The option [days-before-stale](#days-before-stale) will define the number of days before considering the issues or the pull requests as stale.
|
The option [days-before-stale](#days-before-stale) will define the number of days before considering the issues or the pull requests as stale.
|
||||||
In most cases, the purpose of this action is to only stale when necessary so if any update occurs or if a comment is added to them, the counter will restart.
|
In most cases, the purpose of this action is to only stale when necessary so if any update occurs or if a comment is added to them, the counter will restart.
|
||||||
|
@ -497,17 +497,13 @@ Instead of comparing the number of days based on the [GitHub issue](https://docs
|
||||||
|
|
||||||
Default value: `false`
|
Default value: `false`
|
||||||
|
|
||||||
#### ignore-issue-updates
|
|
||||||
|
|
||||||
Useful to override [ignore-updates](#ignore-updates) but only to ignore the updates for the issues.
|
|
||||||
|
|
||||||
Default value: unset
|
|
||||||
|
|
||||||
#### ignore-pr-updates
|
#### ignore-pr-updates
|
||||||
|
|
||||||
Useful to override [ignore-updates](#ignore-updates) but only to ignore the updates for the pull requests.
|
In most cases, the purpose of this action is to only stale when necessary so if any update occurs or if a comment is added to them, the counter will restart.
|
||||||
|
Nonetheless, if you don't care about this, and you prefer to stick to this number of days no matter the update, you can enable this option.
|
||||||
|
Instead of comparing the number of days based on the [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`, it will be based on the [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `created_at`.
|
||||||
|
|
||||||
Default value: unset
|
Default value: `false`
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
|
|
|
@ -47,8 +47,7 @@ export const DefaultProcessorOptions: IIssuesProcessorOptions = Object.freeze({
|
||||||
enableStatistics: true,
|
enableStatistics: true,
|
||||||
labelsToRemoveWhenUnstale: '',
|
labelsToRemoveWhenUnstale: '',
|
||||||
labelsToAddWhenUnstale: '',
|
labelsToAddWhenUnstale: '',
|
||||||
ignoreUpdates: false,
|
ignoreIssueUpdates: false,
|
||||||
ignoreIssueUpdates: undefined,
|
ignorePrUpdates: false,
|
||||||
ignorePrUpdates: undefined,
|
|
||||||
exemptDraftPr: false
|
exemptDraftPr: false
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,9 +17,25 @@ describe('ignore-updates options', (): void => {
|
||||||
sut.toIssue().staleIn(10).created(20).updated(5);
|
sut.toIssue().staleIn(10).created(20).updated(5);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore updates option is disabled', (): void => {
|
describe('when the ignore issue updates option is enabled', (): void => {
|
||||||
beforeEach((): void => {
|
beforeEach((): void => {
|
||||||
sut.staleOnUpdates();
|
sut.ignoreIssueUpdates();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should stale the issue', async () => {
|
||||||
|
expect.assertions(3);
|
||||||
|
|
||||||
|
await sut.test();
|
||||||
|
|
||||||
|
expect(sut.processor.staleIssues).toHaveLength(1);
|
||||||
|
expect(sut.processor.closedIssues).toHaveLength(0);
|
||||||
|
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('when the ignore issue updates option is disabled', (): void => {
|
||||||
|
beforeEach((): void => {
|
||||||
|
sut.staleOnIssueUpdates();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not stale the issue', async () => {
|
it('should not stale the issue', async () => {
|
||||||
|
@ -31,59 +47,11 @@ describe('ignore-updates options', (): void => {
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
expect(sut.processor.closedIssues).toHaveLength(0);
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore issue updates option is enabled', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
sut.ignoreIssueUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the issue', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the ignore issue updates option is disabled', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
sut.staleOnIssueUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should not stale the issue', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the ignore issue updates option is unset', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
sut.unsetIgnoreIssueUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should not stale the issue', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore updates option is enabled', (): void => {
|
describe('when the ignore issue updates option is enabled', (): void => {
|
||||||
beforeEach((): void => {
|
beforeEach((): void => {
|
||||||
sut.ignoreUpdates();
|
sut.ignoreIssueUpdates();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should stale the issue', async () => {
|
it('should stale the issue', async () => {
|
||||||
|
@ -95,53 +63,21 @@ describe('ignore-updates options', (): void => {
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
expect(sut.processor.closedIssues).toHaveLength(0);
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('when the ignore issue updates option is enabled', (): void => {
|
describe('when the ignore issue updates option is disabled', (): void => {
|
||||||
beforeEach((): void => {
|
beforeEach((): void => {
|
||||||
sut.ignoreIssueUpdates();
|
sut.staleOnIssueUpdates();
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the issue', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore issue updates option is disabled', (): void => {
|
it('should not stale the issue', async () => {
|
||||||
beforeEach((): void => {
|
expect.assertions(3);
|
||||||
sut.staleOnIssueUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should not stale the issue', async () => {
|
await sut.test();
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
expect(sut.processor.staleIssues).toHaveLength(0);
|
||||||
|
expect(sut.processor.closedIssues).toHaveLength(0);
|
||||||
expect(sut.processor.staleIssues).toHaveLength(0);
|
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the ignore issue updates option is unset', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
sut.unsetIgnoreIssueUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the issue', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -151,9 +87,9 @@ describe('ignore-updates options', (): void => {
|
||||||
sut.toIssue().staleIn(10).created(20).updated(15);
|
sut.toIssue().staleIn(10).created(20).updated(15);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore updates option is disabled', (): void => {
|
describe('when the ignore issue updates option is enabled', (): void => {
|
||||||
beforeEach((): void => {
|
beforeEach((): void => {
|
||||||
sut.staleOnUpdates();
|
sut.ignoreIssueUpdates();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should stale the issue', async () => {
|
it('should stale the issue', async () => {
|
||||||
|
@ -165,59 +101,11 @@ describe('ignore-updates options', (): void => {
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
expect(sut.processor.closedIssues).toHaveLength(0);
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore issue updates option is enabled', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
sut.ignoreIssueUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the issue', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the ignore issue updates option is disabled', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
sut.staleOnIssueUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the issue', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the ignore issue updates option is unset', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
sut.unsetIgnoreIssueUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the issue', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore updates option is enabled', (): void => {
|
describe('when the ignore issue updates option is disabled', (): void => {
|
||||||
beforeEach((): void => {
|
beforeEach((): void => {
|
||||||
sut.ignoreUpdates();
|
sut.staleOnIssueUpdates();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should stale the issue', async () => {
|
it('should stale the issue', async () => {
|
||||||
|
@ -229,53 +117,37 @@ describe('ignore-updates options', (): void => {
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
expect(sut.processor.closedIssues).toHaveLength(0);
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('when the ignore issue updates option is enabled', (): void => {
|
describe('when the ignore issue updates option is enabled', (): void => {
|
||||||
beforeEach((): void => {
|
beforeEach((): void => {
|
||||||
sut.ignoreIssueUpdates();
|
sut.ignoreIssueUpdates();
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the issue', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore issue updates option is disabled', (): void => {
|
it('should stale the issue', async () => {
|
||||||
beforeEach((): void => {
|
expect.assertions(3);
|
||||||
sut.staleOnIssueUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the issue', async () => {
|
await sut.test();
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
expect(sut.processor.staleIssues).toHaveLength(1);
|
||||||
|
expect(sut.processor.closedIssues).toHaveLength(0);
|
||||||
|
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
describe('when the ignore issue updates option is disabled', (): void => {
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
beforeEach((): void => {
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
sut.staleOnIssueUpdates();
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore issue updates option is unset', (): void => {
|
it('should stale the issue', async () => {
|
||||||
beforeEach((): void => {
|
expect.assertions(3);
|
||||||
sut.unsetIgnoreIssueUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the issue', async () => {
|
await sut.test();
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
expect(sut.processor.staleIssues).toHaveLength(1);
|
||||||
|
expect(sut.processor.closedIssues).toHaveLength(0);
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -285,9 +157,25 @@ describe('ignore-updates options', (): void => {
|
||||||
sut.toPullRequest().staleIn(10).created(20).updated(5);
|
sut.toPullRequest().staleIn(10).created(20).updated(5);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore updates option is disabled', (): void => {
|
describe('when the ignore pull request updates option is enabled', (): void => {
|
||||||
beforeEach((): void => {
|
beforeEach((): void => {
|
||||||
sut.staleOnUpdates();
|
sut.ignorePullRequestUpdates();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should stale the pull request', async () => {
|
||||||
|
expect.assertions(3);
|
||||||
|
|
||||||
|
await sut.test();
|
||||||
|
|
||||||
|
expect(sut.processor.staleIssues).toHaveLength(1);
|
||||||
|
expect(sut.processor.closedIssues).toHaveLength(0);
|
||||||
|
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('when the ignore pull request updates option is disabled', (): void => {
|
||||||
|
beforeEach((): void => {
|
||||||
|
sut.staleOnPullRequestUpdates();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not stale the pull request', async () => {
|
it('should not stale the pull request', async () => {
|
||||||
|
@ -299,59 +187,11 @@ describe('ignore-updates options', (): void => {
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
expect(sut.processor.closedIssues).toHaveLength(0);
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore pull request updates option is enabled', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
sut.ignorePullRequestUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the pull request', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the ignore pull request updates option is disabled', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
sut.staleOnPullRequestUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should not stale the pull request', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the ignore pull request updates option is unset', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
sut.unsetIgnorePullRequestUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should not stale the pull request', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore updates option is enabled', (): void => {
|
describe('when the ignore pull request updates option is enabled', (): void => {
|
||||||
beforeEach((): void => {
|
beforeEach((): void => {
|
||||||
sut.ignoreUpdates();
|
sut.ignorePullRequestUpdates();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should stale the pull request', async () => {
|
it('should stale the pull request', async () => {
|
||||||
|
@ -363,53 +203,21 @@ describe('ignore-updates options', (): void => {
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
expect(sut.processor.closedIssues).toHaveLength(0);
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('when the ignore pull request updates option is enabled', (): void => {
|
describe('when the ignore pull request updates option is disabled', (): void => {
|
||||||
beforeEach((): void => {
|
beforeEach((): void => {
|
||||||
sut.ignorePullRequestUpdates();
|
sut.staleOnPullRequestUpdates();
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the pull request', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore pull request updates option is disabled', (): void => {
|
it('should not stale the pull request', async () => {
|
||||||
beforeEach((): void => {
|
expect.assertions(3);
|
||||||
sut.staleOnPullRequestUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should not stale the pull request', async () => {
|
await sut.test();
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
expect(sut.processor.staleIssues).toHaveLength(0);
|
||||||
|
expect(sut.processor.closedIssues).toHaveLength(0);
|
||||||
expect(sut.processor.staleIssues).toHaveLength(0);
|
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the ignore pull request updates option is unset', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
sut.unsetIgnorePullRequestUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the pull request', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -419,9 +227,9 @@ describe('ignore-updates options', (): void => {
|
||||||
sut.toPullRequest().staleIn(10).created(20).updated(15);
|
sut.toPullRequest().staleIn(10).created(20).updated(15);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore updates option is disabled', (): void => {
|
describe('when the ignore pull request updates option is enabled', (): void => {
|
||||||
beforeEach((): void => {
|
beforeEach((): void => {
|
||||||
sut.staleOnUpdates();
|
sut.ignorePullRequestUpdates();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should stale the pull request', async () => {
|
it('should stale the pull request', async () => {
|
||||||
|
@ -433,59 +241,11 @@ describe('ignore-updates options', (): void => {
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
expect(sut.processor.closedIssues).toHaveLength(0);
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore pull request updates option is enabled', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
sut.ignorePullRequestUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the pull request', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the ignore pull request updates option is disabled', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
sut.staleOnPullRequestUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the pull request', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the ignore pull request updates option is unset', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
sut.unsetIgnorePullRequestUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the pull request', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore updates option is enabled', (): void => {
|
describe('when the ignore pull request updates option is disabled', (): void => {
|
||||||
beforeEach((): void => {
|
beforeEach((): void => {
|
||||||
sut.ignoreUpdates();
|
sut.staleOnPullRequestUpdates();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should stale the pull request', async () => {
|
it('should stale the pull request', async () => {
|
||||||
|
@ -497,53 +257,37 @@ describe('ignore-updates options', (): void => {
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
expect(sut.processor.closedIssues).toHaveLength(0);
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('when the ignore pull request updates option is enabled', (): void => {
|
describe('when the ignore pull request updates option is enabled', (): void => {
|
||||||
beforeEach((): void => {
|
beforeEach((): void => {
|
||||||
sut.ignorePullRequestUpdates();
|
sut.ignorePullRequestUpdates();
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the pull request', async () => {
|
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore pull request updates option is disabled', (): void => {
|
it('should stale the pull request', async () => {
|
||||||
beforeEach((): void => {
|
expect.assertions(3);
|
||||||
sut.staleOnPullRequestUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the pull request', async () => {
|
await sut.test();
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
expect(sut.processor.staleIssues).toHaveLength(1);
|
||||||
|
expect(sut.processor.closedIssues).toHaveLength(0);
|
||||||
|
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
describe('when the ignore pull request updates option is disabled', (): void => {
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
beforeEach((): void => {
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
sut.staleOnPullRequestUpdates();
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the ignore pull request updates option is unset', (): void => {
|
it('should stale the pull request', async () => {
|
||||||
beforeEach((): void => {
|
expect.assertions(3);
|
||||||
sut.unsetIgnorePullRequestUpdates();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should stale the pull request', async () => {
|
await sut.test();
|
||||||
expect.assertions(3);
|
|
||||||
|
|
||||||
await sut.test();
|
expect(sut.processor.staleIssues).toHaveLength(1);
|
||||||
|
expect(sut.processor.closedIssues).toHaveLength(0);
|
||||||
expect(sut.processor.staleIssues).toHaveLength(1);
|
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
||||||
expect(sut.processor.closedIssues).toHaveLength(0);
|
|
||||||
expect(sut.processor.removedLabelIssues).toHaveLength(0);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -594,22 +338,6 @@ class SUT {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
ignoreUpdates(): SUT {
|
|
||||||
this._updateOptions({
|
|
||||||
ignoreUpdates: true
|
|
||||||
});
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
staleOnUpdates(): SUT {
|
|
||||||
this._updateOptions({
|
|
||||||
ignoreUpdates: false
|
|
||||||
});
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
ignoreIssueUpdates(): SUT {
|
ignoreIssueUpdates(): SUT {
|
||||||
this._updateOptions({
|
this._updateOptions({
|
||||||
ignoreIssueUpdates: true
|
ignoreIssueUpdates: true
|
||||||
|
@ -626,14 +354,6 @@ class SUT {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsetIgnoreIssueUpdates(): SUT {
|
|
||||||
this._updateOptions({
|
|
||||||
ignoreIssueUpdates: undefined
|
|
||||||
});
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
ignorePullRequestUpdates(): SUT {
|
ignorePullRequestUpdates(): SUT {
|
||||||
this._updateOptions({
|
this._updateOptions({
|
||||||
ignorePrUpdates: true
|
ignorePrUpdates: true
|
||||||
|
@ -650,14 +370,6 @@ class SUT {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsetIgnorePullRequestUpdates(): SUT {
|
|
||||||
this._updateOptions({
|
|
||||||
ignorePrUpdates: undefined
|
|
||||||
});
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
async test(): Promise<number> {
|
async test(): Promise<number> {
|
||||||
return this._setTestIssueList()._setProcessor();
|
return this._setTestIssueList()._setProcessor();
|
||||||
}
|
}
|
||||||
|
|
12
action.yml
12
action.yml
|
@ -180,17 +180,13 @@ inputs:
|
||||||
description: 'A comma delimited list of labels to remove when a stale issue or pull request receives activity and has the stale-issue-label or stale-pr-label removed from it.'
|
description: 'A comma delimited list of labels to remove when a stale issue or pull request receives activity and has the stale-issue-label or stale-pr-label removed from it.'
|
||||||
default: ''
|
default: ''
|
||||||
required: false
|
required: false
|
||||||
ignore-updates:
|
ignore-issue-updates:
|
||||||
description: 'Any update (update/comment) can reset the stale idle time on the issues and pull requests.'
|
description: 'Any update (update/comment) can reset the stale idle time on the issues.'
|
||||||
default: 'false'
|
default: 'false'
|
||||||
required: false
|
required: false
|
||||||
ignore-issue-updates:
|
|
||||||
description: 'Any update (update/comment) can reset the stale idle time on the issues. Override "ignore-updates" option regarding only the issues.'
|
|
||||||
default: ''
|
|
||||||
required: false
|
|
||||||
ignore-pr-updates:
|
ignore-pr-updates:
|
||||||
description: 'Any update (update/comment) can reset the stale idle time on the pull requests. Override "ignore-updates" option regarding only the pull requests.'
|
description: 'Any update (update/comment) can reset the stale idle time on the pull requests.'
|
||||||
default: ''
|
default: 'false'
|
||||||
required: false
|
required: false
|
||||||
outputs:
|
outputs:
|
||||||
closed-issues-prs:
|
closed-issues-prs:
|
||||||
|
|
|
@ -25,111 +25,67 @@ describe('IgnoreUpdates', (): void => {
|
||||||
issueInterface.pull_request = undefined;
|
issueInterface.pull_request = undefined;
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the given options are configured to reset the stale on updates', (): void => {
|
describe('when the given options are configured to reset the issue stale on updates', (): void => {
|
||||||
beforeEach((): void => {
|
beforeEach((): void => {
|
||||||
optionsInterface.ignoreUpdates = false;
|
optionsInterface.ignoreIssueUpdates = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the given options are not configured to reset the issue stale on updates', (): void => {
|
it('should return false', (): void => {
|
||||||
beforeEach((): void => {
|
expect.assertions(1);
|
||||||
delete optionsInterface.ignoreIssueUpdates;
|
issue = new Issue(optionsInterface, issueInterface);
|
||||||
});
|
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
||||||
|
|
||||||
it('should return false', (): void => {
|
const result = ignoreUpdates.shouldIgnoreUpdates();
|
||||||
expect.assertions(1);
|
|
||||||
issue = new Issue(optionsInterface, issueInterface);
|
|
||||||
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
|
||||||
|
|
||||||
const result = ignoreUpdates.shouldIgnoreUpdates();
|
expect(result).toStrictEqual(false);
|
||||||
|
|
||||||
expect(result).toStrictEqual(false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the given options are configured to reset the issue stale on updates', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
optionsInterface.ignoreIssueUpdates = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return false', (): void => {
|
|
||||||
expect.assertions(1);
|
|
||||||
issue = new Issue(optionsInterface, issueInterface);
|
|
||||||
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
|
||||||
|
|
||||||
const result = ignoreUpdates.shouldIgnoreUpdates();
|
|
||||||
|
|
||||||
expect(result).toStrictEqual(false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the given options are configured to not reset the issue stale on updates', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
optionsInterface.ignoreIssueUpdates = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return true', (): void => {
|
|
||||||
expect.assertions(1);
|
|
||||||
issue = new Issue(optionsInterface, issueInterface);
|
|
||||||
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
|
||||||
|
|
||||||
const result = ignoreUpdates.shouldIgnoreUpdates();
|
|
||||||
|
|
||||||
expect(result).toStrictEqual(true);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the given options are configured to reset the stale on updates', (): void => {
|
describe('when the given options are configured to not reset the issue stale on updates', (): void => {
|
||||||
beforeEach((): void => {
|
beforeEach((): void => {
|
||||||
optionsInterface.ignoreUpdates = true;
|
optionsInterface.ignoreIssueUpdates = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the given options are not configured to reset the issue stale on updates', (): void => {
|
it('should return true', (): void => {
|
||||||
beforeEach((): void => {
|
expect.assertions(1);
|
||||||
delete optionsInterface.ignoreIssueUpdates;
|
issue = new Issue(optionsInterface, issueInterface);
|
||||||
});
|
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
||||||
|
|
||||||
it('should return true', (): void => {
|
const result = ignoreUpdates.shouldIgnoreUpdates();
|
||||||
expect.assertions(1);
|
|
||||||
issue = new Issue(optionsInterface, issueInterface);
|
|
||||||
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
|
||||||
|
|
||||||
const result = ignoreUpdates.shouldIgnoreUpdates();
|
expect(result).toStrictEqual(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
expect(result).toStrictEqual(true);
|
describe('when the given options are configured to reset the issue stale on updates', (): void => {
|
||||||
});
|
beforeEach((): void => {
|
||||||
|
optionsInterface.ignoreIssueUpdates = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the given options are configured to reset the issue stale on updates', (): void => {
|
it('should return false', (): void => {
|
||||||
beforeEach((): void => {
|
expect.assertions(1);
|
||||||
optionsInterface.ignoreIssueUpdates = false;
|
issue = new Issue(optionsInterface, issueInterface);
|
||||||
});
|
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
||||||
|
|
||||||
it('should return false', (): void => {
|
const result = ignoreUpdates.shouldIgnoreUpdates();
|
||||||
expect.assertions(1);
|
|
||||||
issue = new Issue(optionsInterface, issueInterface);
|
|
||||||
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
|
||||||
|
|
||||||
const result = ignoreUpdates.shouldIgnoreUpdates();
|
expect(result).toStrictEqual(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
expect(result).toStrictEqual(false);
|
describe('when the given options are configured to not reset the issue stale on updates', (): void => {
|
||||||
});
|
beforeEach((): void => {
|
||||||
|
optionsInterface.ignoreIssueUpdates = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the given options are configured to not reset the issue stale on updates', (): void => {
|
it('should return true', (): void => {
|
||||||
beforeEach((): void => {
|
expect.assertions(1);
|
||||||
optionsInterface.ignoreIssueUpdates = true;
|
issue = new Issue(optionsInterface, issueInterface);
|
||||||
});
|
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
||||||
|
|
||||||
it('should return true', (): void => {
|
const result = ignoreUpdates.shouldIgnoreUpdates();
|
||||||
expect.assertions(1);
|
|
||||||
issue = new Issue(optionsInterface, issueInterface);
|
|
||||||
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
|
||||||
|
|
||||||
const result = ignoreUpdates.shouldIgnoreUpdates();
|
expect(result).toStrictEqual(true);
|
||||||
|
|
||||||
expect(result).toStrictEqual(true);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -139,111 +95,67 @@ describe('IgnoreUpdates', (): void => {
|
||||||
issueInterface.pull_request = {};
|
issueInterface.pull_request = {};
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the given options are configured to reset the stale on updates', (): void => {
|
describe('when the given options are configured to reset the pull request stale on updates', (): void => {
|
||||||
beforeEach((): void => {
|
beforeEach((): void => {
|
||||||
optionsInterface.ignoreUpdates = false;
|
optionsInterface.ignorePrUpdates = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the given options are not configured to reset the pull request stale on updates', (): void => {
|
it('should return false', (): void => {
|
||||||
beforeEach((): void => {
|
expect.assertions(1);
|
||||||
delete optionsInterface.ignorePrUpdates;
|
issue = new Issue(optionsInterface, issueInterface);
|
||||||
});
|
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
||||||
|
|
||||||
it('should return false', (): void => {
|
const result = ignoreUpdates.shouldIgnoreUpdates();
|
||||||
expect.assertions(1);
|
|
||||||
issue = new Issue(optionsInterface, issueInterface);
|
|
||||||
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
|
||||||
|
|
||||||
const result = ignoreUpdates.shouldIgnoreUpdates();
|
expect(result).toStrictEqual(false);
|
||||||
|
|
||||||
expect(result).toStrictEqual(false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the given options are configured to reset the pull request stale on updates', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
optionsInterface.ignorePrUpdates = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return false', (): void => {
|
|
||||||
expect.assertions(1);
|
|
||||||
issue = new Issue(optionsInterface, issueInterface);
|
|
||||||
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
|
||||||
|
|
||||||
const result = ignoreUpdates.shouldIgnoreUpdates();
|
|
||||||
|
|
||||||
expect(result).toStrictEqual(false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when the given options are configured to not reset the pull request stale on updates', (): void => {
|
|
||||||
beforeEach((): void => {
|
|
||||||
optionsInterface.ignorePrUpdates = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return true', (): void => {
|
|
||||||
expect.assertions(1);
|
|
||||||
issue = new Issue(optionsInterface, issueInterface);
|
|
||||||
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
|
||||||
|
|
||||||
const result = ignoreUpdates.shouldIgnoreUpdates();
|
|
||||||
|
|
||||||
expect(result).toStrictEqual(true);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the given options are configured to not reset the stale on updates', (): void => {
|
describe('when the given options are configured to not reset the pull request stale on updates', (): void => {
|
||||||
beforeEach((): void => {
|
beforeEach((): void => {
|
||||||
optionsInterface.ignoreUpdates = true;
|
optionsInterface.ignorePrUpdates = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the given options are not configured to reset the pull request stale on updates', (): void => {
|
it('should return true', (): void => {
|
||||||
beforeEach((): void => {
|
expect.assertions(1);
|
||||||
delete optionsInterface.ignorePrUpdates;
|
issue = new Issue(optionsInterface, issueInterface);
|
||||||
});
|
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
||||||
|
|
||||||
it('should return true', (): void => {
|
const result = ignoreUpdates.shouldIgnoreUpdates();
|
||||||
expect.assertions(1);
|
|
||||||
issue = new Issue(optionsInterface, issueInterface);
|
|
||||||
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
|
||||||
|
|
||||||
const result = ignoreUpdates.shouldIgnoreUpdates();
|
expect(result).toStrictEqual(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
expect(result).toStrictEqual(true);
|
describe('when the given options are configured to reset the pull request stale on updates', (): void => {
|
||||||
});
|
beforeEach((): void => {
|
||||||
|
optionsInterface.ignorePrUpdates = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the given options are configured to reset the pull request stale on updates', (): void => {
|
it('should return false', (): void => {
|
||||||
beforeEach((): void => {
|
expect.assertions(1);
|
||||||
optionsInterface.ignorePrUpdates = false;
|
issue = new Issue(optionsInterface, issueInterface);
|
||||||
});
|
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
||||||
|
|
||||||
it('should return false', (): void => {
|
const result = ignoreUpdates.shouldIgnoreUpdates();
|
||||||
expect.assertions(1);
|
|
||||||
issue = new Issue(optionsInterface, issueInterface);
|
|
||||||
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
|
||||||
|
|
||||||
const result = ignoreUpdates.shouldIgnoreUpdates();
|
expect(result).toStrictEqual(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
expect(result).toStrictEqual(false);
|
describe('when the given options are configured to not reset the pull request stale on updates', (): void => {
|
||||||
});
|
beforeEach((): void => {
|
||||||
|
optionsInterface.ignorePrUpdates = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when the given options are configured to not reset the pull request stale on updates', (): void => {
|
it('should return true', (): void => {
|
||||||
beforeEach((): void => {
|
expect.assertions(1);
|
||||||
optionsInterface.ignorePrUpdates = true;
|
issue = new Issue(optionsInterface, issueInterface);
|
||||||
});
|
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
||||||
|
|
||||||
it('should return true', (): void => {
|
const result = ignoreUpdates.shouldIgnoreUpdates();
|
||||||
expect.assertions(1);
|
|
||||||
issue = new Issue(optionsInterface, issueInterface);
|
|
||||||
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
|
|
||||||
|
|
||||||
const result = ignoreUpdates.shouldIgnoreUpdates();
|
expect(result).toStrictEqual(true);
|
||||||
|
|
||||||
expect(result).toStrictEqual(true);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -25,7 +25,7 @@ export class IgnoreUpdates {
|
||||||
}
|
}
|
||||||
|
|
||||||
private _shouldIgnorePullRequestUpdates(): boolean {
|
private _shouldIgnorePullRequestUpdates(): boolean {
|
||||||
if (this._options.ignorePrUpdates === true) {
|
if (this._options.ignorePrUpdates) {
|
||||||
this._issueLogger.info(
|
this._issueLogger.info(
|
||||||
`The option ${this._issueLogger.createOptionLink(
|
`The option ${this._issueLogger.createOptionLink(
|
||||||
Option.IgnorePrUpdates
|
Option.IgnorePrUpdates
|
||||||
|
@ -33,23 +33,19 @@ export class IgnoreUpdates {
|
||||||
);
|
);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else if (this._options.ignorePrUpdates === false) {
|
|
||||||
this._issueLogger.info(
|
|
||||||
`The option ${this._issueLogger.createOptionLink(
|
|
||||||
Option.IgnorePrUpdates
|
|
||||||
)} is disabled. The stale counter will take into account updates and comments on this $$type to avoid to stale when there is some update`
|
|
||||||
);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this._logIgnoreUpdates();
|
this._issueLogger.info(
|
||||||
|
`The option ${this._issueLogger.createOptionLink(
|
||||||
|
Option.IgnorePrUpdates
|
||||||
|
)} is disabled. The stale counter will take into account updates and comments on this $$type to avoid to stale when there is some update`
|
||||||
|
);
|
||||||
|
|
||||||
return this._options.ignoreUpdates;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _shouldIgnoreIssueUpdates(): boolean {
|
private _shouldIgnoreIssueUpdates(): boolean {
|
||||||
if (this._options.ignoreIssueUpdates === true) {
|
if (this._options.ignoreIssueUpdates) {
|
||||||
this._issueLogger.info(
|
this._issueLogger.info(
|
||||||
`The option ${this._issueLogger.createOptionLink(
|
`The option ${this._issueLogger.createOptionLink(
|
||||||
Option.IgnoreIssueUpdates
|
Option.IgnoreIssueUpdates
|
||||||
|
@ -57,34 +53,14 @@ export class IgnoreUpdates {
|
||||||
);
|
);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else if (this._options.ignoreIssueUpdates === false) {
|
|
||||||
this._issueLogger.info(
|
|
||||||
`The option ${this._issueLogger.createOptionLink(
|
|
||||||
Option.IgnoreIssueUpdates
|
|
||||||
)} is disabled. The stale counter will take into account updates and comments on this $$type to avoid to stale when there is some update`
|
|
||||||
);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this._logIgnoreUpdates();
|
this._issueLogger.info(
|
||||||
|
`The option ${this._issueLogger.createOptionLink(
|
||||||
|
Option.IgnoreIssueUpdates
|
||||||
|
)} is disabled. The stale counter will take into account updates and comments on this $$type to avoid to stale when there is some update`
|
||||||
|
);
|
||||||
|
|
||||||
return this._options.ignoreUpdates;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
private _logIgnoreUpdates(): void {
|
|
||||||
if (this._options.ignoreUpdates) {
|
|
||||||
this._issueLogger.info(
|
|
||||||
`The option ${this._issueLogger.createOptionLink(
|
|
||||||
Option.IgnoreUpdates
|
|
||||||
)} is enabled. The stale counter will ignore any updates or comments on this $$type and will use the creation date as a reference ignoring any kind of update`
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
this._issueLogger.info(
|
|
||||||
`The option ${this._issueLogger.createOptionLink(
|
|
||||||
Option.IgnoreUpdates
|
|
||||||
)} is disabled. The stale counter will take into account updates and comments on this $$type to avoid to stale when there is some update`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,9 +58,8 @@ describe('Issue', (): void => {
|
||||||
enableStatistics: false,
|
enableStatistics: false,
|
||||||
labelsToRemoveWhenUnstale: '',
|
labelsToRemoveWhenUnstale: '',
|
||||||
labelsToAddWhenUnstale: '',
|
labelsToAddWhenUnstale: '',
|
||||||
ignoreUpdates: false,
|
ignoreIssueUpdates: false,
|
||||||
ignoreIssueUpdates: undefined,
|
ignorePrUpdates: false,
|
||||||
ignorePrUpdates: undefined,
|
|
||||||
exemptDraftPr: false
|
exemptDraftPr: false
|
||||||
};
|
};
|
||||||
issueInterface = {
|
issueInterface = {
|
||||||
|
|
|
@ -43,7 +43,6 @@ export enum Option {
|
||||||
EnableStatistics = 'enable-statistics',
|
EnableStatistics = 'enable-statistics',
|
||||||
LabelsToRemoveWhenUnstale = 'labels-to-remove-when-unstale',
|
LabelsToRemoveWhenUnstale = 'labels-to-remove-when-unstale',
|
||||||
LabelsToAddWhenUnstale = 'labels-to-add-when-unstale',
|
LabelsToAddWhenUnstale = 'labels-to-add-when-unstale',
|
||||||
IgnoreUpdates = 'ignore-updates',
|
|
||||||
IgnoreIssueUpdates = 'ignore-issue-updates',
|
IgnoreIssueUpdates = 'ignore-issue-updates',
|
||||||
IgnorePrUpdates = 'ignore-pr-updates',
|
IgnorePrUpdates = 'ignore-pr-updates',
|
||||||
ExemptDraftPr = 'exempt-draft-pr'
|
ExemptDraftPr = 'exempt-draft-pr'
|
||||||
|
|
|
@ -47,8 +47,7 @@ export interface IIssuesProcessorOptions {
|
||||||
enableStatistics: boolean;
|
enableStatistics: boolean;
|
||||||
labelsToRemoveWhenUnstale: string;
|
labelsToRemoveWhenUnstale: string;
|
||||||
labelsToAddWhenUnstale: string;
|
labelsToAddWhenUnstale: string;
|
||||||
ignoreUpdates: boolean;
|
ignoreIssueUpdates: boolean;
|
||||||
ignoreIssueUpdates: boolean | undefined;
|
ignorePrUpdates: boolean;
|
||||||
ignorePrUpdates: boolean | undefined;
|
|
||||||
exemptDraftPr: boolean;
|
exemptDraftPr: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,9 +84,8 @@ function _getAndValidateArgs(): IIssuesProcessorOptions {
|
||||||
enableStatistics: core.getInput('enable-statistics') === 'true',
|
enableStatistics: core.getInput('enable-statistics') === 'true',
|
||||||
labelsToRemoveWhenUnstale: core.getInput('labels-to-remove-when-unstale'),
|
labelsToRemoveWhenUnstale: core.getInput('labels-to-remove-when-unstale'),
|
||||||
labelsToAddWhenUnstale: core.getInput('labels-to-add-when-unstale'),
|
labelsToAddWhenUnstale: core.getInput('labels-to-add-when-unstale'),
|
||||||
ignoreUpdates: core.getInput('ignore-updates') === 'true',
|
ignoreIssueUpdates: core.getInput('ignore-issue-updates') === 'true',
|
||||||
ignoreIssueUpdates: _toOptionalBoolean('ignore-issue-updates'),
|
ignorePrUpdates: core.getInput('ignore-pr-updates') === 'true',
|
||||||
ignorePrUpdates: _toOptionalBoolean('ignore-pr-updates'),
|
|
||||||
exemptDraftPr: core.getInput('exempt-draft-pr') === 'true'
|
exemptDraftPr: core.getInput('exempt-draft-pr') === 'true'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue