From 3021a55a474c219cbc4062c884a436817818baa1 Mon Sep 17 00:00:00 2001 From: TESTELIN Geoffrey Date: Fri, 8 Oct 2021 18:06:39 +0200 Subject: [PATCH 01/11] feat: remove the ignore-updates option BREAKING CHANGE: The option ignore-updates was removed --- README.md | 122 +++-- .../constants/default-processor-options.ts | 5 +- __tests__/updates-reset-stale.spec.ts | 488 ++++-------------- action.yml | 12 +- src/classes/ignore-updates.spec.ts | 414 ++++++--------- src/classes/ignore-updates.ts | 156 +++--- src/classes/issue.spec.ts | 5 +- src/enums/option.ts | 1 - src/interfaces/issues-processor-options.ts | 5 +- src/main.ts | 5 +- 10 files changed, 400 insertions(+), 813 deletions(-) diff --git a/README.md b/README.md index 7578edd20..12dbbf40d 100644 --- a/README.md +++ b/README.md @@ -28,58 +28,57 @@ You can find more information about the required permissions under the correspon Every argument is optional. -| Input | Description | Default | -| ------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------- | -| [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-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-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-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-pr-message](#stale-pr-message) | Comment on the staled PRs | | -| [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 | | -| [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 | | -| [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 | | -| [exempt-issue-labels](#exempt-issue-labels) | Labels on issues 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-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 | | -| [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-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` | -| [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-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-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` | -| [ascending](#ascending) | Order to get issues/PRs | `false` | -| [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` | -| [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-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-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-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-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-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-draft-pr](#exempt-draft-pr) | Skip the stale action for draft PRs | `false` | -| [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) | Override [ignore-updates](#ignore-updates) for issues only | | -| [ignore-pr-updates](#ignore-pr-updates) | Override [ignore-updates](#ignore-updates) for PRs only | | +| Input | Description | Default | +| ------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------- | +| [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-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-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-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-pr-message](#stale-pr-message) | Comment on the staled PRs | | +| [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 | | +| [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 | | +| [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 | | +| [exempt-issue-labels](#exempt-issue-labels) | Labels on issues 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-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 | | +| [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-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` | +| [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-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-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` | +| [ascending](#ascending) | Order to get issues/PRs | `false` | +| [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` | +| [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-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-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-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-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-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-draft-pr](#exempt-draft-pr) | Skip the stale action for draft PRs | `false` | +| [enable-statistics](#enable-statistics) | Display statistics in the logs | `true` | +| [ignore-issue-updates](#ignore-issue-updates) | Any update (update/comment) can reset the stale idle time on the issues | | +| [ignore-pr-updates](#ignore-pr-updates) | Any update (update/comment) can reset the stale idle time on the PRs | | ### 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 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. -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. 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-assignees](#exempt-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` @@ -488,7 +488,7 @@ This option is only useful if the debug output secret `ACTIONS_STEP_DEBUG` is se 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. 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` -#### 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 -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 diff --git a/__tests__/constants/default-processor-options.ts b/__tests__/constants/default-processor-options.ts index b526d12aa..92fe08a6f 100644 --- a/__tests__/constants/default-processor-options.ts +++ b/__tests__/constants/default-processor-options.ts @@ -47,8 +47,7 @@ export const DefaultProcessorOptions: IIssuesProcessorOptions = Object.freeze({ enableStatistics: true, labelsToRemoveWhenUnstale: '', labelsToAddWhenUnstale: '', - ignoreUpdates: false, - ignoreIssueUpdates: undefined, - ignorePrUpdates: undefined, + ignoreIssueUpdates: false, + ignorePrUpdates: false, exemptDraftPr: false }); diff --git a/__tests__/updates-reset-stale.spec.ts b/__tests__/updates-reset-stale.spec.ts index 11865ecf1..a68968415 100644 --- a/__tests__/updates-reset-stale.spec.ts +++ b/__tests__/updates-reset-stale.spec.ts @@ -17,73 +17,41 @@ describe('ignore-updates options', (): void => { 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 => { - sut.staleOnUpdates(); + sut.ignoreIssueUpdates(); }); - it('should not stale the issue', async () => { + it('should stale the issue', async () => { expect.assertions(3); await sut.test(); - expect(sut.processor.staleIssues).toHaveLength(0); + 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 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 disabled', (): void => { + beforeEach((): void => { + sut.staleOnIssueUpdates(); }); - describe('when the ignore issue updates option is unset', (): void => { - beforeEach((): void => { - sut.unsetIgnoreIssueUpdates(); - }); - - it('should not stale the issue', async () => { - expect.assertions(3); + it('should not stale the issue', async () => { + expect.assertions(3); - await sut.test(); + await sut.test(); - expect(sut.processor.staleIssues).toHaveLength(0); - expect(sut.processor.closedIssues).toHaveLength(0); - expect(sut.processor.removedLabelIssues).toHaveLength(0); - }); + 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 => { - sut.ignoreUpdates(); + sut.ignoreIssueUpdates(); }); it('should stale the issue', async () => { @@ -95,53 +63,21 @@ describe('ignore-updates options', (): void => { expect(sut.processor.closedIssues).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 disabled', (): void => { + beforeEach((): void => { + sut.staleOnIssueUpdates(); }); - describe('when the ignore issue updates option is unset', (): void => { - beforeEach((): void => { - sut.unsetIgnoreIssueUpdates(); - }); - - it('should stale the issue', async () => { - expect.assertions(3); + it('should not stale the issue', async () => { + expect.assertions(3); - await sut.test(); + 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(0); + 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); }); - describe('when the ignore updates option is disabled', (): void => { + describe('when the ignore issue updates option is enabled', (): void => { beforeEach((): void => { - sut.staleOnUpdates(); + sut.ignoreIssueUpdates(); }); it('should stale the issue', async () => { @@ -165,59 +101,27 @@ describe('ignore-updates options', (): void => { expect(sut.processor.closedIssues).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 disabled', (): void => { + beforeEach((): void => { + sut.staleOnIssueUpdates(); }); - describe('when the ignore issue updates option is unset', (): void => { - beforeEach((): void => { - sut.unsetIgnoreIssueUpdates(); - }); - - it('should stale the issue', async () => { - expect.assertions(3); + it('should stale the issue', async () => { + expect.assertions(3); - await sut.test(); + 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); + 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 => { - sut.ignoreUpdates(); + sut.ignoreIssueUpdates(); }); it('should stale the issue', async () => { @@ -229,53 +133,21 @@ describe('ignore-updates options', (): void => { expect(sut.processor.closedIssues).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 disabled', (): void => { + beforeEach((): void => { + sut.staleOnIssueUpdates(); }); - describe('when the ignore issue updates option is unset', (): void => { - beforeEach((): void => { - sut.unsetIgnoreIssueUpdates(); - }); - - it('should stale the issue', async () => { - expect.assertions(3); + it('should stale the issue', async () => { + expect.assertions(3); - await sut.test(); + 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); + expect(sut.processor.closedIssues).toHaveLength(0); + expect(sut.processor.removedLabelIssues).toHaveLength(0); }); }); }); @@ -285,73 +157,41 @@ describe('ignore-updates options', (): void => { 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 => { - sut.staleOnUpdates(); + sut.ignorePullRequestUpdates(); }); - it('should not stale the pull request', async () => { + it('should stale the pull request', async () => { expect.assertions(3); await sut.test(); - expect(sut.processor.staleIssues).toHaveLength(0); + 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 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 disabled', (): void => { + beforeEach((): void => { + sut.staleOnPullRequestUpdates(); }); - 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); + it('should not stale the pull request', async () => { + expect.assertions(3); - await sut.test(); + await sut.test(); - expect(sut.processor.staleIssues).toHaveLength(0); - expect(sut.processor.closedIssues).toHaveLength(0); - expect(sut.processor.removedLabelIssues).toHaveLength(0); - }); + 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 => { - sut.ignoreUpdates(); + sut.ignorePullRequestUpdates(); }); 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.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 disabled', (): void => { + beforeEach((): void => { + sut.staleOnPullRequestUpdates(); }); - 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); + it('should not stale the pull request', async () => { + expect.assertions(3); - await sut.test(); + 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(0); + 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); }); - describe('when the ignore updates option is disabled', (): void => { + describe('when the ignore pull request updates option is enabled', (): void => { beforeEach((): void => { - sut.staleOnUpdates(); + sut.ignorePullRequestUpdates(); }); it('should stale the pull request', async () => { @@ -433,59 +241,27 @@ describe('ignore-updates options', (): void => { expect(sut.processor.closedIssues).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 disabled', (): void => { + beforeEach((): void => { + sut.staleOnPullRequestUpdates(); }); - 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); + it('should stale the pull request', async () => { + expect.assertions(3); - await sut.test(); + 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); + 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 => { - sut.ignoreUpdates(); + sut.ignorePullRequestUpdates(); }); it('should stale the pull request', async () => { @@ -497,53 +273,21 @@ describe('ignore-updates options', (): void => { expect(sut.processor.closedIssues).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 disabled', (): void => { + beforeEach((): void => { + sut.staleOnPullRequestUpdates(); }); - 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); + it('should stale the pull request', async () => { + expect.assertions(3); - await sut.test(); + 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); + expect(sut.processor.closedIssues).toHaveLength(0); + expect(sut.processor.removedLabelIssues).toHaveLength(0); }); }); }); @@ -594,22 +338,6 @@ class SUT { return this; } - ignoreUpdates(): SUT { - this._updateOptions({ - ignoreUpdates: true - }); - - return this; - } - - staleOnUpdates(): SUT { - this._updateOptions({ - ignoreUpdates: false - }); - - return this; - } - ignoreIssueUpdates(): SUT { this._updateOptions({ ignoreIssueUpdates: true @@ -626,14 +354,6 @@ class SUT { return this; } - unsetIgnoreIssueUpdates(): SUT { - this._updateOptions({ - ignoreIssueUpdates: undefined - }); - - return this; - } - ignorePullRequestUpdates(): SUT { this._updateOptions({ ignorePrUpdates: true @@ -650,14 +370,6 @@ class SUT { return this; } - unsetIgnorePullRequestUpdates(): SUT { - this._updateOptions({ - ignorePrUpdates: undefined - }); - - return this; - } - async test(): Promise { return this._setTestIssueList()._setProcessor(); } diff --git a/action.yml b/action.yml index 5cf52fc17..688af75c0 100644 --- a/action.yml +++ b/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.' default: '' required: false - ignore-updates: - description: 'Any update (update/comment) can reset the stale idle time on the issues and pull requests.' - default: '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: '' + description: 'Any update (update/comment) can reset the stale idle time on the issues.' + default: 'false' required: false 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.' - default: '' + description: 'Any update (update/comment) can reset the stale idle time on the pull requests.' + default: 'false' required: false outputs: closed-issues-prs: diff --git a/src/classes/ignore-updates.spec.ts b/src/classes/ignore-updates.spec.ts index 16b8e431c..c8066fbe1 100644 --- a/src/classes/ignore-updates.spec.ts +++ b/src/classes/ignore-updates.spec.ts @@ -1,251 +1,163 @@ -import {DefaultProcessorOptions} from '../../__tests__/constants/default-processor-options'; -import {generateIIssue} from '../../__tests__/functions/generate-iissue'; -import {IIssue} from '../interfaces/issue'; -import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options'; -import {IgnoreUpdates} from './ignore-updates'; -import {Issue} from './issue'; - -describe('IgnoreUpdates', (): void => { - let ignoreUpdates: IgnoreUpdates; - let optionsInterface: IIssuesProcessorOptions; - let issue: Issue; - let issueInterface: IIssue; - - beforeEach((): void => { - optionsInterface = { - ...DefaultProcessorOptions, - ignoreIssueUpdates: true - }; - issueInterface = generateIIssue(); - }); - - describe('shouldIgnoreUpdates()', (): void => { - describe('when the given issue is not a pull request', (): void => { - beforeEach((): void => { - issueInterface.pull_request = undefined; - }); - - describe('when the given options are configured to reset the stale on updates', (): void => { - beforeEach((): void => { - optionsInterface.ignoreUpdates = false; - }); - - describe('when the given options are not configured to reset the issue stale on updates', (): void => { - beforeEach((): void => { - delete optionsInterface.ignoreIssueUpdates; - }); - - 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 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 => { - beforeEach((): void => { - optionsInterface.ignoreUpdates = true; - }); - - describe('when the given options are not configured to reset the issue stale on updates', (): void => { - beforeEach((): void => { - delete optionsInterface.ignoreIssueUpdates; - }); - - 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 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 issue is a pull request', (): void => { - beforeEach((): void => { - issueInterface.pull_request = {}; - }); - - describe('when the given options are configured to reset the stale on updates', (): void => { - beforeEach((): void => { - optionsInterface.ignoreUpdates = false; - }); - - describe('when the given options are not configured to reset the pull request stale on updates', (): void => { - beforeEach((): void => { - delete optionsInterface.ignorePrUpdates; - }); - - 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 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 => { - beforeEach((): void => { - optionsInterface.ignoreUpdates = true; - }); - - describe('when the given options are not configured to reset the pull request stale on updates', (): void => { - beforeEach((): void => { - delete optionsInterface.ignorePrUpdates; - }); - - 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 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); - }); - }); - }); - }); - }); -}); +import {DefaultProcessorOptions} from '../../__tests__/constants/default-processor-options'; +import {generateIIssue} from '../../__tests__/functions/generate-iissue'; +import {IIssue} from '../interfaces/issue'; +import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options'; +import {IgnoreUpdates} from './ignore-updates'; +import {Issue} from './issue'; + +describe('IgnoreUpdates', (): void => { + let ignoreUpdates: IgnoreUpdates; + let optionsInterface: IIssuesProcessorOptions; + let issue: Issue; + let issueInterface: IIssue; + + beforeEach((): void => { + optionsInterface = { + ...DefaultProcessorOptions, + ignoreIssueUpdates: true + }; + issueInterface = generateIIssue(); + }); + + describe('shouldIgnoreUpdates()', (): void => { + describe('when the given issue is not a pull request', (): void => { + beforeEach((): void => { + issueInterface.pull_request = undefined; + }); + + 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 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 issue is a pull request', (): void => { + beforeEach((): void => { + issueInterface.pull_request = {}; + }); + + 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 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); + }); + }); + }); + }); +}); diff --git a/src/classes/ignore-updates.ts b/src/classes/ignore-updates.ts index fa87fb16b..95448e611 100644 --- a/src/classes/ignore-updates.ts +++ b/src/classes/ignore-updates.ts @@ -1,90 +1,66 @@ -import {Option} from '../enums/option'; -import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options'; -import {Issue} from './issue'; -import {IssueLogger} from './loggers/issue-logger'; - -export class IgnoreUpdates { - private readonly _options: IIssuesProcessorOptions; - private readonly _issue: Issue; - private readonly _issueLogger: IssueLogger; - - constructor(options: Readonly, issue: Issue) { - this._options = options; - this._issue = issue; - this._issueLogger = new IssueLogger(issue); - } - - shouldIgnoreUpdates(): boolean { - return this._shouldIgnoreUpdates(); - } - - private _shouldIgnoreUpdates(): boolean { - return this._issue.isPullRequest - ? this._shouldIgnorePullRequestUpdates() - : this._shouldIgnoreIssueUpdates(); - } - - private _shouldIgnorePullRequestUpdates(): boolean { - if (this._options.ignorePrUpdates === true) { - this._issueLogger.info( - `The option ${this._issueLogger.createOptionLink( - Option.IgnorePrUpdates - )} 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` - ); - - 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(); - - return this._options.ignoreUpdates; - } - - private _shouldIgnoreIssueUpdates(): boolean { - if (this._options.ignoreIssueUpdates === true) { - this._issueLogger.info( - `The option ${this._issueLogger.createOptionLink( - Option.IgnoreIssueUpdates - )} 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` - ); - - 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(); - - return this._options.ignoreUpdates; - } - - 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` - ); - } - } -} +import {Option} from '../enums/option'; +import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options'; +import {Issue} from './issue'; +import {IssueLogger} from './loggers/issue-logger'; + +export class IgnoreUpdates { + private readonly _options: IIssuesProcessorOptions; + private readonly _issue: Issue; + private readonly _issueLogger: IssueLogger; + + constructor(options: Readonly, issue: Issue) { + this._options = options; + this._issue = issue; + this._issueLogger = new IssueLogger(issue); + } + + shouldIgnoreUpdates(): boolean { + return this._shouldIgnoreUpdates(); + } + + private _shouldIgnoreUpdates(): boolean { + return this._issue.isPullRequest + ? this._shouldIgnorePullRequestUpdates() + : this._shouldIgnoreIssueUpdates(); + } + + private _shouldIgnorePullRequestUpdates(): boolean { + if (this._options.ignorePrUpdates) { + this._issueLogger.info( + `The option ${this._issueLogger.createOptionLink( + Option.IgnorePrUpdates + )} 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` + ); + + return true; + } + + 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; + } + + private _shouldIgnoreIssueUpdates(): boolean { + if (this._options.ignoreIssueUpdates) { + this._issueLogger.info( + `The option ${this._issueLogger.createOptionLink( + Option.IgnoreIssueUpdates + )} 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` + ); + + return true; + } + + 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; + } +} diff --git a/src/classes/issue.spec.ts b/src/classes/issue.spec.ts index ccd32d51a..6a361e435 100644 --- a/src/classes/issue.spec.ts +++ b/src/classes/issue.spec.ts @@ -58,9 +58,8 @@ describe('Issue', (): void => { enableStatistics: false, labelsToRemoveWhenUnstale: '', labelsToAddWhenUnstale: '', - ignoreUpdates: false, - ignoreIssueUpdates: undefined, - ignorePrUpdates: undefined, + ignoreIssueUpdates: false, + ignorePrUpdates: false, exemptDraftPr: false }; issueInterface = { diff --git a/src/enums/option.ts b/src/enums/option.ts index f7167c725..0705fe510 100644 --- a/src/enums/option.ts +++ b/src/enums/option.ts @@ -43,7 +43,6 @@ export enum Option { EnableStatistics = 'enable-statistics', LabelsToRemoveWhenUnstale = 'labels-to-remove-when-unstale', LabelsToAddWhenUnstale = 'labels-to-add-when-unstale', - IgnoreUpdates = 'ignore-updates', IgnoreIssueUpdates = 'ignore-issue-updates', IgnorePrUpdates = 'ignore-pr-updates', ExemptDraftPr = 'exempt-draft-pr' diff --git a/src/interfaces/issues-processor-options.ts b/src/interfaces/issues-processor-options.ts index 8adbfb4a5..ae55689ce 100644 --- a/src/interfaces/issues-processor-options.ts +++ b/src/interfaces/issues-processor-options.ts @@ -47,8 +47,7 @@ export interface IIssuesProcessorOptions { enableStatistics: boolean; labelsToRemoveWhenUnstale: string; labelsToAddWhenUnstale: string; - ignoreUpdates: boolean; - ignoreIssueUpdates: boolean | undefined; - ignorePrUpdates: boolean | undefined; + ignoreIssueUpdates: boolean; + ignorePrUpdates: boolean; exemptDraftPr: boolean; } diff --git a/src/main.ts b/src/main.ts index af96654c5..6f787cb9f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -84,9 +84,8 @@ function _getAndValidateArgs(): IIssuesProcessorOptions { enableStatistics: core.getInput('enable-statistics') === 'true', labelsToRemoveWhenUnstale: core.getInput('labels-to-remove-when-unstale'), labelsToAddWhenUnstale: core.getInput('labels-to-add-when-unstale'), - ignoreUpdates: core.getInput('ignore-updates') === 'true', - ignoreIssueUpdates: _toOptionalBoolean('ignore-issue-updates'), - ignorePrUpdates: _toOptionalBoolean('ignore-pr-updates'), + ignoreIssueUpdates: core.getInput('ignore-issue-updates') === 'true', + ignorePrUpdates: core.getInput('ignore-pr-updates') === 'true', exemptDraftPr: core.getInput('exempt-draft-pr') === 'true' }; From b80ae639fa691eee108aeb742485ab9a7511ea8b Mon Sep 17 00:00:00 2001 From: TESTELIN Geoffrey Date: Fri, 8 Oct 2021 18:50:37 +0200 Subject: [PATCH 02/11] feat: remove the exempt-all-assignees option BREAKING CHANGE: The option exempt-all-assignees was removed --- README.md | 28 +- __tests__/assignees.spec.ts | 631 ++- .../constants/default-processor-options.ts | 5 +- action.yml | 12 +- dist/index.js | 4242 ++++++++--------- src/classes/assignees.spec.ts | 213 +- src/classes/assignees.ts | 556 ++- src/classes/issue.spec.ts | 5 +- src/enums/option.ts | 1 - src/interfaces/issues-processor-options.ts | 5 +- src/main.ts | 6 +- 11 files changed, 2772 insertions(+), 2932 deletions(-) diff --git a/README.md b/README.md index 12dbbf40d..4cd6f3ddd 100644 --- a/README.md +++ b/README.md @@ -72,13 +72,12 @@ Every argument is optional. | [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-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-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-issue-assignees](#exempt-all-issue-assignees) | Exempt all issues with assignees from stale | `false` | +| [exempt-all-pr-assignees](#exempt-all-pr-assignees) | Exempt all PRs with assignees from stale | `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` | -| [ignore-issue-updates](#ignore-issue-updates) | Any update (update/comment) can reset the stale idle time on the issues | | -| [ignore-pr-updates](#ignore-pr-updates) | Any update (update/comment) can reset the stale idle time on the PRs | | +| [ignore-issue-updates](#ignore-issue-updates) | Any update (update/comment) can reset the stale idle time on the issues | `false` | +| [ignore-pr-updates](#ignore-pr-updates) | Any update (update/comment) can reset the stale idle time on the PRs | `false` | ### List of output options @@ -126,7 +125,8 @@ You can fine tune which issues or pull requests should be marked as stale based - [exempt-milestones](#exempt-milestones) - [exempt-all-milestones](#exempt-all-milestones) - [exempt-assignees](#exempt-assignees) -- [exempt-all-assignees](#exempt-all-assignees) +- [exempt-all-issue-assignees](#exempt-all-issue-assignees) +- [exempt-all-pr-assignees](#exempt-all-pr-assignees) - [ignore-issue-updates](#ignore-issue-updates) - [ignore-pr-updates](#ignore-pr-updates) @@ -453,25 +453,21 @@ Override [exempt-assignees](#exempt-assignees) but only to process the pull requ Default value: unset -#### exempt-all-assignees +#### exempt-all-issue-assignees -If set to `true`, the issues or the pull requests with an assignee will not be marked as stale automatically. +If set to `true`, the issues with an assignee will not be marked as stale automatically. Priority over [exempt-assignees](#exempt-assignees). Default value: `false` -#### exempt-all-issue-assignees - -Override [exempt-all-assignees](#exempt-all-assignees) but only to exempt the issues with an assignee to be marked as stale automatically. - -Default value: unset - #### exempt-all-pr-assignees -Override [exempt-all-assignees](#exempt-all-assignees) but only to exempt the pull requests with an assignee to be marked as stale automatically. +If set to `true`, the pull requests with an assignee will not be marked as stale automatically. -Default value: unset +Priority over [exempt-assignees](#exempt-assignees). + +Default value: `false` #### exempt-draft-pr diff --git a/__tests__/assignees.spec.ts b/__tests__/assignees.spec.ts index 86c453498..7e9b4907f 100644 --- a/__tests__/assignees.spec.ts +++ b/__tests__/assignees.spec.ts @@ -8,9 +8,8 @@ interface ITestData { id: number; isPullRequest: boolean; assignees: string[]; - exemptAllAssignees: boolean; - exemptAllIssueAssignees: boolean | undefined; - exemptAllPrAssignees: boolean | undefined; + exemptAllIssueAssignees: boolean; + exemptAllPrAssignees: boolean; exemptAssignees: string; exemptIssueAssignees: string; exemptPrAssignees: string; @@ -59,325 +58,324 @@ describe('assignees options', (): void => { }); describe.each` - id | isPullRequest | assignees | exemptAllAssignees | exemptAllIssueAssignees | exemptAllPrAssignees | exemptAssignees | exemptIssueAssignees | exemptPrAssignees | shouldStale | description - ${100} | ${false} | ${[]} | ${false} | ${undefined} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee'} - ${101} | ${false} | ${[]} | ${true} | ${undefined} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and only exemptAllAssignees is enabled'} - ${102} | ${false} | ${[]} | ${false} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and only exemptAllIssueAssignees is enabled'} - ${103} | ${false} | ${[]} | ${false} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and only exemptAllPrAssignees is enabled'} - ${104} | ${false} | ${[]} | ${true} | ${false} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'} - ${105} | ${false} | ${[]} | ${true} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'} - ${106} | ${false} | ${[]} | ${true} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'} - ${107} | ${false} | ${[]} | ${true} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'} - ${108} | ${false} | ${[]} | ${false} | ${false} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'} - ${109} | ${false} | ${[]} | ${false} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'} - ${200} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} - ${201} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'} - ${202} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and only exemptAllAssignees is enabled'} - ${203} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and only exemptAllIssueAssignees is enabled'} - ${204} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and only exemptAllPrAssignees is enabled'} - ${205} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'} - ${206} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'} - ${207} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'} - ${208} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'} - ${209} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'} - ${210} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'} - ${211} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} - ${212} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'} - ${213} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} - ${300} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} - ${301} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} - ${302} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAssignees has a different assignee'} - ${303} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} - ${304} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} - ${305} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees has a different assignee'} - ${306} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} - ${307} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} - ${308} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} - ${309} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees has a different assignee'} - ${310} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} - ${311} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} - ${312} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} - ${313} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} - ${400} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} - ${401} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} - ${402} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAssignees has the same assignee'} - ${403} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} - ${404} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} - ${405} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees has the same assignee'} - ${406} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} - ${407} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} - ${408} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} - ${409} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees has the same assignee'} - ${410} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} - ${411} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} - ${412} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} - ${413} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} - ${500} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${501} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${502} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${503} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${504} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${505} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${506} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${507} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${508} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${509} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${510} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${511} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${512} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${513} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${600} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${601} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${602} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${603} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${604} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${605} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${606} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${607} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${608} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${609} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${610} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${611} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${612} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${613} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${700} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${701} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${702} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${703} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${704} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${705} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${706} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${707} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${708} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${709} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${710} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${711} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${712} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${713} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${800} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${801} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${802} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${803} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${804} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${805} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${806} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${807} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${808} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${809} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${810} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${811} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${812} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${813} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${900} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${901} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${902} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${903} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${904} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${905} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${906} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${907} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${908} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${909} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${910} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${911} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${912} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${913} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${1000} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1001} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1002} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1003} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1004} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1005} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1006} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1007} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1008} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1009} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1010} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1011} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1012} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1013} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1100} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1101} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1102} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1103} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1104} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1105} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1106} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1107} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1108} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1109} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1110} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1111} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1112} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1113} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1200} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1201} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1202} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1203} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1204} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1205} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1206} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1207} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1208} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1209} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1210} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1211} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1212} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1213} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1300} | ${true} | ${[]} | ${false} | ${undefined} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee'} - ${1301} | ${true} | ${[]} | ${true} | ${undefined} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and only exemptAllAssignees is enabled'} - ${1302} | ${true} | ${[]} | ${false} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and only exemptAllIssueAssignees is enabled'} - ${1303} | ${true} | ${[]} | ${false} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and only exemptAllPrAssignees is enabled'} - ${1304} | ${true} | ${[]} | ${true} | ${false} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'} - ${1305} | ${true} | ${[]} | ${true} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'} - ${1306} | ${true} | ${[]} | ${true} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'} - ${1307} | ${true} | ${[]} | ${true} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'} - ${1308} | ${true} | ${[]} | ${false} | ${false} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'} - ${1309} | ${true} | ${[]} | ${false} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'} - ${1400} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} - ${1401} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'} - ${1402} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and only exemptAllAssignees is enabled'} - ${1403} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and only exemptAllIssueAssignees is enabled'} - ${1404} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and only exemptAllPrAssignees is enabled'} - ${1405} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'} - ${1406} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'} - ${1407} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'} - ${1408} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'} - ${1409} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'} - ${1410} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'} - ${1411} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} - ${1412} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'} - ${1413} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} - ${1500} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} - ${1501} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} - ${1502} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAssignees has a different assignee'} - ${1503} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} - ${1504} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} - ${1505} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees has a different assignee'} - ${1506} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} - ${1507} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} - ${1508} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} - ${1509} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees has a different assignee'} - ${1510} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} - ${1511} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} - ${1513} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} - ${1600} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} - ${1601} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} - ${1602} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAssignees has the same assignee'} - ${1603} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} - ${1604} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} - ${1605} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees has the same assignee'} - ${1606} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} - ${1607} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} - ${1608} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} - ${1609} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees has the same assignee'} - ${1610} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} - ${1611} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} - ${1612} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} - ${1613} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} - ${1701} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1702} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1703} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1704} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1705} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1706} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1707} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1708} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1709} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1710} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1711} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1800} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1801} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1802} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1803} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1804} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1805} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1806} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1807} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1808} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1809} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1810} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1900} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1901} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1902} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1903} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1904} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1905} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1906} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1907} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1908} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1909} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1910} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1911} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${2000} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2001} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2002} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2003} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2004} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2005} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2006} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2007} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2008} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2009} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2010} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2100} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2101} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2102} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2103} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2104} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2105} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2106} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2107} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2108} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2109} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2110} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2200} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2201} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2202} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2203} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2204} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2205} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2206} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2207} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2208} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2209} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2210} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2311} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2312} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2313} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2300} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2301} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2302} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2303} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2304} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2305} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2306} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2307} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2308} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2309} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2310} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2311} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2400} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2401} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2402} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2403} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2404} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2405} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2406} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2407} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2408} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2409} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2410} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2411} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2412} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2413} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + id | isPullRequest | assignees | exemptAllIssueAssignees | exemptAllPrAssignees | exemptAssignees | exemptIssueAssignees | exemptPrAssignees | shouldStale | description + ${100} | ${false} | ${[]} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee'} + ${101} | ${false} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and only exemptAllAssignees is enabled'} + ${102} | ${false} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and only exemptAllIssueAssignees is enabled'} + ${103} | ${false} | ${[]} | ${false} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and only exemptAllPrAssignees is enabled'} + ${104} | ${false} | ${[]} | ${false} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'} + ${105} | ${false} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'} + ${106} | ${false} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'} + ${107} | ${false} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'} + ${108} | ${false} | ${[]} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'} + ${109} | ${false} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'} + ${200} | ${false} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} + ${201} | ${false} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'} + ${202} | ${false} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and only exemptAllAssignees is enabled'} + ${203} | ${false} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and only exemptAllIssueAssignees is enabled'} + ${204} | ${false} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and only exemptAllPrAssignees is enabled'} + ${205} | ${false} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'} + ${206} | ${false} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'} + ${207} | ${false} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'} + ${208} | ${false} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'} + ${209} | ${false} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'} + ${210} | ${false} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'} + ${211} | ${false} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} + ${212} | ${false} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'} + ${213} | ${false} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} + ${300} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} + ${301} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} + ${302} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAssignees has a different assignee'} + ${303} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} + ${304} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} + ${305} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees has a different assignee'} + ${306} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} + ${307} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} + ${308} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} + ${309} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees has a different assignee'} + ${310} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} + ${311} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} + ${312} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} + ${313} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} + ${400} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} + ${401} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} + ${402} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAssignees has the same assignee'} + ${403} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} + ${404} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} + ${405} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees has the same assignee'} + ${406} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} + ${407} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} + ${408} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} + ${409} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees has the same assignee'} + ${410} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} + ${411} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} + ${412} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} + ${413} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} + ${500} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${501} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${502} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${503} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${504} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${505} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${506} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${507} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${508} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${509} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${510} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${511} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${512} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${513} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${600} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${601} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${602} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${603} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${604} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${605} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${606} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${607} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${608} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${609} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${610} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${611} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${612} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${613} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${700} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${701} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${702} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${703} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${704} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${705} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${706} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${707} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${708} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${709} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${710} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${711} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${712} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${713} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${800} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${801} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${802} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${803} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${804} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${805} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${806} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${807} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${808} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${809} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${810} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${811} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${812} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${813} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${900} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${901} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${902} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${903} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${904} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${905} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${906} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${907} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${908} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${909} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${910} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${911} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${912} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${913} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${1000} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${1001} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${1002} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${1003} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${1004} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${1005} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${1006} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${1007} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${1008} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${1009} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${1010} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${1011} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${1012} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${1013} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${1100} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${1101} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${1102} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${1103} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${1104} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${1105} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${1106} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${1107} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${1108} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${1109} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${1110} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${1111} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${1112} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${1113} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${1200} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${1201} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${1202} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${1203} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${1204} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${1205} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${1206} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${1207} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${1208} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${1209} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${1210} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${1211} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${1212} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${1213} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${1300} | ${true} | ${[]} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee'} + ${1301} | ${true} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and only exemptAllAssignees is enabled'} + ${1302} | ${true} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and only exemptAllIssueAssignees is enabled'} + ${1303} | ${true} | ${[]} | ${false} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and only exemptAllPrAssignees is enabled'} + ${1304} | ${true} | ${[]} | ${false} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'} + ${1305} | ${true} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'} + ${1306} | ${true} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'} + ${1307} | ${true} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'} + ${1308} | ${true} | ${[]} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'} + ${1309} | ${true} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'} + ${1400} | ${true} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} + ${1401} | ${true} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'} + ${1402} | ${true} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and only exemptAllAssignees is enabled'} + ${1403} | ${true} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and only exemptAllIssueAssignees is enabled'} + ${1404} | ${true} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and only exemptAllPrAssignees is enabled'} + ${1405} | ${true} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'} + ${1406} | ${true} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'} + ${1407} | ${true} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'} + ${1408} | ${true} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'} + ${1409} | ${true} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'} + ${1410} | ${true} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'} + ${1411} | ${true} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} + ${1412} | ${true} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'} + ${1413} | ${true} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} + ${1500} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} + ${1501} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} + ${1502} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAssignees has a different assignee'} + ${1503} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} + ${1504} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} + ${1505} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees has a different assignee'} + ${1506} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} + ${1507} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} + ${1508} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} + ${1509} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees has a different assignee'} + ${1510} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} + ${1511} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} + ${1513} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} + ${1600} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} + ${1601} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} + ${1602} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAssignees has the same assignee'} + ${1603} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} + ${1604} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} + ${1605} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees has the same assignee'} + ${1606} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} + ${1607} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} + ${1608} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} + ${1609} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees has the same assignee'} + ${1610} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} + ${1611} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} + ${1612} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} + ${1613} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} + ${1701} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${1702} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${1703} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${1704} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${1705} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${1706} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${1707} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${1708} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${1709} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${1710} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${1711} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} + ${1800} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${1801} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${1802} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${1803} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${1804} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${1805} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${1806} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${1807} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${1808} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${1809} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${1810} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} + ${1900} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${1901} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${1902} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${1903} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${1904} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${1905} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${1906} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${1907} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${1908} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${1909} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${1910} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${1911} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} + ${2000} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${2001} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${2002} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${2003} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${2004} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${2005} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${2006} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${2007} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${2008} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${2009} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${2010} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} + ${2100} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${2101} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${2102} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${2103} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${2104} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${2105} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${2106} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${2107} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${2108} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${2109} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${2110} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} + ${2200} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${2201} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${2202} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${2203} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${2204} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${2205} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${2206} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${2207} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${2208} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${2209} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${2210} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${2311} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${2312} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${2313} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} + ${2300} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${2301} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${2302} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${2303} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${2304} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${2305} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${2306} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${2307} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${2308} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${2309} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${2310} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${2311} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} + ${2400} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${2401} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${2402} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${2403} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${2404} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${2405} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${2406} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${2407} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${2408} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${2409} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${2410} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${2411} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${2412} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + ${2413} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} `( '$description', ({ id, isPullRequest, assignees, - exemptAllAssignees, exemptAllIssueAssignees, exemptAllPrAssignees, exemptAssignees, @@ -386,7 +384,6 @@ describe('assignees options', (): void => { shouldStale }: ITestData): void => { beforeEach((): void => { - opts.exemptAllAssignees = exemptAllAssignees; opts.exemptAllIssueAssignees = exemptAllIssueAssignees; opts.exemptAllPrAssignees = exemptAllPrAssignees; opts.exemptAssignees = exemptAssignees; diff --git a/__tests__/constants/default-processor-options.ts b/__tests__/constants/default-processor-options.ts index 92fe08a6f..370931923 100644 --- a/__tests__/constants/default-processor-options.ts +++ b/__tests__/constants/default-processor-options.ts @@ -41,9 +41,8 @@ export const DefaultProcessorOptions: IIssuesProcessorOptions = Object.freeze({ exemptAssignees: '', exemptIssueAssignees: '', exemptPrAssignees: '', - exemptAllAssignees: false, - exemptAllIssueAssignees: undefined, - exemptAllPrAssignees: undefined, + exemptAllIssueAssignees: false, + exemptAllPrAssignees: false, enableStatistics: true, labelsToRemoveWhenUnstale: '', labelsToAddWhenUnstale: '', diff --git a/action.yml b/action.yml index 688af75c0..14bdfb9fe 100644 --- a/action.yml +++ b/action.yml @@ -152,17 +152,13 @@ inputs: description: 'The assignees which exempt a pull request from being marked as stale. Separate multiple assignees with commas (eg. "user1,user2"). Override "exempt-assignees" option regarding only the pull requests.' default: '' required: false - exempt-all-assignees: - description: 'Exempt all issues and pull requests with assignees from being marked as stale. Default to false.' - default: 'false' - required: false exempt-all-issue-assignees: - description: 'Exempt all issues with assignees from being marked as stale. Override "exempt-all-assignees" option regarding only the issues.' - default: '' + description: 'Exempt all issues with assignees from being marked as stale. Default to false.' + default: 'false' required: false exempt-all-pr-assignees: - description: 'Exempt all pull requests with assignees from being marked as stale. Override "exempt-all-assignees" option regarding only the pull requests.' - default: '' + description: 'Exempt all pull requests with assignees from being marked as stale. Default to false.' + default: 'false' required: false exempt-draft-pr: description: 'Exempt draft pull requests from being marked as stale. Default to false.' diff --git a/dist/index.js b/dist/index.js index 15c68c6e6..046c120c7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5,140 +5,124 @@ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; - -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Assignees = void 0; -const lodash_deburr_1 = __importDefault(__nccwpck_require__(1601)); -const option_1 = __nccwpck_require__(5931); -const words_to_list_1 = __nccwpck_require__(1883); -const issue_logger_1 = __nccwpck_require__(2984); -const logger_service_1 = __nccwpck_require__(1973); -class Assignees { - constructor(options, issue) { - this._options = options; - this._issue = issue; - this._issueLogger = new issue_logger_1.IssueLogger(issue); - } - static _cleanAssignee(assignee) { - return lodash_deburr_1.default(assignee.toLowerCase()); - } - shouldExemptAssignees() { - if (!this._issue.hasAssignees) { - this._issueLogger.info('This $$type has no assignee'); - this._logSkip(); - return false; - } - if (this._shouldExemptAllAssignees()) { - this._issueLogger.info(logger_service_1.LoggerService.white('└──'), 'Skipping this $$type because it has an exempt assignee'); - return true; - } - const exemptAssignees = this._getExemptAssignees(); - if (exemptAssignees.length === 0) { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `No assignee option was specified to skip the stale process for this $$type`); - this._logSkip(); - return false; - } - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `Found ${logger_service_1.LoggerService.cyan(exemptAssignees.length)} assignee${exemptAssignees.length > 1 ? 's' : ''} that can exempt stale on this $$type`); - const hasExemptAssignee = exemptAssignees.some((exemptAssignee) => this._hasAssignee(exemptAssignee)); - if (!hasExemptAssignee) { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), 'No assignee on this $$type can exempt the stale process'); - this._logSkip(); - } - else { - this._issueLogger.info(logger_service_1.LoggerService.white('└──'), 'Skipping this $$type because it has an exempt assignee'); - } - return hasExemptAssignee; - } - _getExemptAssignees() { - return this._issue.isPullRequest - ? this._getExemptPullRequestAssignees() - : this._getExemptIssueAssignees(); - } - _getExemptIssueAssignees() { - if (this._options.exemptIssueAssignees === '') { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptIssueAssignees)} is disabled. No specific assignee can skip the stale process for this $$type`); - if (this._options.exemptAssignees === '') { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAssignees)} is disabled. No specific assignee can skip the stale process for this $$type`); - return []; - } - const exemptAssignees = words_to_list_1.wordsToList(this._options.exemptAssignees); - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAssignees)} is set. ${logger_service_1.LoggerService.cyan(exemptAssignees.length)} assignee${exemptAssignees.length === 1 ? '' : 's'} can skip the stale process for this $$type`); - return exemptAssignees; - } - const exemptAssignees = words_to_list_1.wordsToList(this._options.exemptIssueAssignees); - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptIssueAssignees)} is set. ${logger_service_1.LoggerService.cyan(exemptAssignees.length)} assignee${exemptAssignees.length === 1 ? '' : 's'} can skip the stale process for this $$type`); - return exemptAssignees; - } - _getExemptPullRequestAssignees() { - if (this._options.exemptPrAssignees === '') { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptPrAssignees)} is disabled. No specific assignee can skip the stale process for this $$type`); - if (this._options.exemptAssignees === '') { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAssignees)} is disabled. No specific assignee can skip the stale process for this $$type`); - return []; - } - const exemptAssignees = words_to_list_1.wordsToList(this._options.exemptAssignees); - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAssignees)} is set. ${logger_service_1.LoggerService.cyan(exemptAssignees.length)} assignee${exemptAssignees.length === 1 ? '' : 's'} can skip the stale process for this $$type`); - return exemptAssignees; - } - const exemptAssignees = words_to_list_1.wordsToList(this._options.exemptPrAssignees); - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptPrAssignees)} is set. ${logger_service_1.LoggerService.cyan(exemptAssignees.length)} assignee${exemptAssignees.length === 1 ? '' : 's'} can skip the stale process for this $$type`); - return exemptAssignees; - } - _hasAssignee(assignee) { - const cleanAssignee = Assignees._cleanAssignee(assignee); - return this._issue.assignees.some((issueAssignee) => { - const isSameAssignee = cleanAssignee === Assignees._cleanAssignee(issueAssignee.login); - if (isSameAssignee) { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `@${issueAssignee.login} is assigned on this $$type and is an exempt assignee`); - } - return isSameAssignee; - }); - } - _shouldExemptAllAssignees() { - return this._issue.isPullRequest - ? this._shouldExemptAllPullRequestAssignees() - : this._shouldExemptAllIssueAssignees(); - } - _shouldExemptAllIssueAssignees() { - if (this._options.exemptAllIssueAssignees === true) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllIssueAssignees)} is enabled. Any assignee on this $$type will skip the stale process`); - return true; - } - else if (this._options.exemptAllIssueAssignees === false) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllIssueAssignees)} is disabled. Only some specific assignees on this $$type will skip the stale process`); - return false; - } - this._logExemptAllAssigneesOption(); - return this._options.exemptAllAssignees; - } - _shouldExemptAllPullRequestAssignees() { - if (this._options.exemptAllPrAssignees === true) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllPrAssignees)} is enabled. Any assignee on this $$type will skip the stale process`); - return true; - } - else if (this._options.exemptAllPrAssignees === false) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllPrAssignees)} is disabled. Only some specific assignees on this $$type will skip the stale process`); - return false; - } - this._logExemptAllAssigneesOption(); - return this._options.exemptAllAssignees; - } - _logExemptAllAssigneesOption() { - if (this._options.exemptAllAssignees) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllAssignees)} is enabled. Any assignee on this $$type will skip the stale process`); - } - else { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllAssignees)} is disabled. Only some specific assignees on this $$type will skip the stale process`); - } - } - _logSkip() { - this._issueLogger.info(logger_service_1.LoggerService.white('└──'), 'Skip the assignees checks'); - } -} -exports.Assignees = Assignees; + +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Assignees = void 0; +const lodash_deburr_1 = __importDefault(__nccwpck_require__(1601)); +const option_1 = __nccwpck_require__(5931); +const words_to_list_1 = __nccwpck_require__(1883); +const issue_logger_1 = __nccwpck_require__(2984); +const logger_service_1 = __nccwpck_require__(1973); +class Assignees { + constructor(options, issue) { + this._options = options; + this._issue = issue; + this._issueLogger = new issue_logger_1.IssueLogger(issue); + } + static _cleanAssignee(assignee) { + return lodash_deburr_1.default(assignee.toLowerCase()); + } + shouldExemptAssignees() { + if (!this._issue.hasAssignees) { + this._issueLogger.info('This $$type has no assignee'); + this._logSkip(); + return false; + } + if (this._shouldExemptAllAssignees()) { + this._issueLogger.info(logger_service_1.LoggerService.white('└──'), 'Skipping this $$type because it has an exempt assignee'); + return true; + } + const exemptAssignees = this._getExemptAssignees(); + if (exemptAssignees.length === 0) { + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `No assignee option was specified to skip the stale process for this $$type`); + this._logSkip(); + return false; + } + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `Found ${logger_service_1.LoggerService.cyan(exemptAssignees.length)} assignee${exemptAssignees.length > 1 ? 's' : ''} that can exempt stale on this $$type`); + const hasExemptAssignee = exemptAssignees.some((exemptAssignee) => this._hasAssignee(exemptAssignee)); + if (!hasExemptAssignee) { + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), 'No assignee on this $$type can exempt the stale process'); + this._logSkip(); + } + else { + this._issueLogger.info(logger_service_1.LoggerService.white('└──'), 'Skipping this $$type because it has an exempt assignee'); + } + return hasExemptAssignee; + } + _getExemptAssignees() { + return this._issue.isPullRequest + ? this._getExemptPullRequestAssignees() + : this._getExemptIssueAssignees(); + } + _getExemptIssueAssignees() { + if (this._options.exemptIssueAssignees === '') { + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptIssueAssignees)} is disabled. No specific assignee can skip the stale process for this $$type`); + if (this._options.exemptAssignees === '') { + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAssignees)} is disabled. No specific assignee can skip the stale process for this $$type`); + return []; + } + const exemptAssignees = words_to_list_1.wordsToList(this._options.exemptAssignees); + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAssignees)} is set. ${logger_service_1.LoggerService.cyan(exemptAssignees.length)} assignee${exemptAssignees.length === 1 ? '' : 's'} can skip the stale process for this $$type`); + return exemptAssignees; + } + const exemptAssignees = words_to_list_1.wordsToList(this._options.exemptIssueAssignees); + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptIssueAssignees)} is set. ${logger_service_1.LoggerService.cyan(exemptAssignees.length)} assignee${exemptAssignees.length === 1 ? '' : 's'} can skip the stale process for this $$type`); + return exemptAssignees; + } + _getExemptPullRequestAssignees() { + if (this._options.exemptPrAssignees === '') { + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptPrAssignees)} is disabled. No specific assignee can skip the stale process for this $$type`); + if (this._options.exemptAssignees === '') { + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAssignees)} is disabled. No specific assignee can skip the stale process for this $$type`); + return []; + } + const exemptAssignees = words_to_list_1.wordsToList(this._options.exemptAssignees); + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAssignees)} is set. ${logger_service_1.LoggerService.cyan(exemptAssignees.length)} assignee${exemptAssignees.length === 1 ? '' : 's'} can skip the stale process for this $$type`); + return exemptAssignees; + } + const exemptAssignees = words_to_list_1.wordsToList(this._options.exemptPrAssignees); + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptPrAssignees)} is set. ${logger_service_1.LoggerService.cyan(exemptAssignees.length)} assignee${exemptAssignees.length === 1 ? '' : 's'} can skip the stale process for this $$type`); + return exemptAssignees; + } + _hasAssignee(assignee) { + const cleanAssignee = Assignees._cleanAssignee(assignee); + return this._issue.assignees.some((issueAssignee) => { + const isSameAssignee = cleanAssignee === Assignees._cleanAssignee(issueAssignee.login); + if (isSameAssignee) { + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `@${issueAssignee.login} is assigned on this $$type and is an exempt assignee`); + } + return isSameAssignee; + }); + } + _shouldExemptAllAssignees() { + return this._issue.isPullRequest + ? this._shouldExemptAllPullRequestAssignees() + : this._shouldExemptAllIssueAssignees(); + } + _shouldExemptAllIssueAssignees() { + if (this._options.exemptAllIssueAssignees) { + this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllIssueAssignees)} is enabled. Any assignee on this $$type will skip the stale process`); + return true; + } + this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllIssueAssignees)} is disabled. Only some specific assignees on this $$type will skip the stale process`); + return false; + } + _shouldExemptAllPullRequestAssignees() { + if (this._options.exemptAllPrAssignees) { + this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllPrAssignees)} is enabled. Any assignee on this $$type will skip the stale process`); + return true; + } + this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllPrAssignees)} is disabled. Only some specific assignees on this $$type will skip the stale process`); + return false; + } + _logSkip() { + this._issueLogger.info(logger_service_1.LoggerService.white('└──'), 'Skip the assignees checks'); + } +} +exports.Assignees = Assignees; /***/ }), @@ -147,47 +131,47 @@ exports.Assignees = Assignees; /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; - -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExemptDraftPullRequest = void 0; -const option_1 = __nccwpck_require__(5931); -const logger_service_1 = __nccwpck_require__(1973); -const issue_logger_1 = __nccwpck_require__(2984); -class ExemptDraftPullRequest { - constructor(options, issue) { - this._options = options; - this._issue = issue; - this._issueLogger = new issue_logger_1.IssueLogger(issue); - } - shouldExemptDraftPullRequest(pullRequestCallback) { - return __awaiter(this, void 0, void 0, function* () { - if (this._issue.isPullRequest) { - if (this._options.exemptDraftPr) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptDraftPr)} is enabled`); - const pullRequest = yield pullRequestCallback(); - if ((pullRequest === null || pullRequest === void 0 ? void 0 : pullRequest.draft) === true) { - this._issueLogger.info(logger_service_1.LoggerService.white('└──'), `Skip the $$type draft checks`); - return true; - } - else { - this._issueLogger.info(logger_service_1.LoggerService.white('└──'), `Continuing the process for this $$type because it is not a draft`); - } - } - } - return false; - }); - } -} -exports.ExemptDraftPullRequest = ExemptDraftPullRequest; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ExemptDraftPullRequest = void 0; +const option_1 = __nccwpck_require__(5931); +const logger_service_1 = __nccwpck_require__(1973); +const issue_logger_1 = __nccwpck_require__(2984); +class ExemptDraftPullRequest { + constructor(options, issue) { + this._options = options; + this._issue = issue; + this._issueLogger = new issue_logger_1.IssueLogger(issue); + } + shouldExemptDraftPullRequest(pullRequestCallback) { + return __awaiter(this, void 0, void 0, function* () { + if (this._issue.isPullRequest) { + if (this._options.exemptDraftPr) { + this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptDraftPr)} is enabled`); + const pullRequest = yield pullRequestCallback(); + if ((pullRequest === null || pullRequest === void 0 ? void 0 : pullRequest.draft) === true) { + this._issueLogger.info(logger_service_1.LoggerService.white('└──'), `Skip the $$type draft checks`); + return true; + } + else { + this._issueLogger.info(logger_service_1.LoggerService.white('└──'), `Continuing the process for this $$type because it is not a draft`); + } + } + } + return false; + }); + } +} +exports.ExemptDraftPullRequest = ExemptDraftPullRequest; /***/ }), @@ -196,59 +180,43 @@ exports.ExemptDraftPullRequest = ExemptDraftPullRequest; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.IgnoreUpdates = void 0; -const option_1 = __nccwpck_require__(5931); -const issue_logger_1 = __nccwpck_require__(2984); -class IgnoreUpdates { - constructor(options, issue) { - this._options = options; - this._issue = issue; - this._issueLogger = new issue_logger_1.IssueLogger(issue); - } - shouldIgnoreUpdates() { - return this._shouldIgnoreUpdates(); - } - _shouldIgnoreUpdates() { - return this._issue.isPullRequest - ? this._shouldIgnorePullRequestUpdates() - : this._shouldIgnoreIssueUpdates(); - } - _shouldIgnorePullRequestUpdates() { - if (this._options.ignorePrUpdates === true) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.IgnorePrUpdates)} 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`); - return true; - } - else if (this._options.ignorePrUpdates === false) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.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(); - return this._options.ignoreUpdates; - } - _shouldIgnoreIssueUpdates() { - if (this._options.ignoreIssueUpdates === true) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.IgnoreIssueUpdates)} 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`); - return true; - } - else if (this._options.ignoreIssueUpdates === false) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.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(); - return this._options.ignoreUpdates; - } - _logIgnoreUpdates() { - if (this._options.ignoreUpdates) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.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_1.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`); - } - } -} -exports.IgnoreUpdates = IgnoreUpdates; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.IgnoreUpdates = void 0; +const option_1 = __nccwpck_require__(5931); +const issue_logger_1 = __nccwpck_require__(2984); +class IgnoreUpdates { + constructor(options, issue) { + this._options = options; + this._issue = issue; + this._issueLogger = new issue_logger_1.IssueLogger(issue); + } + shouldIgnoreUpdates() { + return this._shouldIgnoreUpdates(); + } + _shouldIgnoreUpdates() { + return this._issue.isPullRequest + ? this._shouldIgnorePullRequestUpdates() + : this._shouldIgnoreIssueUpdates(); + } + _shouldIgnorePullRequestUpdates() { + if (this._options.ignorePrUpdates) { + this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.IgnorePrUpdates)} 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`); + return true; + } + this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.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; + } + _shouldIgnoreIssueUpdates() { + if (this._options.ignoreIssueUpdates) { + this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.IgnoreIssueUpdates)} 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`); + return true; + } + this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.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; + } +} +exports.IgnoreUpdates = IgnoreUpdates; /***/ }), @@ -257,1144 +225,1144 @@ exports.IgnoreUpdates = IgnoreUpdates; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Issue = void 0; -const is_labeled_1 = __nccwpck_require__(6792); -const is_pull_request_1 = __nccwpck_require__(5400); -const operations_1 = __nccwpck_require__(7957); -class Issue { - constructor(options, issue) { - this.operations = new operations_1.Operations(); - this._options = options; - this.title = issue.title; - this.number = issue.number; - this.created_at = issue.created_at; - this.updated_at = issue.updated_at; - this.labels = issue.labels; - this.pull_request = issue.pull_request; - this.state = issue.state; - this.locked = issue.locked; - this.milestone = issue.milestone; - this.assignees = issue.assignees; - this.isStale = is_labeled_1.isLabeled(this, this.staleLabel); - } - get isPullRequest() { - return is_pull_request_1.isPullRequest(this); - } - get staleLabel() { - return this._getStaleLabel(); - } - get hasAssignees() { - return this.assignees.length > 0; - } - _getStaleLabel() { - return this.isPullRequest - ? this._options.stalePrLabel - : this._options.staleIssueLabel; - } -} -exports.Issue = Issue; - - -/***/ }), - -/***/ 3292: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.IssuesProcessor = void 0; -const core = __importStar(__nccwpck_require__(2186)); -const github_1 = __nccwpck_require__(5438); -const option_1 = __nccwpck_require__(5931); -const get_humanized_date_1 = __nccwpck_require__(965); -const is_date_more_recent_than_1 = __nccwpck_require__(1473); -const is_valid_date_1 = __nccwpck_require__(891); -const is_boolean_1 = __nccwpck_require__(8236); -const is_labeled_1 = __nccwpck_require__(6792); -const clean_label_1 = __nccwpck_require__(7752); -const should_mark_when_stale_1 = __nccwpck_require__(2461); -const words_to_list_1 = __nccwpck_require__(1883); -const assignees_1 = __nccwpck_require__(7236); -const ignore_updates_1 = __nccwpck_require__(2935); -const exempt_draft_pull_request_1 = __nccwpck_require__(854); -const issue_1 = __nccwpck_require__(4783); -const issue_logger_1 = __nccwpck_require__(2984); -const logger_1 = __nccwpck_require__(6212); -const milestones_1 = __nccwpck_require__(4601); -const stale_operations_1 = __nccwpck_require__(5080); -const statistics_1 = __nccwpck_require__(3334); -const logger_service_1 = __nccwpck_require__(1973); -/*** - * Handle processing of issues for staleness/closure. - */ -class IssuesProcessor { - constructor(options) { - this.staleIssues = []; - this.closedIssues = []; - this.deletedBranchIssues = []; - this.removedLabelIssues = []; - this.addedLabelIssues = []; - this.addedCloseCommentIssues = []; - this._logger = new logger_1.Logger(); - this.options = options; - this.client = github_1.getOctokit(this.options.repoToken); - this.operations = new stale_operations_1.StaleOperations(this.options); - this._logger.info(logger_service_1.LoggerService.yellow(`Starting the stale action process...`)); - if (this.options.debugOnly) { - this._logger.warning(logger_service_1.LoggerService.yellowBright(`Executing in debug mode!`)); - this._logger.warning(logger_service_1.LoggerService.yellowBright(`The debug output will be written but no issues/PRs will be processed.`)); - } - if (this.options.enableStatistics) { - this.statistics = new statistics_1.Statistics(); - } - } - static _updatedSince(timestamp, num_days) { - const daysInMillis = 1000 * 60 * 60 * 24 * num_days; - const millisSinceLastUpdated = new Date().getTime() - new Date(timestamp).getTime(); - return millisSinceLastUpdated <= daysInMillis; - } - static _endIssueProcessing(issue) { - const consumedOperationsCount = issue.operations.getConsumedOperationsCount(); - if (consumedOperationsCount > 0) { - const issueLogger = new issue_logger_1.IssueLogger(issue); - issueLogger.info(logger_service_1.LoggerService.cyan(consumedOperationsCount), `operation${consumedOperationsCount > 1 ? 's' : ''} consumed for this $$type`); - } - } - static _getCloseLabelUsedOptionName(issue) { - return issue.isPullRequest ? option_1.Option.ClosePrLabel : option_1.Option.CloseIssueLabel; - } - processIssues(page = 1) { - var _a, _b; - return __awaiter(this, void 0, void 0, function* () { - // get the next batch of issues - const issues = yield this.getIssues(page); - if (issues.length <= 0) { - this._logger.info(logger_service_1.LoggerService.green(`No more issues found to process. Exiting...`)); - (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.setOperationsCount(this.operations.getConsumedOperationsCount()).logStats(); - return this.operations.getRemainingOperationsCount(); - } - else { - this._logger.info(`${logger_service_1.LoggerService.yellow('Processing the batch of issues')} ${logger_service_1.LoggerService.cyan(`#${page}`)} ${logger_service_1.LoggerService.yellow('containing')} ${logger_service_1.LoggerService.cyan(issues.length)} ${logger_service_1.LoggerService.yellow(`issue${issues.length > 1 ? 's' : ''}...`)}`); - } - const labelsToAddWhenUnstale = words_to_list_1.wordsToList(this.options.labelsToAddWhenUnstale); - const labelsToRemoveWhenUnstale = words_to_list_1.wordsToList(this.options.labelsToRemoveWhenUnstale); - for (const issue of issues.values()) { - // Stop the processing if no more operations remains - if (!this.operations.hasRemainingOperations()) { - break; - } - const issueLogger = new issue_logger_1.IssueLogger(issue); - yield issueLogger.grouping(`$$type #${issue.number}`, () => __awaiter(this, void 0, void 0, function* () { - yield this.processIssue(issue, labelsToAddWhenUnstale, labelsToRemoveWhenUnstale); - })); - } - if (!this.operations.hasRemainingOperations()) { - this._logger.warning(logger_service_1.LoggerService.yellowBright(`No more operations left! Exiting...`)); - this._logger.warning(`${logger_service_1.LoggerService.yellowBright('If you think that not enough issues were processed you could try to increase the quantity related to the')} ${this._logger.createOptionLink(option_1.Option.OperationsPerRun)} ${logger_service_1.LoggerService.yellowBright('option which is currently set to')} ${logger_service_1.LoggerService.cyan(this.options.operationsPerRun)}`); - (_b = this.statistics) === null || _b === void 0 ? void 0 : _b.setOperationsCount(this.operations.getConsumedOperationsCount()).logStats(); - return 0; - } - this._logger.info(`${logger_service_1.LoggerService.green('Batch')} ${logger_service_1.LoggerService.cyan(`#${page}`)} ${logger_service_1.LoggerService.green('processed.')}`); - // Do the next batch - return this.processIssues(page + 1); - }); - } - processIssue(issue, labelsToAddWhenUnstale, labelsToRemoveWhenUnstale) { - var _a; - return __awaiter(this, void 0, void 0, function* () { - (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementProcessedItemsCount(issue); - const issueLogger = new issue_logger_1.IssueLogger(issue); - issueLogger.info(`Found this $$type last updated at: ${logger_service_1.LoggerService.cyan(issue.updated_at)}`); - // calculate string based messages for this issue - const staleMessage = issue.isPullRequest - ? this.options.stalePrMessage - : this.options.staleIssueMessage; - const closeMessage = issue.isPullRequest - ? this.options.closePrMessage - : this.options.closeIssueMessage; - const staleLabel = issue.isPullRequest - ? this.options.stalePrLabel - : this.options.staleIssueLabel; - const closeLabel = issue.isPullRequest - ? this.options.closePrLabel - : this.options.closeIssueLabel; - const skipMessage = issue.isPullRequest - ? this.options.stalePrMessage.length === 0 - : this.options.staleIssueMessage.length === 0; - const daysBeforeStale = issue.isPullRequest - ? this._getDaysBeforePrStale() - : this._getDaysBeforeIssueStale(); - if (issue.state === 'closed') { - issueLogger.info(`Skipping this $$type because it is closed`); - IssuesProcessor._endIssueProcessing(issue); - return; // Don't process closed issues - } - if (issue.locked) { - issueLogger.info(`Skipping this $$type because it is locked`); - IssuesProcessor._endIssueProcessing(issue); - return; // Don't process locked issues - } - const onlyLabels = words_to_list_1.wordsToList(this._getOnlyLabels(issue)); - if (onlyLabels.length > 0) { - issueLogger.info(`The option ${issueLogger.createOptionLink(option_1.Option.OnlyLabels)} was specified to only process issues and pull requests with all those labels (${logger_service_1.LoggerService.cyan(onlyLabels.length)})`); - const hasAllWhitelistedLabels = onlyLabels.every((label) => { - return is_labeled_1.isLabeled(issue, label); - }); - if (!hasAllWhitelistedLabels) { - issueLogger.info(logger_service_1.LoggerService.white('└──'), `Skipping this $$type because it doesn't have all the required labels`); - IssuesProcessor._endIssueProcessing(issue); - return; // Don't process issues without all of the required labels - } - else { - issueLogger.info(logger_service_1.LoggerService.white('├──'), `All the required labels are present on this $$type`); - issueLogger.info(logger_service_1.LoggerService.white('└──'), `Continuing the process for this $$type`); - } - } - else { - issueLogger.info(`The option ${issueLogger.createOptionLink(option_1.Option.OnlyLabels)} was not specified`); - issueLogger.info(logger_service_1.LoggerService.white('└──'), `Continuing the process for this $$type`); - } - issueLogger.info(`Days before $$type stale: ${logger_service_1.LoggerService.cyan(daysBeforeStale)}`); - const shouldMarkAsStale = should_mark_when_stale_1.shouldMarkWhenStale(daysBeforeStale); - // Try to remove the close label when not close/locked issue or PR - yield this._removeCloseLabel(issue, closeLabel); - if (this.options.startDate) { - const startDate = new Date(this.options.startDate); - const createdAt = new Date(issue.created_at); - issueLogger.info(`A start date was specified for the ${get_humanized_date_1.getHumanizedDate(startDate)} (${logger_service_1.LoggerService.cyan(this.options.startDate)})`); - // Expecting that GitHub will always set a creation date on the issues and PRs - // But you never know! - if (!is_valid_date_1.isValidDate(createdAt)) { - IssuesProcessor._endIssueProcessing(issue); - core.setFailed(new Error(`Invalid issue field: "created_at". Expected a valid date`)); - } - issueLogger.info(`$$type created the ${get_humanized_date_1.getHumanizedDate(createdAt)} (${logger_service_1.LoggerService.cyan(issue.created_at)})`); - if (!is_date_more_recent_than_1.isDateMoreRecentThan(createdAt, startDate)) { - issueLogger.info(`Skipping this $$type because it was created before the specified start date`); - IssuesProcessor._endIssueProcessing(issue); - return; // Don't process issues which were created before the start date - } - } - if (issue.isStale) { - issueLogger.info(`This $$type has a stale label`); - } - else { - issueLogger.info(`This $$type hasn't a stale label`); - } - const exemptLabels = words_to_list_1.wordsToList(issue.isPullRequest - ? this.options.exemptPrLabels - : this.options.exemptIssueLabels); - if (exemptLabels.some((exemptLabel) => is_labeled_1.isLabeled(issue, exemptLabel))) { - if (issue.isStale) { - issueLogger.info(`An exempt label was added after the stale label.`); - yield this._removeStaleLabel(issue, staleLabel); - } - issueLogger.info(`Skipping this $$type because it has an exempt label`); - IssuesProcessor._endIssueProcessing(issue); - return; // Don't process exempt issues - } - const anyOfLabels = words_to_list_1.wordsToList(this._getAnyOfLabels(issue)); - if (anyOfLabels.length > 0) { - issueLogger.info(`The option ${issueLogger.createOptionLink(option_1.Option.AnyOfLabels)} was specified to only process the issues and pull requests with one of those labels (${logger_service_1.LoggerService.cyan(anyOfLabels.length)})`); - const hasOneOfWhitelistedLabels = anyOfLabels.some((label) => { - return is_labeled_1.isLabeled(issue, label); - }); - if (!hasOneOfWhitelistedLabels) { - issueLogger.info(logger_service_1.LoggerService.white('└──'), `Skipping this $$type because it doesn't have one of the required labels`); - IssuesProcessor._endIssueProcessing(issue); - return; // Don't process issues without any of the required labels - } - else { - issueLogger.info(logger_service_1.LoggerService.white('├──'), `One of the required labels is present on this $$type`); - issueLogger.info(logger_service_1.LoggerService.white('└──'), `Continuing the process for this $$type`); - } - } - else { - issueLogger.info(`The option ${issueLogger.createOptionLink(option_1.Option.AnyOfLabels)} was not specified`); - issueLogger.info(logger_service_1.LoggerService.white('└──'), `Continuing the process for this $$type`); - } - const milestones = new milestones_1.Milestones(this.options, issue); - if (milestones.shouldExemptMilestones()) { - IssuesProcessor._endIssueProcessing(issue); - return; // Don't process exempt milestones - } - const assignees = new assignees_1.Assignees(this.options, issue); - if (assignees.shouldExemptAssignees()) { - IssuesProcessor._endIssueProcessing(issue); - return; // Don't process exempt assignees - } - // Ignore draft PR - // Note that this check is so far below because it cost one read operation - // So it's simply better to do all the stale checks which don't cost more operation before this one - const exemptDraftPullRequest = new exempt_draft_pull_request_1.ExemptDraftPullRequest(this.options, issue); - if (yield exemptDraftPullRequest.shouldExemptDraftPullRequest(() => __awaiter(this, void 0, void 0, function* () { - return this.getPullRequest(issue); - }))) { - IssuesProcessor._endIssueProcessing(issue); - return; // Don't process draft PR - } - // Determine if this issue needs to be marked stale first - if (!issue.isStale) { - issueLogger.info(`This $$type is not stale`); - const shouldIgnoreUpdates = new ignore_updates_1.IgnoreUpdates(this.options, issue).shouldIgnoreUpdates(); - // Should this issue be marked as stale? - let shouldBeStale; - // Ignore the last update and only use the creation date - if (shouldIgnoreUpdates) { - shouldBeStale = !IssuesProcessor._updatedSince(issue.created_at, daysBeforeStale); - } - // Use the last update to check if we need to stale - else { - shouldBeStale = !IssuesProcessor._updatedSince(issue.updated_at, daysBeforeStale); - } - if (shouldBeStale) { - if (shouldIgnoreUpdates) { - issueLogger.info(`This $$type should be stale based on the creation date the ${get_humanized_date_1.getHumanizedDate(new Date(issue.created_at))} (${logger_service_1.LoggerService.cyan(issue.created_at)})`); - } - else { - issueLogger.info(`This $$type should be stale based on the last update date the ${get_humanized_date_1.getHumanizedDate(new Date(issue.updated_at))} (${logger_service_1.LoggerService.cyan(issue.updated_at)})`); - } - if (shouldMarkAsStale) { - issueLogger.info(`This $$type should be marked as stale based on the option ${issueLogger.createOptionLink(this._getDaysBeforeStaleUsedOptionName(issue))} (${logger_service_1.LoggerService.cyan(daysBeforeStale)})`); - yield this._markStale(issue, staleMessage, staleLabel, skipMessage); - issue.isStale = true; // This issue is now considered stale - issueLogger.info(`This $$type is now stale`); - } - else { - issueLogger.info(`This $$type should not be marked as stale based on the option ${issueLogger.createOptionLink(this._getDaysBeforeStaleUsedOptionName(issue))} (${logger_service_1.LoggerService.cyan(daysBeforeStale)})`); - } - } - else { - if (shouldIgnoreUpdates) { - issueLogger.info(`This $$type should not be stale based on the creation date the ${get_humanized_date_1.getHumanizedDate(new Date(issue.created_at))} (${logger_service_1.LoggerService.cyan(issue.created_at)})`); - } - else { - issueLogger.info(`This $$type should not be stale based on the last update date the ${get_humanized_date_1.getHumanizedDate(new Date(issue.updated_at))} (${logger_service_1.LoggerService.cyan(issue.updated_at)})`); - } - } - } - // Process the issue if it was marked stale - if (issue.isStale) { - issueLogger.info(`This $$type is already stale`); - yield this._processStaleIssue(issue, staleLabel, staleMessage, labelsToAddWhenUnstale, labelsToRemoveWhenUnstale, closeMessage, closeLabel); - } - IssuesProcessor._endIssueProcessing(issue); - }); - } - // Grab comments for an issue since a given date - listIssueComments(issueNumber, sinceDate) { - var _a; - return __awaiter(this, void 0, void 0, function* () { - // Find any comments since date on the given issue - try { - this.operations.consumeOperation(); - (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementFetchedItemsCommentsCount(); - const comments = yield this.client.issues.listComments({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - issue_number: issueNumber, - since: sinceDate - }); - return comments.data; - } - catch (error) { - this._logger.error(`List issue comments error: ${error.message}`); - return Promise.resolve([]); - } - }); - } - // grab issues from github in batches of 100 - getIssues(page) { - var _a; - return __awaiter(this, void 0, void 0, function* () { - // generate type for response - const endpoint = this.client.issues.listForRepo; - try { - this.operations.consumeOperation(); - const issueResult = yield this.client.issues.listForRepo({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - state: 'open', - per_page: 100, - direction: this.options.ascending ? 'asc' : 'desc', - page - }); - (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementFetchedItemsCount(issueResult.data.length); - return issueResult.data.map((issue) => new issue_1.Issue(this.options, issue)); - } - catch (error) { - this._logger.error(`Get issues for repo error: ${error.message}`); - return Promise.resolve([]); - } - }); - } - // returns the creation date of a given label on an issue (or nothing if no label existed) - ///see https://developer.github.com/v3/activity/events/ - getLabelCreationDate(issue, label) { - var _a; - return __awaiter(this, void 0, void 0, function* () { - const issueLogger = new issue_logger_1.IssueLogger(issue); - issueLogger.info(`Checking for label on this $$type`); - this._consumeIssueOperation(issue); - (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementFetchedItemsEventsCount(); - const options = this.client.issues.listEvents.endpoint.merge({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - per_page: 100, - issue_number: issue.number - }); - const events = yield this.client.paginate(options); - const reversedEvents = events.reverse(); - const staleLabeledEvent = reversedEvents.find(event => event.event === 'labeled' && - clean_label_1.cleanLabel(event.label.name) === clean_label_1.cleanLabel(label)); - if (!staleLabeledEvent) { - // Must be old rather than labeled - return undefined; - } - return staleLabeledEvent.created_at; - }); - } - getPullRequest(issue) { - var _a; - return __awaiter(this, void 0, void 0, function* () { - const issueLogger = new issue_logger_1.IssueLogger(issue); - try { - this._consumeIssueOperation(issue); - (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementFetchedPullRequestsCount(); - const pullRequest = yield this.client.pulls.get({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - pull_number: issue.number - }); - return pullRequest.data; - } - catch (error) { - issueLogger.error(`Error when getting this $$type: ${error.message}`); - } - }); - } - // handle all of the stale issue logic when we find a stale issue - _processStaleIssue(issue, staleLabel, staleMessage, labelsToAddWhenUnstale, labelsToRemoveWhenUnstale, closeMessage, closeLabel) { - return __awaiter(this, void 0, void 0, function* () { - const issueLogger = new issue_logger_1.IssueLogger(issue); - const markedStaleOn = (yield this.getLabelCreationDate(issue, staleLabel)) || issue.updated_at; - issueLogger.info(`$$type marked stale on: ${logger_service_1.LoggerService.cyan(markedStaleOn)}`); - const issueHasComments = yield this._hasCommentsSince(issue, markedStaleOn, staleMessage); - issueLogger.info(`$$type has been commented on: ${logger_service_1.LoggerService.cyan(issueHasComments)}`); - const daysBeforeClose = issue.isPullRequest - ? this._getDaysBeforePrClose() - : this._getDaysBeforeIssueClose(); - issueLogger.info(`Days before $$type close: ${logger_service_1.LoggerService.cyan(daysBeforeClose)}`); - const issueHasUpdate = IssuesProcessor._updatedSince(issue.updated_at, daysBeforeClose); - issueLogger.info(`$$type has been updated: ${logger_service_1.LoggerService.cyan(issueHasUpdate)}`); - const shouldRemoveStaleWhenUpdated = this._shouldRemoveStaleWhenUpdated(issue); - issueLogger.info(`The option ${issueLogger.createOptionLink(this._getRemoveStaleWhenUpdatedUsedOptionName(issue))} is: ${logger_service_1.LoggerService.cyan(shouldRemoveStaleWhenUpdated)}`); - if (shouldRemoveStaleWhenUpdated) { - issueLogger.info(`The stale label should not be removed`); - } - else { - issueLogger.info(`The stale label should be removed if all conditions met`); - } - // Should we un-stale this issue? - if (shouldRemoveStaleWhenUpdated && issueHasComments) { - issueLogger.info(`Remove the stale label since the $$type has a comment and the workflow should remove the stale label when updated`); - yield this._removeStaleLabel(issue, staleLabel); - // Are there labels to remove or add when an issue is no longer stale? - yield this._removeLabelsWhenUnstale(issue, labelsToRemoveWhenUnstale); - yield this._addLabelsWhenUnstale(issue, labelsToAddWhenUnstale); - issueLogger.info(`Skipping the process since the $$type is now un-stale`); - return; // Nothing to do because it is no longer stale - } - // Now start closing logic - if (daysBeforeClose < 0) { - return; // Nothing to do because we aren't closing stale issues - } - if (!issueHasComments && !issueHasUpdate) { - issueLogger.info(`Closing $$type because it was last updated on: ${logger_service_1.LoggerService.cyan(issue.updated_at)}`); - yield this._closeIssue(issue, closeMessage, closeLabel); - if (this.options.deleteBranch && issue.pull_request) { - issueLogger.info(`Deleting the branch since the option ${issueLogger.createOptionLink(option_1.Option.DeleteBranch)} is enabled`); - yield this._deleteBranch(issue); - this.deletedBranchIssues.push(issue); - } - } - else { - issueLogger.info(`Stale $$type is not old enough to close yet (hasComments? ${issueHasComments}, hasUpdate? ${issueHasUpdate})`); - } - }); - } - // checks to see if a given issue is still stale (has had activity on it) - _hasCommentsSince(issue, sinceDate, staleMessage) { - return __awaiter(this, void 0, void 0, function* () { - const issueLogger = new issue_logger_1.IssueLogger(issue); - issueLogger.info(`Checking for comments on $$type since: ${logger_service_1.LoggerService.cyan(sinceDate)}`); - if (!sinceDate) { - return true; - } - // find any comments since the date - const comments = yield this.listIssueComments(issue.number, sinceDate); - const filteredComments = comments.filter(comment => comment.user.type === 'User' && - comment.body.toLowerCase() !== staleMessage.toLowerCase()); - issueLogger.info(`Comments that are not the stale comment or another bot: ${logger_service_1.LoggerService.cyan(filteredComments.length)}`); - // if there are any user comments returned - return filteredComments.length > 0; - }); - } - // Mark an issue as stale with a comment and a label - _markStale(issue, staleMessage, staleLabel, skipMessage) { - var _a, _b, _c; - return __awaiter(this, void 0, void 0, function* () { - const issueLogger = new issue_logger_1.IssueLogger(issue); - issueLogger.info(`Marking this $$type as stale`); - this.staleIssues.push(issue); - // if the issue is being marked stale, the updated date should be changed to right now - // so that close calculations work correctly - const newUpdatedAtDate = new Date(); - issue.updated_at = newUpdatedAtDate.toString(); - if (!skipMessage) { - try { - this._consumeIssueOperation(issue); - (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementAddedItemsComment(issue); - if (!this.options.debugOnly) { - yield this.client.issues.createComment({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - issue_number: issue.number, - body: staleMessage - }); - } - } - catch (error) { - issueLogger.error(`Error when creating a comment: ${error.message}`); - } - } - try { - this._consumeIssueOperation(issue); - (_b = this.statistics) === null || _b === void 0 ? void 0 : _b.incrementAddedItemsLabel(issue); - (_c = this.statistics) === null || _c === void 0 ? void 0 : _c.incrementStaleItemsCount(issue); - if (!this.options.debugOnly) { - yield this.client.issues.addLabels({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - issue_number: issue.number, - labels: [staleLabel] - }); - } - } - catch (error) { - issueLogger.error(`Error when adding a label: ${error.message}`); - } - }); - } - // Close an issue based on staleness - _closeIssue(issue, closeMessage, closeLabel) { - var _a, _b, _c; - return __awaiter(this, void 0, void 0, function* () { - const issueLogger = new issue_logger_1.IssueLogger(issue); - issueLogger.info(`Closing $$type for being stale`); - this.closedIssues.push(issue); - if (closeMessage) { - try { - this._consumeIssueOperation(issue); - (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementAddedItemsComment(issue); - this.addedCloseCommentIssues.push(issue); - if (!this.options.debugOnly) { - yield this.client.issues.createComment({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - issue_number: issue.number, - body: closeMessage - }); - } - } - catch (error) { - issueLogger.error(`Error when creating a comment: ${error.message}`); - } - } - if (closeLabel) { - try { - this._consumeIssueOperation(issue); - (_b = this.statistics) === null || _b === void 0 ? void 0 : _b.incrementAddedItemsLabel(issue); - if (!this.options.debugOnly) { - yield this.client.issues.addLabels({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - issue_number: issue.number, - labels: [closeLabel] - }); - } - } - catch (error) { - issueLogger.error(`Error when adding a label: ${error.message}`); - } - } - try { - this._consumeIssueOperation(issue); - (_c = this.statistics) === null || _c === void 0 ? void 0 : _c.incrementClosedItemsCount(issue); - if (!this.options.debugOnly) { - yield this.client.issues.update({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - issue_number: issue.number, - state: 'closed' - }); - } - } - catch (error) { - issueLogger.error(`Error when updating this $$type: ${error.message}`); - } - }); - } - // Delete the branch on closed pull request - _deleteBranch(issue) { - var _a; - return __awaiter(this, void 0, void 0, function* () { - const issueLogger = new issue_logger_1.IssueLogger(issue); - issueLogger.info(`Delete - branch from closed $ - $type - - - ${issue.title}`); - const pullRequest = yield this.getPullRequest(issue); - if (!pullRequest) { - issueLogger.info(`Not deleting this branch as no pull request was found for this $$type`); - return; - } - const branch = pullRequest.head.ref; - issueLogger.info(`Deleting the branch "${logger_service_1.LoggerService.cyan(branch)}" from closed $$type`); - try { - this._consumeIssueOperation(issue); - (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementDeletedBranchesCount(); - if (!this.options.debugOnly) { - yield this.client.git.deleteRef({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - ref: `heads/${branch}` - }); - } - } - catch (error) { - issueLogger.error(`Error when deleting the branch "${logger_service_1.LoggerService.cyan(branch)}" from $$type: ${error.message}`); - } - }); - } - // Remove a label from an issue or a pull request - _removeLabel(issue, label, isSubStep = false) { - var _a; - return __awaiter(this, void 0, void 0, function* () { - const issueLogger = new issue_logger_1.IssueLogger(issue); - issueLogger.info(`${isSubStep ? logger_service_1.LoggerService.white('├── ') : ''}Removing the label "${logger_service_1.LoggerService.cyan(label)}" from this $$type...`); - this.removedLabelIssues.push(issue); - try { - this._consumeIssueOperation(issue); - (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementDeletedItemsLabelsCount(issue); - if (!this.options.debugOnly) { - yield this.client.issues.removeLabel({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - issue_number: issue.number, - name: label - }); - } - issueLogger.info(`${isSubStep ? logger_service_1.LoggerService.white('└── ') : ''}The label "${logger_service_1.LoggerService.cyan(label)}" was removed`); - } - catch (error) { - issueLogger.error(`${isSubStep ? logger_service_1.LoggerService.white('└── ') : ''}Error when removing the label: "${logger_service_1.LoggerService.cyan(error.message)}"`); - } - }); - } - _getDaysBeforeIssueStale() { - return isNaN(this.options.daysBeforeIssueStale) - ? this.options.daysBeforeStale - : this.options.daysBeforeIssueStale; - } - _getDaysBeforePrStale() { - return isNaN(this.options.daysBeforePrStale) - ? this.options.daysBeforeStale - : this.options.daysBeforePrStale; - } - _getDaysBeforeIssueClose() { - return isNaN(this.options.daysBeforeIssueClose) - ? this.options.daysBeforeClose - : this.options.daysBeforeIssueClose; - } - _getDaysBeforePrClose() { - return isNaN(this.options.daysBeforePrClose) - ? this.options.daysBeforeClose - : this.options.daysBeforePrClose; - } - _getOnlyLabels(issue) { - if (issue.isPullRequest) { - if (this.options.onlyPrLabels !== '') { - return this.options.onlyPrLabels; - } - } - else { - if (this.options.onlyIssueLabels !== '') { - return this.options.onlyIssueLabels; - } - } - return this.options.onlyLabels; - } - _getAnyOfLabels(issue) { - if (issue.isPullRequest) { - if (this.options.anyOfPrLabels !== '') { - return this.options.anyOfPrLabels; - } - } - else { - if (this.options.anyOfIssueLabels !== '') { - return this.options.anyOfIssueLabels; - } - } - return this.options.anyOfLabels; - } - _shouldRemoveStaleWhenUpdated(issue) { - if (issue.isPullRequest) { - if (is_boolean_1.isBoolean(this.options.removePrStaleWhenUpdated)) { - return this.options.removePrStaleWhenUpdated; - } - return this.options.removeStaleWhenUpdated; - } - if (is_boolean_1.isBoolean(this.options.removeIssueStaleWhenUpdated)) { - return this.options.removeIssueStaleWhenUpdated; - } - return this.options.removeStaleWhenUpdated; - } - _removeLabelsWhenUnstale(issue, removeLabels) { - return __awaiter(this, void 0, void 0, function* () { - if (!removeLabels.length) { - return; - } - const issueLogger = new issue_logger_1.IssueLogger(issue); - issueLogger.info(`Removing all the labels specified via the ${this._logger.createOptionLink(option_1.Option.LabelsToRemoveWhenUnstale)} option.`); - for (const label of removeLabels.values()) { - yield this._removeLabel(issue, label); - } - }); - } - _addLabelsWhenUnstale(issue, labelsToAdd) { - var _a; - return __awaiter(this, void 0, void 0, function* () { - if (!labelsToAdd.length) { - return; - } - const issueLogger = new issue_logger_1.IssueLogger(issue); - issueLogger.info(`Adding all the labels specified via the ${this._logger.createOptionLink(option_1.Option.LabelsToAddWhenUnstale)} option.`); - this.addedLabelIssues.push(issue); - try { - this.operations.consumeOperation(); - (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementAddedItemsLabel(issue); - if (!this.options.debugOnly) { - yield this.client.issues.addLabels({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - issue_number: issue.number, - labels: labelsToAdd - }); - } - } - catch (error) { - this._logger.error(`Error when adding labels after updated from stale: ${error.message}`); - } - }); - } - _removeStaleLabel(issue, staleLabel) { - var _a; - return __awaiter(this, void 0, void 0, function* () { - const issueLogger = new issue_logger_1.IssueLogger(issue); - issueLogger.info(`The $$type is no longer stale. Removing the stale label...`); - yield this._removeLabel(issue, staleLabel); - (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementUndoStaleItemsCount(issue); - }); - } - _removeCloseLabel(issue, closeLabel) { - var _a; - return __awaiter(this, void 0, void 0, function* () { - const issueLogger = new issue_logger_1.IssueLogger(issue); - issueLogger.info(`The $$type is not closed nor locked. Trying to remove the close label...`); - if (!closeLabel) { - issueLogger.info(logger_service_1.LoggerService.white('├──'), `The ${issueLogger.createOptionLink(IssuesProcessor._getCloseLabelUsedOptionName(issue))} option was not set`); - issueLogger.info(logger_service_1.LoggerService.white('└──'), `Skipping the removal of the close label`); - return Promise.resolve(); - } - if (is_labeled_1.isLabeled(issue, closeLabel)) { - issueLogger.info(logger_service_1.LoggerService.white('├──'), `The $$type has a close label "${logger_service_1.LoggerService.cyan(closeLabel)}". Removing the close label...`); - yield this._removeLabel(issue, closeLabel, true); - (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementDeletedCloseItemsLabelsCount(issue); - } - else { - issueLogger.info(logger_service_1.LoggerService.white('└──'), `There is no close label on this $$type. Skipping`); - return Promise.resolve(); - } - }); - } - _consumeIssueOperation(issue) { - this.operations.consumeOperation(); - issue.operations.consumeOperation(); - } - _getDaysBeforeStaleUsedOptionName(issue) { - return issue.isPullRequest - ? this._getDaysBeforePrStaleUsedOptionName() - : this._getDaysBeforeIssueStaleUsedOptionName(); - } - _getDaysBeforeIssueStaleUsedOptionName() { - return isNaN(this.options.daysBeforeIssueStale) - ? option_1.Option.DaysBeforeStale - : option_1.Option.DaysBeforeIssueStale; - } - _getDaysBeforePrStaleUsedOptionName() { - return isNaN(this.options.daysBeforePrStale) - ? option_1.Option.DaysBeforeStale - : option_1.Option.DaysBeforePrStale; - } - _getRemoveStaleWhenUpdatedUsedOptionName(issue) { - if (issue.isPullRequest) { - if (is_boolean_1.isBoolean(this.options.removePrStaleWhenUpdated)) { - return option_1.Option.RemovePrStaleWhenUpdated; - } - return option_1.Option.RemoveStaleWhenUpdated; - } - if (is_boolean_1.isBoolean(this.options.removeIssueStaleWhenUpdated)) { - return option_1.Option.RemoveIssueStaleWhenUpdated; - } - return option_1.Option.RemoveStaleWhenUpdated; - } -} -exports.IssuesProcessor = IssuesProcessor; - - -/***/ }), - -/***/ 2984: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.IssueLogger = void 0; -const logger_1 = __nccwpck_require__(6212); -const logger_service_1 = __nccwpck_require__(1973); -/** - * @description - * Each log will prefix the message with the issue number - * - * @example - * warning('No stale') => "[#123] No stale" - * - * Each log method can have special tokens: - * - $$type => will replace this by either "pull request" or "issue" depending of the type of issue - * - * @example - * warning('The $$type will stale') => "The pull request will stale" - */ -class IssueLogger extends logger_1.Logger { - constructor(issue) { - super(); - this._issue = issue; - } - warning(...message) { - super.warning(this._format(...message)); - } - info(...message) { - super.info(this._format(...message)); - } - error(...message) { - super.error(this._format(...message)); - } - grouping(message, fn) { - const _super = Object.create(null, { - grouping: { get: () => super.grouping } - }); - return __awaiter(this, void 0, void 0, function* () { - return _super.grouping.call(this, this._format(message), fn); - }); - } - _replaceTokens(message) { - return this._replaceTypeToken(message); - } - _replaceTypeToken(message) { - return message - .replace(/^\$\$type/, this._issue.isPullRequest ? 'Pull request' : 'Issue') - .replace(/\$\$type/g, this._issue.isPullRequest ? 'pull request' : 'issue'); - } - _prefixWithIssueNumber(message) { - return `${this._getPrefix()} ${message}`; - } - _getIssueNumber() { - return this._issue.number; - } - _format(...message) { - return this._prefixWithIssueNumber(this._replaceTokens(message.join(' '))); - } - _getPrefix() { - return this._issue.isPullRequest - ? this._getPullRequestPrefix() - : this._getIssuePrefix(); - } - _getIssuePrefix() { - return logger_service_1.LoggerService.red(`[#${this._getIssueNumber()}]`); - } - _getPullRequestPrefix() { - return logger_service_1.LoggerService.blue(`[#${this._getIssueNumber()}]`); - } -} -exports.IssueLogger = IssueLogger; - - -/***/ }), - -/***/ 6212: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Logger = void 0; -const core = __importStar(__nccwpck_require__(2186)); -const terminal_link_1 = __importDefault(__nccwpck_require__(1898)); -const logger_service_1 = __nccwpck_require__(1973); -class Logger { - warning(...message) { - core.warning(logger_service_1.LoggerService.whiteBright(message.join(' '))); - } - info(...message) { - core.info(logger_service_1.LoggerService.whiteBright(message.join(' '))); - } - error(...message) { - core.error(logger_service_1.LoggerService.whiteBright(message.join(' '))); - } - grouping(message, fn) { - return __awaiter(this, void 0, void 0, function* () { - return core.group(logger_service_1.LoggerService.whiteBright(message), fn); - }); - } - createLink(name, link) { - return terminal_link_1.default(name, link); - } - createOptionLink(option) { - return logger_service_1.LoggerService.magenta(this.createLink(option, `https://github.com/actions/stale#${option}`)); - } -} -exports.Logger = Logger; - - -/***/ }), - -/***/ 4601: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Milestones = void 0; -const lodash_deburr_1 = __importDefault(__nccwpck_require__(1601)); -const option_1 = __nccwpck_require__(5931); -const words_to_list_1 = __nccwpck_require__(1883); -const issue_logger_1 = __nccwpck_require__(2984); -const logger_service_1 = __nccwpck_require__(1973); -class Milestones { - constructor(options, issue) { - this._options = options; - this._issue = issue; - this._issueLogger = new issue_logger_1.IssueLogger(issue); - } - static _cleanMilestone(milestone) { - return lodash_deburr_1.default(milestone.toLowerCase()); - } - shouldExemptMilestones() { - if (!this._issue.milestone) { - this._issueLogger.info('This $$type has no milestone'); - this._logSkip(); - return false; - } - if (this._shouldExemptAllMilestones()) { - this._issueLogger.info(logger_service_1.LoggerService.white('└──'), 'Skipping this $$type because it has a milestone'); - return true; - } - const exemptMilestones = this._getExemptMilestones(); - if (exemptMilestones.length === 0) { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `No milestone option was specified to skip the stale process for this $$type`); - this._logSkip(); - return false; - } - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `Found ${logger_service_1.LoggerService.cyan(exemptMilestones.length)} milestone${exemptMilestones.length > 1 ? 's' : ''} that can exempt stale on this $$type`); - const hasExemptMilestone = exemptMilestones.some((exemptMilestone) => this._hasMilestone(exemptMilestone)); - if (!hasExemptMilestone) { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), 'No milestone on this $$type can exempt the stale process'); - this._logSkip(); - } - else { - this._issueLogger.info(logger_service_1.LoggerService.white('└──'), 'Skipping this $$type because it has an exempt milestone'); - } - return hasExemptMilestone; - } - _getExemptMilestones() { - return this._issue.isPullRequest - ? this._getExemptPullRequestMilestones() - : this._getExemptIssueMilestones(); - } - _getExemptIssueMilestones() { - if (this._options.exemptIssueMilestones === '') { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptIssueMilestones)} is disabled. No specific milestone can skip the stale process for this $$type`); - if (this._options.exemptMilestones === '') { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptMilestones)} is disabled. No specific milestone can skip the stale process for this $$type`); - return []; - } - const exemptMilestones = words_to_list_1.wordsToList(this._options.exemptMilestones); - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptMilestones)} is set. ${logger_service_1.LoggerService.cyan(exemptMilestones.length)} milestone${exemptMilestones.length === 1 ? '' : 's'} can skip the stale process for this $$type`); - return exemptMilestones; - } - const exemptMilestones = words_to_list_1.wordsToList(this._options.exemptIssueMilestones); - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptIssueMilestones)} is set. ${logger_service_1.LoggerService.cyan(exemptMilestones.length)} milestone${exemptMilestones.length === 1 ? '' : 's'} can skip the stale process for this $$type`); - return exemptMilestones; - } - _getExemptPullRequestMilestones() { - if (this._options.exemptPrMilestones === '') { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptPrMilestones)} is disabled. No specific milestone can skip the stale process for this $$type`); - if (this._options.exemptMilestones === '') { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptMilestones)} is disabled. No specific milestone can skip the stale process for this $$type`); - return []; - } - const exemptMilestones = words_to_list_1.wordsToList(this._options.exemptMilestones); - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptMilestones)} is set. ${logger_service_1.LoggerService.cyan(exemptMilestones.length)} milestone${exemptMilestones.length === 1 ? '' : 's'} can skip the stale process for this $$type`); - return exemptMilestones; - } - const exemptMilestones = words_to_list_1.wordsToList(this._options.exemptPrMilestones); - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptPrMilestones)} is set. ${logger_service_1.LoggerService.cyan(exemptMilestones.length)} milestone${exemptMilestones.length === 1 ? '' : 's'} can skip the stale process for this $$type`); - return exemptMilestones; - } - _hasMilestone(milestone) { - if (!this._issue.milestone) { - return false; - } - const cleanMilestone = Milestones._cleanMilestone(milestone); - const isSameMilestone = cleanMilestone === - Milestones._cleanMilestone(this._issue.milestone.title); - if (isSameMilestone) { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The milestone "${logger_service_1.LoggerService.cyan(milestone)}" is set on this $$type and is an exempt milestone`); - } - return isSameMilestone; - } - _shouldExemptAllMilestones() { - if (this._issue.milestone) { - return this._issue.isPullRequest - ? this._shouldExemptAllPullRequestMilestones() - : this._shouldExemptAllIssueMilestones(); - } - return false; - } - _shouldExemptAllIssueMilestones() { - if (this._options.exemptAllIssueMilestones === true) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllIssueMilestones)} is enabled. Any milestone on this $$type will skip the stale process`); - return true; - } - else if (this._options.exemptAllIssueMilestones === false) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllIssueMilestones)} is disabled. Only some specific milestones on this $$type will skip the stale process`); - return false; - } - this._logExemptAllMilestonesOption(); - return this._options.exemptAllMilestones; - } - _shouldExemptAllPullRequestMilestones() { - if (this._options.exemptAllPrMilestones === true) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllPrMilestones)} is enabled. Any milestone on this $$type will skip the stale process`); - return true; - } - else if (this._options.exemptAllPrMilestones === false) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllPrMilestones)} is disabled. Only some specific milestones on this $$type will skip the stale process`); - return false; - } - this._logExemptAllMilestonesOption(); - return this._options.exemptAllMilestones; - } - _logExemptAllMilestonesOption() { - if (this._options.exemptAllMilestones) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllMilestones)} is enabled. Any milestone on this $$type will skip the stale process`); - } - else { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllMilestones)} is disabled. Only some specific milestones on this $$type will skip the stale process`); - } - } - _logSkip() { - this._issueLogger.info(logger_service_1.LoggerService.white('└──'), 'Skip the milestones checks'); - } -} -exports.Milestones = Milestones; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Issue = void 0; +const is_labeled_1 = __nccwpck_require__(6792); +const is_pull_request_1 = __nccwpck_require__(5400); +const operations_1 = __nccwpck_require__(7957); +class Issue { + constructor(options, issue) { + this.operations = new operations_1.Operations(); + this._options = options; + this.title = issue.title; + this.number = issue.number; + this.created_at = issue.created_at; + this.updated_at = issue.updated_at; + this.labels = issue.labels; + this.pull_request = issue.pull_request; + this.state = issue.state; + this.locked = issue.locked; + this.milestone = issue.milestone; + this.assignees = issue.assignees; + this.isStale = is_labeled_1.isLabeled(this, this.staleLabel); + } + get isPullRequest() { + return is_pull_request_1.isPullRequest(this); + } + get staleLabel() { + return this._getStaleLabel(); + } + get hasAssignees() { + return this.assignees.length > 0; + } + _getStaleLabel() { + return this.isPullRequest + ? this._options.stalePrLabel + : this._options.staleIssueLabel; + } +} +exports.Issue = Issue; + + +/***/ }), + +/***/ 3292: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.IssuesProcessor = void 0; +const core = __importStar(__nccwpck_require__(2186)); +const github_1 = __nccwpck_require__(5438); +const option_1 = __nccwpck_require__(5931); +const get_humanized_date_1 = __nccwpck_require__(965); +const is_date_more_recent_than_1 = __nccwpck_require__(1473); +const is_valid_date_1 = __nccwpck_require__(891); +const is_boolean_1 = __nccwpck_require__(8236); +const is_labeled_1 = __nccwpck_require__(6792); +const clean_label_1 = __nccwpck_require__(7752); +const should_mark_when_stale_1 = __nccwpck_require__(2461); +const words_to_list_1 = __nccwpck_require__(1883); +const assignees_1 = __nccwpck_require__(7236); +const ignore_updates_1 = __nccwpck_require__(2935); +const exempt_draft_pull_request_1 = __nccwpck_require__(854); +const issue_1 = __nccwpck_require__(4783); +const issue_logger_1 = __nccwpck_require__(2984); +const logger_1 = __nccwpck_require__(6212); +const milestones_1 = __nccwpck_require__(4601); +const stale_operations_1 = __nccwpck_require__(5080); +const statistics_1 = __nccwpck_require__(3334); +const logger_service_1 = __nccwpck_require__(1973); +/*** + * Handle processing of issues for staleness/closure. + */ +class IssuesProcessor { + constructor(options) { + this.staleIssues = []; + this.closedIssues = []; + this.deletedBranchIssues = []; + this.removedLabelIssues = []; + this.addedLabelIssues = []; + this.addedCloseCommentIssues = []; + this._logger = new logger_1.Logger(); + this.options = options; + this.client = github_1.getOctokit(this.options.repoToken); + this.operations = new stale_operations_1.StaleOperations(this.options); + this._logger.info(logger_service_1.LoggerService.yellow(`Starting the stale action process...`)); + if (this.options.debugOnly) { + this._logger.warning(logger_service_1.LoggerService.yellowBright(`Executing in debug mode!`)); + this._logger.warning(logger_service_1.LoggerService.yellowBright(`The debug output will be written but no issues/PRs will be processed.`)); + } + if (this.options.enableStatistics) { + this.statistics = new statistics_1.Statistics(); + } + } + static _updatedSince(timestamp, num_days) { + const daysInMillis = 1000 * 60 * 60 * 24 * num_days; + const millisSinceLastUpdated = new Date().getTime() - new Date(timestamp).getTime(); + return millisSinceLastUpdated <= daysInMillis; + } + static _endIssueProcessing(issue) { + const consumedOperationsCount = issue.operations.getConsumedOperationsCount(); + if (consumedOperationsCount > 0) { + const issueLogger = new issue_logger_1.IssueLogger(issue); + issueLogger.info(logger_service_1.LoggerService.cyan(consumedOperationsCount), `operation${consumedOperationsCount > 1 ? 's' : ''} consumed for this $$type`); + } + } + static _getCloseLabelUsedOptionName(issue) { + return issue.isPullRequest ? option_1.Option.ClosePrLabel : option_1.Option.CloseIssueLabel; + } + processIssues(page = 1) { + var _a, _b; + return __awaiter(this, void 0, void 0, function* () { + // get the next batch of issues + const issues = yield this.getIssues(page); + if (issues.length <= 0) { + this._logger.info(logger_service_1.LoggerService.green(`No more issues found to process. Exiting...`)); + (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.setOperationsCount(this.operations.getConsumedOperationsCount()).logStats(); + return this.operations.getRemainingOperationsCount(); + } + else { + this._logger.info(`${logger_service_1.LoggerService.yellow('Processing the batch of issues')} ${logger_service_1.LoggerService.cyan(`#${page}`)} ${logger_service_1.LoggerService.yellow('containing')} ${logger_service_1.LoggerService.cyan(issues.length)} ${logger_service_1.LoggerService.yellow(`issue${issues.length > 1 ? 's' : ''}...`)}`); + } + const labelsToAddWhenUnstale = words_to_list_1.wordsToList(this.options.labelsToAddWhenUnstale); + const labelsToRemoveWhenUnstale = words_to_list_1.wordsToList(this.options.labelsToRemoveWhenUnstale); + for (const issue of issues.values()) { + // Stop the processing if no more operations remains + if (!this.operations.hasRemainingOperations()) { + break; + } + const issueLogger = new issue_logger_1.IssueLogger(issue); + yield issueLogger.grouping(`$$type #${issue.number}`, () => __awaiter(this, void 0, void 0, function* () { + yield this.processIssue(issue, labelsToAddWhenUnstale, labelsToRemoveWhenUnstale); + })); + } + if (!this.operations.hasRemainingOperations()) { + this._logger.warning(logger_service_1.LoggerService.yellowBright(`No more operations left! Exiting...`)); + this._logger.warning(`${logger_service_1.LoggerService.yellowBright('If you think that not enough issues were processed you could try to increase the quantity related to the')} ${this._logger.createOptionLink(option_1.Option.OperationsPerRun)} ${logger_service_1.LoggerService.yellowBright('option which is currently set to')} ${logger_service_1.LoggerService.cyan(this.options.operationsPerRun)}`); + (_b = this.statistics) === null || _b === void 0 ? void 0 : _b.setOperationsCount(this.operations.getConsumedOperationsCount()).logStats(); + return 0; + } + this._logger.info(`${logger_service_1.LoggerService.green('Batch')} ${logger_service_1.LoggerService.cyan(`#${page}`)} ${logger_service_1.LoggerService.green('processed.')}`); + // Do the next batch + return this.processIssues(page + 1); + }); + } + processIssue(issue, labelsToAddWhenUnstale, labelsToRemoveWhenUnstale) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementProcessedItemsCount(issue); + const issueLogger = new issue_logger_1.IssueLogger(issue); + issueLogger.info(`Found this $$type last updated at: ${logger_service_1.LoggerService.cyan(issue.updated_at)}`); + // calculate string based messages for this issue + const staleMessage = issue.isPullRequest + ? this.options.stalePrMessage + : this.options.staleIssueMessage; + const closeMessage = issue.isPullRequest + ? this.options.closePrMessage + : this.options.closeIssueMessage; + const staleLabel = issue.isPullRequest + ? this.options.stalePrLabel + : this.options.staleIssueLabel; + const closeLabel = issue.isPullRequest + ? this.options.closePrLabel + : this.options.closeIssueLabel; + const skipMessage = issue.isPullRequest + ? this.options.stalePrMessage.length === 0 + : this.options.staleIssueMessage.length === 0; + const daysBeforeStale = issue.isPullRequest + ? this._getDaysBeforePrStale() + : this._getDaysBeforeIssueStale(); + if (issue.state === 'closed') { + issueLogger.info(`Skipping this $$type because it is closed`); + IssuesProcessor._endIssueProcessing(issue); + return; // Don't process closed issues + } + if (issue.locked) { + issueLogger.info(`Skipping this $$type because it is locked`); + IssuesProcessor._endIssueProcessing(issue); + return; // Don't process locked issues + } + const onlyLabels = words_to_list_1.wordsToList(this._getOnlyLabels(issue)); + if (onlyLabels.length > 0) { + issueLogger.info(`The option ${issueLogger.createOptionLink(option_1.Option.OnlyLabels)} was specified to only process issues and pull requests with all those labels (${logger_service_1.LoggerService.cyan(onlyLabels.length)})`); + const hasAllWhitelistedLabels = onlyLabels.every((label) => { + return is_labeled_1.isLabeled(issue, label); + }); + if (!hasAllWhitelistedLabels) { + issueLogger.info(logger_service_1.LoggerService.white('└──'), `Skipping this $$type because it doesn't have all the required labels`); + IssuesProcessor._endIssueProcessing(issue); + return; // Don't process issues without all of the required labels + } + else { + issueLogger.info(logger_service_1.LoggerService.white('├──'), `All the required labels are present on this $$type`); + issueLogger.info(logger_service_1.LoggerService.white('└──'), `Continuing the process for this $$type`); + } + } + else { + issueLogger.info(`The option ${issueLogger.createOptionLink(option_1.Option.OnlyLabels)} was not specified`); + issueLogger.info(logger_service_1.LoggerService.white('└──'), `Continuing the process for this $$type`); + } + issueLogger.info(`Days before $$type stale: ${logger_service_1.LoggerService.cyan(daysBeforeStale)}`); + const shouldMarkAsStale = should_mark_when_stale_1.shouldMarkWhenStale(daysBeforeStale); + // Try to remove the close label when not close/locked issue or PR + yield this._removeCloseLabel(issue, closeLabel); + if (this.options.startDate) { + const startDate = new Date(this.options.startDate); + const createdAt = new Date(issue.created_at); + issueLogger.info(`A start date was specified for the ${get_humanized_date_1.getHumanizedDate(startDate)} (${logger_service_1.LoggerService.cyan(this.options.startDate)})`); + // Expecting that GitHub will always set a creation date on the issues and PRs + // But you never know! + if (!is_valid_date_1.isValidDate(createdAt)) { + IssuesProcessor._endIssueProcessing(issue); + core.setFailed(new Error(`Invalid issue field: "created_at". Expected a valid date`)); + } + issueLogger.info(`$$type created the ${get_humanized_date_1.getHumanizedDate(createdAt)} (${logger_service_1.LoggerService.cyan(issue.created_at)})`); + if (!is_date_more_recent_than_1.isDateMoreRecentThan(createdAt, startDate)) { + issueLogger.info(`Skipping this $$type because it was created before the specified start date`); + IssuesProcessor._endIssueProcessing(issue); + return; // Don't process issues which were created before the start date + } + } + if (issue.isStale) { + issueLogger.info(`This $$type has a stale label`); + } + else { + issueLogger.info(`This $$type hasn't a stale label`); + } + const exemptLabels = words_to_list_1.wordsToList(issue.isPullRequest + ? this.options.exemptPrLabels + : this.options.exemptIssueLabels); + if (exemptLabels.some((exemptLabel) => is_labeled_1.isLabeled(issue, exemptLabel))) { + if (issue.isStale) { + issueLogger.info(`An exempt label was added after the stale label.`); + yield this._removeStaleLabel(issue, staleLabel); + } + issueLogger.info(`Skipping this $$type because it has an exempt label`); + IssuesProcessor._endIssueProcessing(issue); + return; // Don't process exempt issues + } + const anyOfLabels = words_to_list_1.wordsToList(this._getAnyOfLabels(issue)); + if (anyOfLabels.length > 0) { + issueLogger.info(`The option ${issueLogger.createOptionLink(option_1.Option.AnyOfLabels)} was specified to only process the issues and pull requests with one of those labels (${logger_service_1.LoggerService.cyan(anyOfLabels.length)})`); + const hasOneOfWhitelistedLabels = anyOfLabels.some((label) => { + return is_labeled_1.isLabeled(issue, label); + }); + if (!hasOneOfWhitelistedLabels) { + issueLogger.info(logger_service_1.LoggerService.white('└──'), `Skipping this $$type because it doesn't have one of the required labels`); + IssuesProcessor._endIssueProcessing(issue); + return; // Don't process issues without any of the required labels + } + else { + issueLogger.info(logger_service_1.LoggerService.white('├──'), `One of the required labels is present on this $$type`); + issueLogger.info(logger_service_1.LoggerService.white('└──'), `Continuing the process for this $$type`); + } + } + else { + issueLogger.info(`The option ${issueLogger.createOptionLink(option_1.Option.AnyOfLabels)} was not specified`); + issueLogger.info(logger_service_1.LoggerService.white('└──'), `Continuing the process for this $$type`); + } + const milestones = new milestones_1.Milestones(this.options, issue); + if (milestones.shouldExemptMilestones()) { + IssuesProcessor._endIssueProcessing(issue); + return; // Don't process exempt milestones + } + const assignees = new assignees_1.Assignees(this.options, issue); + if (assignees.shouldExemptAssignees()) { + IssuesProcessor._endIssueProcessing(issue); + return; // Don't process exempt assignees + } + // Ignore draft PR + // Note that this check is so far below because it cost one read operation + // So it's simply better to do all the stale checks which don't cost more operation before this one + const exemptDraftPullRequest = new exempt_draft_pull_request_1.ExemptDraftPullRequest(this.options, issue); + if (yield exemptDraftPullRequest.shouldExemptDraftPullRequest(() => __awaiter(this, void 0, void 0, function* () { + return this.getPullRequest(issue); + }))) { + IssuesProcessor._endIssueProcessing(issue); + return; // Don't process draft PR + } + // Determine if this issue needs to be marked stale first + if (!issue.isStale) { + issueLogger.info(`This $$type is not stale`); + const shouldIgnoreUpdates = new ignore_updates_1.IgnoreUpdates(this.options, issue).shouldIgnoreUpdates(); + // Should this issue be marked as stale? + let shouldBeStale; + // Ignore the last update and only use the creation date + if (shouldIgnoreUpdates) { + shouldBeStale = !IssuesProcessor._updatedSince(issue.created_at, daysBeforeStale); + } + // Use the last update to check if we need to stale + else { + shouldBeStale = !IssuesProcessor._updatedSince(issue.updated_at, daysBeforeStale); + } + if (shouldBeStale) { + if (shouldIgnoreUpdates) { + issueLogger.info(`This $$type should be stale based on the creation date the ${get_humanized_date_1.getHumanizedDate(new Date(issue.created_at))} (${logger_service_1.LoggerService.cyan(issue.created_at)})`); + } + else { + issueLogger.info(`This $$type should be stale based on the last update date the ${get_humanized_date_1.getHumanizedDate(new Date(issue.updated_at))} (${logger_service_1.LoggerService.cyan(issue.updated_at)})`); + } + if (shouldMarkAsStale) { + issueLogger.info(`This $$type should be marked as stale based on the option ${issueLogger.createOptionLink(this._getDaysBeforeStaleUsedOptionName(issue))} (${logger_service_1.LoggerService.cyan(daysBeforeStale)})`); + yield this._markStale(issue, staleMessage, staleLabel, skipMessage); + issue.isStale = true; // This issue is now considered stale + issueLogger.info(`This $$type is now stale`); + } + else { + issueLogger.info(`This $$type should not be marked as stale based on the option ${issueLogger.createOptionLink(this._getDaysBeforeStaleUsedOptionName(issue))} (${logger_service_1.LoggerService.cyan(daysBeforeStale)})`); + } + } + else { + if (shouldIgnoreUpdates) { + issueLogger.info(`This $$type should not be stale based on the creation date the ${get_humanized_date_1.getHumanizedDate(new Date(issue.created_at))} (${logger_service_1.LoggerService.cyan(issue.created_at)})`); + } + else { + issueLogger.info(`This $$type should not be stale based on the last update date the ${get_humanized_date_1.getHumanizedDate(new Date(issue.updated_at))} (${logger_service_1.LoggerService.cyan(issue.updated_at)})`); + } + } + } + // Process the issue if it was marked stale + if (issue.isStale) { + issueLogger.info(`This $$type is already stale`); + yield this._processStaleIssue(issue, staleLabel, staleMessage, labelsToAddWhenUnstale, labelsToRemoveWhenUnstale, closeMessage, closeLabel); + } + IssuesProcessor._endIssueProcessing(issue); + }); + } + // Grab comments for an issue since a given date + listIssueComments(issueNumber, sinceDate) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + // Find any comments since date on the given issue + try { + this.operations.consumeOperation(); + (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementFetchedItemsCommentsCount(); + const comments = yield this.client.issues.listComments({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + issue_number: issueNumber, + since: sinceDate + }); + return comments.data; + } + catch (error) { + this._logger.error(`List issue comments error: ${error.message}`); + return Promise.resolve([]); + } + }); + } + // grab issues from github in batches of 100 + getIssues(page) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + // generate type for response + const endpoint = this.client.issues.listForRepo; + try { + this.operations.consumeOperation(); + const issueResult = yield this.client.issues.listForRepo({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + state: 'open', + per_page: 100, + direction: this.options.ascending ? 'asc' : 'desc', + page + }); + (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementFetchedItemsCount(issueResult.data.length); + return issueResult.data.map((issue) => new issue_1.Issue(this.options, issue)); + } + catch (error) { + this._logger.error(`Get issues for repo error: ${error.message}`); + return Promise.resolve([]); + } + }); + } + // returns the creation date of a given label on an issue (or nothing if no label existed) + ///see https://developer.github.com/v3/activity/events/ + getLabelCreationDate(issue, label) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + const issueLogger = new issue_logger_1.IssueLogger(issue); + issueLogger.info(`Checking for label on this $$type`); + this._consumeIssueOperation(issue); + (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementFetchedItemsEventsCount(); + const options = this.client.issues.listEvents.endpoint.merge({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + per_page: 100, + issue_number: issue.number + }); + const events = yield this.client.paginate(options); + const reversedEvents = events.reverse(); + const staleLabeledEvent = reversedEvents.find(event => event.event === 'labeled' && + clean_label_1.cleanLabel(event.label.name) === clean_label_1.cleanLabel(label)); + if (!staleLabeledEvent) { + // Must be old rather than labeled + return undefined; + } + return staleLabeledEvent.created_at; + }); + } + getPullRequest(issue) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + const issueLogger = new issue_logger_1.IssueLogger(issue); + try { + this._consumeIssueOperation(issue); + (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementFetchedPullRequestsCount(); + const pullRequest = yield this.client.pulls.get({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + pull_number: issue.number + }); + return pullRequest.data; + } + catch (error) { + issueLogger.error(`Error when getting this $$type: ${error.message}`); + } + }); + } + // handle all of the stale issue logic when we find a stale issue + _processStaleIssue(issue, staleLabel, staleMessage, labelsToAddWhenUnstale, labelsToRemoveWhenUnstale, closeMessage, closeLabel) { + return __awaiter(this, void 0, void 0, function* () { + const issueLogger = new issue_logger_1.IssueLogger(issue); + const markedStaleOn = (yield this.getLabelCreationDate(issue, staleLabel)) || issue.updated_at; + issueLogger.info(`$$type marked stale on: ${logger_service_1.LoggerService.cyan(markedStaleOn)}`); + const issueHasComments = yield this._hasCommentsSince(issue, markedStaleOn, staleMessage); + issueLogger.info(`$$type has been commented on: ${logger_service_1.LoggerService.cyan(issueHasComments)}`); + const daysBeforeClose = issue.isPullRequest + ? this._getDaysBeforePrClose() + : this._getDaysBeforeIssueClose(); + issueLogger.info(`Days before $$type close: ${logger_service_1.LoggerService.cyan(daysBeforeClose)}`); + const issueHasUpdate = IssuesProcessor._updatedSince(issue.updated_at, daysBeforeClose); + issueLogger.info(`$$type has been updated: ${logger_service_1.LoggerService.cyan(issueHasUpdate)}`); + const shouldRemoveStaleWhenUpdated = this._shouldRemoveStaleWhenUpdated(issue); + issueLogger.info(`The option ${issueLogger.createOptionLink(this._getRemoveStaleWhenUpdatedUsedOptionName(issue))} is: ${logger_service_1.LoggerService.cyan(shouldRemoveStaleWhenUpdated)}`); + if (shouldRemoveStaleWhenUpdated) { + issueLogger.info(`The stale label should not be removed`); + } + else { + issueLogger.info(`The stale label should be removed if all conditions met`); + } + // Should we un-stale this issue? + if (shouldRemoveStaleWhenUpdated && issueHasComments) { + issueLogger.info(`Remove the stale label since the $$type has a comment and the workflow should remove the stale label when updated`); + yield this._removeStaleLabel(issue, staleLabel); + // Are there labels to remove or add when an issue is no longer stale? + yield this._removeLabelsWhenUnstale(issue, labelsToRemoveWhenUnstale); + yield this._addLabelsWhenUnstale(issue, labelsToAddWhenUnstale); + issueLogger.info(`Skipping the process since the $$type is now un-stale`); + return; // Nothing to do because it is no longer stale + } + // Now start closing logic + if (daysBeforeClose < 0) { + return; // Nothing to do because we aren't closing stale issues + } + if (!issueHasComments && !issueHasUpdate) { + issueLogger.info(`Closing $$type because it was last updated on: ${logger_service_1.LoggerService.cyan(issue.updated_at)}`); + yield this._closeIssue(issue, closeMessage, closeLabel); + if (this.options.deleteBranch && issue.pull_request) { + issueLogger.info(`Deleting the branch since the option ${issueLogger.createOptionLink(option_1.Option.DeleteBranch)} is enabled`); + yield this._deleteBranch(issue); + this.deletedBranchIssues.push(issue); + } + } + else { + issueLogger.info(`Stale $$type is not old enough to close yet (hasComments? ${issueHasComments}, hasUpdate? ${issueHasUpdate})`); + } + }); + } + // checks to see if a given issue is still stale (has had activity on it) + _hasCommentsSince(issue, sinceDate, staleMessage) { + return __awaiter(this, void 0, void 0, function* () { + const issueLogger = new issue_logger_1.IssueLogger(issue); + issueLogger.info(`Checking for comments on $$type since: ${logger_service_1.LoggerService.cyan(sinceDate)}`); + if (!sinceDate) { + return true; + } + // find any comments since the date + const comments = yield this.listIssueComments(issue.number, sinceDate); + const filteredComments = comments.filter(comment => comment.user.type === 'User' && + comment.body.toLowerCase() !== staleMessage.toLowerCase()); + issueLogger.info(`Comments that are not the stale comment or another bot: ${logger_service_1.LoggerService.cyan(filteredComments.length)}`); + // if there are any user comments returned + return filteredComments.length > 0; + }); + } + // Mark an issue as stale with a comment and a label + _markStale(issue, staleMessage, staleLabel, skipMessage) { + var _a, _b, _c; + return __awaiter(this, void 0, void 0, function* () { + const issueLogger = new issue_logger_1.IssueLogger(issue); + issueLogger.info(`Marking this $$type as stale`); + this.staleIssues.push(issue); + // if the issue is being marked stale, the updated date should be changed to right now + // so that close calculations work correctly + const newUpdatedAtDate = new Date(); + issue.updated_at = newUpdatedAtDate.toString(); + if (!skipMessage) { + try { + this._consumeIssueOperation(issue); + (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementAddedItemsComment(issue); + if (!this.options.debugOnly) { + yield this.client.issues.createComment({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + issue_number: issue.number, + body: staleMessage + }); + } + } + catch (error) { + issueLogger.error(`Error when creating a comment: ${error.message}`); + } + } + try { + this._consumeIssueOperation(issue); + (_b = this.statistics) === null || _b === void 0 ? void 0 : _b.incrementAddedItemsLabel(issue); + (_c = this.statistics) === null || _c === void 0 ? void 0 : _c.incrementStaleItemsCount(issue); + if (!this.options.debugOnly) { + yield this.client.issues.addLabels({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + issue_number: issue.number, + labels: [staleLabel] + }); + } + } + catch (error) { + issueLogger.error(`Error when adding a label: ${error.message}`); + } + }); + } + // Close an issue based on staleness + _closeIssue(issue, closeMessage, closeLabel) { + var _a, _b, _c; + return __awaiter(this, void 0, void 0, function* () { + const issueLogger = new issue_logger_1.IssueLogger(issue); + issueLogger.info(`Closing $$type for being stale`); + this.closedIssues.push(issue); + if (closeMessage) { + try { + this._consumeIssueOperation(issue); + (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementAddedItemsComment(issue); + this.addedCloseCommentIssues.push(issue); + if (!this.options.debugOnly) { + yield this.client.issues.createComment({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + issue_number: issue.number, + body: closeMessage + }); + } + } + catch (error) { + issueLogger.error(`Error when creating a comment: ${error.message}`); + } + } + if (closeLabel) { + try { + this._consumeIssueOperation(issue); + (_b = this.statistics) === null || _b === void 0 ? void 0 : _b.incrementAddedItemsLabel(issue); + if (!this.options.debugOnly) { + yield this.client.issues.addLabels({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + issue_number: issue.number, + labels: [closeLabel] + }); + } + } + catch (error) { + issueLogger.error(`Error when adding a label: ${error.message}`); + } + } + try { + this._consumeIssueOperation(issue); + (_c = this.statistics) === null || _c === void 0 ? void 0 : _c.incrementClosedItemsCount(issue); + if (!this.options.debugOnly) { + yield this.client.issues.update({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + issue_number: issue.number, + state: 'closed' + }); + } + } + catch (error) { + issueLogger.error(`Error when updating this $$type: ${error.message}`); + } + }); + } + // Delete the branch on closed pull request + _deleteBranch(issue) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + const issueLogger = new issue_logger_1.IssueLogger(issue); + issueLogger.info(`Delete + branch from closed $ + $type + - + ${issue.title}`); + const pullRequest = yield this.getPullRequest(issue); + if (!pullRequest) { + issueLogger.info(`Not deleting this branch as no pull request was found for this $$type`); + return; + } + const branch = pullRequest.head.ref; + issueLogger.info(`Deleting the branch "${logger_service_1.LoggerService.cyan(branch)}" from closed $$type`); + try { + this._consumeIssueOperation(issue); + (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementDeletedBranchesCount(); + if (!this.options.debugOnly) { + yield this.client.git.deleteRef({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + ref: `heads/${branch}` + }); + } + } + catch (error) { + issueLogger.error(`Error when deleting the branch "${logger_service_1.LoggerService.cyan(branch)}" from $$type: ${error.message}`); + } + }); + } + // Remove a label from an issue or a pull request + _removeLabel(issue, label, isSubStep = false) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + const issueLogger = new issue_logger_1.IssueLogger(issue); + issueLogger.info(`${isSubStep ? logger_service_1.LoggerService.white('├── ') : ''}Removing the label "${logger_service_1.LoggerService.cyan(label)}" from this $$type...`); + this.removedLabelIssues.push(issue); + try { + this._consumeIssueOperation(issue); + (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementDeletedItemsLabelsCount(issue); + if (!this.options.debugOnly) { + yield this.client.issues.removeLabel({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + issue_number: issue.number, + name: label + }); + } + issueLogger.info(`${isSubStep ? logger_service_1.LoggerService.white('└── ') : ''}The label "${logger_service_1.LoggerService.cyan(label)}" was removed`); + } + catch (error) { + issueLogger.error(`${isSubStep ? logger_service_1.LoggerService.white('└── ') : ''}Error when removing the label: "${logger_service_1.LoggerService.cyan(error.message)}"`); + } + }); + } + _getDaysBeforeIssueStale() { + return isNaN(this.options.daysBeforeIssueStale) + ? this.options.daysBeforeStale + : this.options.daysBeforeIssueStale; + } + _getDaysBeforePrStale() { + return isNaN(this.options.daysBeforePrStale) + ? this.options.daysBeforeStale + : this.options.daysBeforePrStale; + } + _getDaysBeforeIssueClose() { + return isNaN(this.options.daysBeforeIssueClose) + ? this.options.daysBeforeClose + : this.options.daysBeforeIssueClose; + } + _getDaysBeforePrClose() { + return isNaN(this.options.daysBeforePrClose) + ? this.options.daysBeforeClose + : this.options.daysBeforePrClose; + } + _getOnlyLabels(issue) { + if (issue.isPullRequest) { + if (this.options.onlyPrLabels !== '') { + return this.options.onlyPrLabels; + } + } + else { + if (this.options.onlyIssueLabels !== '') { + return this.options.onlyIssueLabels; + } + } + return this.options.onlyLabels; + } + _getAnyOfLabels(issue) { + if (issue.isPullRequest) { + if (this.options.anyOfPrLabels !== '') { + return this.options.anyOfPrLabels; + } + } + else { + if (this.options.anyOfIssueLabels !== '') { + return this.options.anyOfIssueLabels; + } + } + return this.options.anyOfLabels; + } + _shouldRemoveStaleWhenUpdated(issue) { + if (issue.isPullRequest) { + if (is_boolean_1.isBoolean(this.options.removePrStaleWhenUpdated)) { + return this.options.removePrStaleWhenUpdated; + } + return this.options.removeStaleWhenUpdated; + } + if (is_boolean_1.isBoolean(this.options.removeIssueStaleWhenUpdated)) { + return this.options.removeIssueStaleWhenUpdated; + } + return this.options.removeStaleWhenUpdated; + } + _removeLabelsWhenUnstale(issue, removeLabels) { + return __awaiter(this, void 0, void 0, function* () { + if (!removeLabels.length) { + return; + } + const issueLogger = new issue_logger_1.IssueLogger(issue); + issueLogger.info(`Removing all the labels specified via the ${this._logger.createOptionLink(option_1.Option.LabelsToRemoveWhenUnstale)} option.`); + for (const label of removeLabels.values()) { + yield this._removeLabel(issue, label); + } + }); + } + _addLabelsWhenUnstale(issue, labelsToAdd) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + if (!labelsToAdd.length) { + return; + } + const issueLogger = new issue_logger_1.IssueLogger(issue); + issueLogger.info(`Adding all the labels specified via the ${this._logger.createOptionLink(option_1.Option.LabelsToAddWhenUnstale)} option.`); + this.addedLabelIssues.push(issue); + try { + this.operations.consumeOperation(); + (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementAddedItemsLabel(issue); + if (!this.options.debugOnly) { + yield this.client.issues.addLabels({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + issue_number: issue.number, + labels: labelsToAdd + }); + } + } + catch (error) { + this._logger.error(`Error when adding labels after updated from stale: ${error.message}`); + } + }); + } + _removeStaleLabel(issue, staleLabel) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + const issueLogger = new issue_logger_1.IssueLogger(issue); + issueLogger.info(`The $$type is no longer stale. Removing the stale label...`); + yield this._removeLabel(issue, staleLabel); + (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementUndoStaleItemsCount(issue); + }); + } + _removeCloseLabel(issue, closeLabel) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + const issueLogger = new issue_logger_1.IssueLogger(issue); + issueLogger.info(`The $$type is not closed nor locked. Trying to remove the close label...`); + if (!closeLabel) { + issueLogger.info(logger_service_1.LoggerService.white('├──'), `The ${issueLogger.createOptionLink(IssuesProcessor._getCloseLabelUsedOptionName(issue))} option was not set`); + issueLogger.info(logger_service_1.LoggerService.white('└──'), `Skipping the removal of the close label`); + return Promise.resolve(); + } + if (is_labeled_1.isLabeled(issue, closeLabel)) { + issueLogger.info(logger_service_1.LoggerService.white('├──'), `The $$type has a close label "${logger_service_1.LoggerService.cyan(closeLabel)}". Removing the close label...`); + yield this._removeLabel(issue, closeLabel, true); + (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementDeletedCloseItemsLabelsCount(issue); + } + else { + issueLogger.info(logger_service_1.LoggerService.white('└──'), `There is no close label on this $$type. Skipping`); + return Promise.resolve(); + } + }); + } + _consumeIssueOperation(issue) { + this.operations.consumeOperation(); + issue.operations.consumeOperation(); + } + _getDaysBeforeStaleUsedOptionName(issue) { + return issue.isPullRequest + ? this._getDaysBeforePrStaleUsedOptionName() + : this._getDaysBeforeIssueStaleUsedOptionName(); + } + _getDaysBeforeIssueStaleUsedOptionName() { + return isNaN(this.options.daysBeforeIssueStale) + ? option_1.Option.DaysBeforeStale + : option_1.Option.DaysBeforeIssueStale; + } + _getDaysBeforePrStaleUsedOptionName() { + return isNaN(this.options.daysBeforePrStale) + ? option_1.Option.DaysBeforeStale + : option_1.Option.DaysBeforePrStale; + } + _getRemoveStaleWhenUpdatedUsedOptionName(issue) { + if (issue.isPullRequest) { + if (is_boolean_1.isBoolean(this.options.removePrStaleWhenUpdated)) { + return option_1.Option.RemovePrStaleWhenUpdated; + } + return option_1.Option.RemoveStaleWhenUpdated; + } + if (is_boolean_1.isBoolean(this.options.removeIssueStaleWhenUpdated)) { + return option_1.Option.RemoveIssueStaleWhenUpdated; + } + return option_1.Option.RemoveStaleWhenUpdated; + } +} +exports.IssuesProcessor = IssuesProcessor; + + +/***/ }), + +/***/ 2984: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.IssueLogger = void 0; +const logger_1 = __nccwpck_require__(6212); +const logger_service_1 = __nccwpck_require__(1973); +/** + * @description + * Each log will prefix the message with the issue number + * + * @example + * warning('No stale') => "[#123] No stale" + * + * Each log method can have special tokens: + * - $$type => will replace this by either "pull request" or "issue" depending of the type of issue + * + * @example + * warning('The $$type will stale') => "The pull request will stale" + */ +class IssueLogger extends logger_1.Logger { + constructor(issue) { + super(); + this._issue = issue; + } + warning(...message) { + super.warning(this._format(...message)); + } + info(...message) { + super.info(this._format(...message)); + } + error(...message) { + super.error(this._format(...message)); + } + grouping(message, fn) { + const _super = Object.create(null, { + grouping: { get: () => super.grouping } + }); + return __awaiter(this, void 0, void 0, function* () { + return _super.grouping.call(this, this._format(message), fn); + }); + } + _replaceTokens(message) { + return this._replaceTypeToken(message); + } + _replaceTypeToken(message) { + return message + .replace(/^\$\$type/, this._issue.isPullRequest ? 'Pull request' : 'Issue') + .replace(/\$\$type/g, this._issue.isPullRequest ? 'pull request' : 'issue'); + } + _prefixWithIssueNumber(message) { + return `${this._getPrefix()} ${message}`; + } + _getIssueNumber() { + return this._issue.number; + } + _format(...message) { + return this._prefixWithIssueNumber(this._replaceTokens(message.join(' '))); + } + _getPrefix() { + return this._issue.isPullRequest + ? this._getPullRequestPrefix() + : this._getIssuePrefix(); + } + _getIssuePrefix() { + return logger_service_1.LoggerService.red(`[#${this._getIssueNumber()}]`); + } + _getPullRequestPrefix() { + return logger_service_1.LoggerService.blue(`[#${this._getIssueNumber()}]`); + } +} +exports.IssueLogger = IssueLogger; + + +/***/ }), + +/***/ 6212: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Logger = void 0; +const core = __importStar(__nccwpck_require__(2186)); +const terminal_link_1 = __importDefault(__nccwpck_require__(1898)); +const logger_service_1 = __nccwpck_require__(1973); +class Logger { + warning(...message) { + core.warning(logger_service_1.LoggerService.whiteBright(message.join(' '))); + } + info(...message) { + core.info(logger_service_1.LoggerService.whiteBright(message.join(' '))); + } + error(...message) { + core.error(logger_service_1.LoggerService.whiteBright(message.join(' '))); + } + grouping(message, fn) { + return __awaiter(this, void 0, void 0, function* () { + return core.group(logger_service_1.LoggerService.whiteBright(message), fn); + }); + } + createLink(name, link) { + return terminal_link_1.default(name, link); + } + createOptionLink(option) { + return logger_service_1.LoggerService.magenta(this.createLink(option, `https://github.com/actions/stale#${option}`)); + } +} +exports.Logger = Logger; + + +/***/ }), + +/***/ 4601: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Milestones = void 0; +const lodash_deburr_1 = __importDefault(__nccwpck_require__(1601)); +const option_1 = __nccwpck_require__(5931); +const words_to_list_1 = __nccwpck_require__(1883); +const issue_logger_1 = __nccwpck_require__(2984); +const logger_service_1 = __nccwpck_require__(1973); +class Milestones { + constructor(options, issue) { + this._options = options; + this._issue = issue; + this._issueLogger = new issue_logger_1.IssueLogger(issue); + } + static _cleanMilestone(milestone) { + return lodash_deburr_1.default(milestone.toLowerCase()); + } + shouldExemptMilestones() { + if (!this._issue.milestone) { + this._issueLogger.info('This $$type has no milestone'); + this._logSkip(); + return false; + } + if (this._shouldExemptAllMilestones()) { + this._issueLogger.info(logger_service_1.LoggerService.white('└──'), 'Skipping this $$type because it has a milestone'); + return true; + } + const exemptMilestones = this._getExemptMilestones(); + if (exemptMilestones.length === 0) { + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `No milestone option was specified to skip the stale process for this $$type`); + this._logSkip(); + return false; + } + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `Found ${logger_service_1.LoggerService.cyan(exemptMilestones.length)} milestone${exemptMilestones.length > 1 ? 's' : ''} that can exempt stale on this $$type`); + const hasExemptMilestone = exemptMilestones.some((exemptMilestone) => this._hasMilestone(exemptMilestone)); + if (!hasExemptMilestone) { + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), 'No milestone on this $$type can exempt the stale process'); + this._logSkip(); + } + else { + this._issueLogger.info(logger_service_1.LoggerService.white('└──'), 'Skipping this $$type because it has an exempt milestone'); + } + return hasExemptMilestone; + } + _getExemptMilestones() { + return this._issue.isPullRequest + ? this._getExemptPullRequestMilestones() + : this._getExemptIssueMilestones(); + } + _getExemptIssueMilestones() { + if (this._options.exemptIssueMilestones === '') { + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptIssueMilestones)} is disabled. No specific milestone can skip the stale process for this $$type`); + if (this._options.exemptMilestones === '') { + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptMilestones)} is disabled. No specific milestone can skip the stale process for this $$type`); + return []; + } + const exemptMilestones = words_to_list_1.wordsToList(this._options.exemptMilestones); + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptMilestones)} is set. ${logger_service_1.LoggerService.cyan(exemptMilestones.length)} milestone${exemptMilestones.length === 1 ? '' : 's'} can skip the stale process for this $$type`); + return exemptMilestones; + } + const exemptMilestones = words_to_list_1.wordsToList(this._options.exemptIssueMilestones); + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptIssueMilestones)} is set. ${logger_service_1.LoggerService.cyan(exemptMilestones.length)} milestone${exemptMilestones.length === 1 ? '' : 's'} can skip the stale process for this $$type`); + return exemptMilestones; + } + _getExemptPullRequestMilestones() { + if (this._options.exemptPrMilestones === '') { + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptPrMilestones)} is disabled. No specific milestone can skip the stale process for this $$type`); + if (this._options.exemptMilestones === '') { + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptMilestones)} is disabled. No specific milestone can skip the stale process for this $$type`); + return []; + } + const exemptMilestones = words_to_list_1.wordsToList(this._options.exemptMilestones); + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptMilestones)} is set. ${logger_service_1.LoggerService.cyan(exemptMilestones.length)} milestone${exemptMilestones.length === 1 ? '' : 's'} can skip the stale process for this $$type`); + return exemptMilestones; + } + const exemptMilestones = words_to_list_1.wordsToList(this._options.exemptPrMilestones); + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptPrMilestones)} is set. ${logger_service_1.LoggerService.cyan(exemptMilestones.length)} milestone${exemptMilestones.length === 1 ? '' : 's'} can skip the stale process for this $$type`); + return exemptMilestones; + } + _hasMilestone(milestone) { + if (!this._issue.milestone) { + return false; + } + const cleanMilestone = Milestones._cleanMilestone(milestone); + const isSameMilestone = cleanMilestone === + Milestones._cleanMilestone(this._issue.milestone.title); + if (isSameMilestone) { + this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The milestone "${logger_service_1.LoggerService.cyan(milestone)}" is set on this $$type and is an exempt milestone`); + } + return isSameMilestone; + } + _shouldExemptAllMilestones() { + if (this._issue.milestone) { + return this._issue.isPullRequest + ? this._shouldExemptAllPullRequestMilestones() + : this._shouldExemptAllIssueMilestones(); + } + return false; + } + _shouldExemptAllIssueMilestones() { + if (this._options.exemptAllIssueMilestones === true) { + this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllIssueMilestones)} is enabled. Any milestone on this $$type will skip the stale process`); + return true; + } + else if (this._options.exemptAllIssueMilestones === false) { + this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllIssueMilestones)} is disabled. Only some specific milestones on this $$type will skip the stale process`); + return false; + } + this._logExemptAllMilestonesOption(); + return this._options.exemptAllMilestones; + } + _shouldExemptAllPullRequestMilestones() { + if (this._options.exemptAllPrMilestones === true) { + this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllPrMilestones)} is enabled. Any milestone on this $$type will skip the stale process`); + return true; + } + else if (this._options.exemptAllPrMilestones === false) { + this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllPrMilestones)} is disabled. Only some specific milestones on this $$type will skip the stale process`); + return false; + } + this._logExemptAllMilestonesOption(); + return this._options.exemptAllMilestones; + } + _logExemptAllMilestonesOption() { + if (this._options.exemptAllMilestones) { + this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllMilestones)} is enabled. Any milestone on this $$type will skip the stale process`); + } + else { + this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllMilestones)} is disabled. Only some specific milestones on this $$type will skip the stale process`); + } + } + _logSkip() { + this._issueLogger.info(logger_service_1.LoggerService.white('└──'), 'Skip the milestones checks'); + } +} +exports.Milestones = Milestones; /***/ }), @@ -1403,25 +1371,25 @@ exports.Milestones = Milestones; /***/ ((__unused_webpack_module, exports) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Operations = void 0; -class Operations { - constructor() { - this._operationsConsumed = 0; - } - consumeOperation() { - return this.consumeOperations(1); - } - consumeOperations(quantity) { - this._operationsConsumed += quantity; - return this; - } - getConsumedOperationsCount() { - return this._operationsConsumed; - } -} -exports.Operations = Operations; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Operations = void 0; +class Operations { + constructor() { + this._operationsConsumed = 0; + } + consumeOperation() { + return this.consumeOperations(1); + } + consumeOperations(quantity) { + this._operationsConsumed += quantity; + return this; + } + getConsumedOperationsCount() { + return this._operationsConsumed; + } +} +exports.Operations = Operations; /***/ }), @@ -1430,23 +1398,23 @@ exports.Operations = Operations; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.StaleOperations = void 0; -const operations_1 = __nccwpck_require__(7957); -class StaleOperations extends operations_1.Operations { - constructor(options) { - super(); - this._options = options; - } - hasRemainingOperations() { - return this._operationsConsumed < this._options.operationsPerRun; - } - getRemainingOperationsCount() { - return this._options.operationsPerRun - this._operationsConsumed; - } -} -exports.StaleOperations = StaleOperations; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.StaleOperations = void 0; +const operations_1 = __nccwpck_require__(7957); +class StaleOperations extends operations_1.Operations { + constructor(options) { + super(); + this._options = options; + } + hasRemainingOperations() { + return this._operationsConsumed < this._options.operationsPerRun; + } + getRemainingOperationsCount() { + return this._options.operationsPerRun - this._operationsConsumed; + } +} +exports.StaleOperations = StaleOperations; /***/ }), @@ -1455,364 +1423,364 @@ exports.StaleOperations = StaleOperations; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Statistics = void 0; -const logger_1 = __nccwpck_require__(6212); -const logger_service_1 = __nccwpck_require__(1973); -class Statistics { - constructor() { - this._logger = new logger_1.Logger(); - this.processedIssuesCount = 0; - this.processedPullRequestsCount = 0; - this.staleIssuesCount = 0; - this.stalePullRequestsCount = 0; - this.undoStaleIssuesCount = 0; - this.undoStalePullRequestsCount = 0; - this.operationsCount = 0; - this.closedIssuesCount = 0; - this.closedPullRequestsCount = 0; - this.deletedIssuesLabelsCount = 0; - this.deletedPullRequestsLabelsCount = 0; - this.deletedCloseIssuesLabelsCount = 0; - this.deletedClosePullRequestsLabelsCount = 0; - this.deletedBranchesCount = 0; - this.addedIssuesLabelsCount = 0; - this.addedPullRequestsLabelsCount = 0; - this.addedIssuesCommentsCount = 0; - this.addedPullRequestsCommentsCount = 0; - this.fetchedItemsCount = 0; - this.fetchedItemsEventsCount = 0; - this.fetchedItemsCommentsCount = 0; - this.fetchedPullRequestsCount = 0; - } - incrementProcessedItemsCount(issue, increment = 1) { - if (issue.isPullRequest) { - return this._incrementProcessedPullRequestsCount(increment); - } - return this._incrementProcessedIssuesCount(increment); - } - incrementStaleItemsCount(issue, increment = 1) { - if (issue.isPullRequest) { - return this._incrementStalePullRequestsCount(increment); - } - return this._incrementStaleIssuesCount(increment); - } - incrementUndoStaleItemsCount(issue, increment = 1) { - if (issue.isPullRequest) { - return this._incrementUndoStalePullRequestsCount(increment); - } - return this._incrementUndoStaleIssuesCount(increment); - } - setOperationsCount(operationsCount) { - this.operationsCount = operationsCount; - return this; - } - incrementClosedItemsCount(issue, increment = 1) { - if (issue.isPullRequest) { - return this._incrementClosedPullRequestsCount(increment); - } - return this._incrementClosedIssuesCount(increment); - } - incrementDeletedItemsLabelsCount(issue, increment = 1) { - if (issue.isPullRequest) { - return this._incrementDeletedPullRequestsLabelsCount(increment); - } - return this._incrementDeletedIssuesLabelsCount(increment); - } - incrementDeletedCloseItemsLabelsCount(issue, increment = 1) { - if (issue.isPullRequest) { - return this._incrementDeletedClosePullRequestsLabelsCount(increment); - } - return this._incrementDeletedCloseIssuesLabelsCount(increment); - } - incrementDeletedBranchesCount(increment = 1) { - this.deletedBranchesCount += increment; - return this; - } - incrementAddedItemsLabel(issue, increment = 1) { - if (issue.isPullRequest) { - return this._incrementAddedPullRequestsLabel(increment); - } - return this._incrementAddedIssuesLabel(increment); - } - incrementAddedItemsComment(issue, increment = 1) { - if (issue.isPullRequest) { - return this._incrementAddedPullRequestsComment(increment); - } - return this._incrementAddedIssuesComment(increment); - } - incrementFetchedItemsCount(increment = 1) { - this.fetchedItemsCount += increment; - return this; - } - incrementFetchedItemsEventsCount(increment = 1) { - this.fetchedItemsEventsCount += increment; - return this; - } - incrementFetchedItemsCommentsCount(increment = 1) { - this.fetchedItemsCommentsCount += increment; - return this; - } - incrementFetchedPullRequestsCount(increment = 1) { - this.fetchedPullRequestsCount += increment; - return this; - } - logStats() { - this._logger.info(logger_service_1.LoggerService.yellow(logger_service_1.LoggerService.bold(`Statistics:`))); - this._logProcessedIssuesAndPullRequestsCount(); - this._logStaleIssuesAndPullRequestsCount(); - this._logUndoStaleIssuesAndPullRequestsCount(); - this._logClosedIssuesAndPullRequestsCount(); - this._logDeletedIssuesAndPullRequestsLabelsCount(); - this._logDeletedCloseIssuesAndPullRequestsLabelsCount(); - this._logDeletedBranchesCount(); - this._logAddedIssuesAndPullRequestsLabelsCount(); - this._logAddedIssuesAndPullRequestsCommentsCount(); - this._logFetchedItemsCount(); - this._logFetchedItemsEventsCount(); - this._logFetchedItemsCommentsCount(); - this._logFetchedPullRequestsCount(); - this._logOperationsCount(); - return this; - } - _incrementProcessedIssuesCount(increment = 1) { - this.processedIssuesCount += increment; - return this; - } - _incrementProcessedPullRequestsCount(increment = 1) { - this.processedPullRequestsCount += increment; - return this; - } - _incrementStaleIssuesCount(increment = 1) { - this.staleIssuesCount += increment; - return this; - } - _incrementStalePullRequestsCount(increment = 1) { - this.stalePullRequestsCount += increment; - return this; - } - _incrementUndoStaleIssuesCount(increment = 1) { - this.undoStaleIssuesCount += increment; - return this; - } - _incrementUndoStalePullRequestsCount(increment = 1) { - this.undoStalePullRequestsCount += increment; - return this; - } - _incrementClosedIssuesCount(increment = 1) { - this.closedIssuesCount += increment; - return this; - } - _incrementClosedPullRequestsCount(increment = 1) { - this.closedPullRequestsCount += increment; - return this; - } - _incrementDeletedIssuesLabelsCount(increment = 1) { - this.deletedIssuesLabelsCount += increment; - return this; - } - _incrementDeletedPullRequestsLabelsCount(increment = 1) { - this.deletedPullRequestsLabelsCount += increment; - return this; - } - _incrementDeletedCloseIssuesLabelsCount(increment = 1) { - this.deletedCloseIssuesLabelsCount += increment; - return this; - } - _incrementDeletedClosePullRequestsLabelsCount(increment = 1) { - this.deletedClosePullRequestsLabelsCount += increment; - return this; - } - _incrementAddedIssuesLabel(increment = 1) { - this.addedIssuesLabelsCount += increment; - return this; - } - _incrementAddedPullRequestsLabel(increment = 1) { - this.addedPullRequestsLabelsCount += increment; - return this; - } - _incrementAddedIssuesComment(increment = 1) { - this.addedIssuesCommentsCount += increment; - return this; - } - _incrementAddedPullRequestsComment(increment = 1) { - this.addedPullRequestsCommentsCount += increment; - return this; - } - _logProcessedIssuesAndPullRequestsCount() { - this._logGroup('Processed items', [ - { - name: 'Processed issues', - count: this.processedIssuesCount - }, - { - name: 'Processed PRs', - count: this.processedPullRequestsCount - } - ]); - } - _logStaleIssuesAndPullRequestsCount() { - this._logGroup('New stale items', [ - { - name: 'New stale issues', - count: this.staleIssuesCount - }, - { - name: 'New stale PRs', - count: this.stalePullRequestsCount - } - ]); - } - _logUndoStaleIssuesAndPullRequestsCount() { - this._logGroup('No longer stale items', [ - { - name: 'No longer stale issues', - count: this.undoStaleIssuesCount - }, - { - name: 'No longer stale PRs', - count: this.undoStalePullRequestsCount - } - ]); - } - _logClosedIssuesAndPullRequestsCount() { - this._logGroup('Closed items', [ - { - name: 'Closed issues', - count: this.closedIssuesCount - }, - { - name: 'Closed PRs', - count: this.closedPullRequestsCount - } - ]); - } - _logDeletedIssuesAndPullRequestsLabelsCount() { - this._logGroup('Deleted items labels', [ - { - name: 'Deleted issues labels', - count: this.deletedIssuesLabelsCount - }, - { - name: 'Deleted PRs labels', - count: this.deletedPullRequestsLabelsCount - } - ]); - } - _logDeletedCloseIssuesAndPullRequestsLabelsCount() { - this._logGroup('Deleted close items labels', [ - { - name: 'Deleted close issues labels', - count: this.deletedCloseIssuesLabelsCount - }, - { - name: 'Deleted close PRs labels', - count: this.deletedClosePullRequestsLabelsCount - } - ]); - } - _logDeletedBranchesCount() { - this._logCount('Deleted branches', this.deletedBranchesCount); - } - _logAddedIssuesAndPullRequestsLabelsCount() { - this._logGroup('Added items labels', [ - { - name: 'Added issues labels', - count: this.addedIssuesLabelsCount - }, - { - name: 'Added PRs labels', - count: this.addedPullRequestsLabelsCount - } - ]); - } - _logAddedIssuesAndPullRequestsCommentsCount() { - this._logGroup('Added items comments', [ - { - name: 'Added issues comments', - count: this.addedIssuesCommentsCount - }, - { - name: 'Added PRs comments', - count: this.addedPullRequestsCommentsCount - } - ]); - } - _logFetchedItemsCount() { - this._logCount('Fetched items', this.fetchedItemsCount); - } - _logFetchedItemsEventsCount() { - this._logCount('Fetched items events', this.fetchedItemsEventsCount); - } - _logFetchedItemsCommentsCount() { - this._logCount('Fetched items comments', this.fetchedItemsCommentsCount); - } - _logFetchedPullRequestsCount() { - this._logCount('Fetched pull requests', this.fetchedPullRequestsCount); - } - _logOperationsCount() { - this._logCount('Operations performed', this.operationsCount); - } - _logCount(name, count) { - if (count > 0) { - this._logger.info(`${name}:`, logger_service_1.LoggerService.cyan(count)); - } - } - _logGroup(groupName, values) { - if (this._isGroupValuesPartiallySet(values)) { - this._logCount(groupName, this._getGroupValuesTotalCount(values)); - this._logGroupValues(values); - } - else { - // Only one value will be display - for (const value of values) { - this._logCount(value.name, value.count); - } - } - } - /** - * @private - * @description - * If there is a least two elements with a valid count then it's partially set - * Useful to defined if we should display the values as a group or not - * - * @param {IGroupValue[]} values The list of group values to check - */ - _isGroupValuesPartiallySet(values) { - return (values - .map((value) => { - return value.count > 0; - }) - .filter((isSet) => isSet).length >= 2); - } - _getGroupValuesTotalCount(values) { - return values.reduce((count, value) => { - return count + value.count; - }, 0); - } - _getAllGroupValuesSet(values) { - return values.filter((value) => { - return value.count > 0; - }); - } - _logGroupValues(values) { - const onlyValuesSet = this._getAllGroupValuesSet(values); - const longestValue = this._getLongestGroupValue(onlyValuesSet); - for (const [index, value] of onlyValuesSet.entries()) { - const prefix = index === onlyValuesSet.length - 1 ? '└──' : '├──'; - this._logCount(`${logger_service_1.LoggerService.white(prefix)} ${value.name.padEnd(longestValue, ' ')}`, value.count); - } - } - _getLongestGroupValue(values) { - return values.reduce((longestValue, value) => { - return value.name.length > longestValue - ? value.name.length - : longestValue; - }, 0); - } -} -exports.Statistics = Statistics; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Statistics = void 0; +const logger_1 = __nccwpck_require__(6212); +const logger_service_1 = __nccwpck_require__(1973); +class Statistics { + constructor() { + this._logger = new logger_1.Logger(); + this.processedIssuesCount = 0; + this.processedPullRequestsCount = 0; + this.staleIssuesCount = 0; + this.stalePullRequestsCount = 0; + this.undoStaleIssuesCount = 0; + this.undoStalePullRequestsCount = 0; + this.operationsCount = 0; + this.closedIssuesCount = 0; + this.closedPullRequestsCount = 0; + this.deletedIssuesLabelsCount = 0; + this.deletedPullRequestsLabelsCount = 0; + this.deletedCloseIssuesLabelsCount = 0; + this.deletedClosePullRequestsLabelsCount = 0; + this.deletedBranchesCount = 0; + this.addedIssuesLabelsCount = 0; + this.addedPullRequestsLabelsCount = 0; + this.addedIssuesCommentsCount = 0; + this.addedPullRequestsCommentsCount = 0; + this.fetchedItemsCount = 0; + this.fetchedItemsEventsCount = 0; + this.fetchedItemsCommentsCount = 0; + this.fetchedPullRequestsCount = 0; + } + incrementProcessedItemsCount(issue, increment = 1) { + if (issue.isPullRequest) { + return this._incrementProcessedPullRequestsCount(increment); + } + return this._incrementProcessedIssuesCount(increment); + } + incrementStaleItemsCount(issue, increment = 1) { + if (issue.isPullRequest) { + return this._incrementStalePullRequestsCount(increment); + } + return this._incrementStaleIssuesCount(increment); + } + incrementUndoStaleItemsCount(issue, increment = 1) { + if (issue.isPullRequest) { + return this._incrementUndoStalePullRequestsCount(increment); + } + return this._incrementUndoStaleIssuesCount(increment); + } + setOperationsCount(operationsCount) { + this.operationsCount = operationsCount; + return this; + } + incrementClosedItemsCount(issue, increment = 1) { + if (issue.isPullRequest) { + return this._incrementClosedPullRequestsCount(increment); + } + return this._incrementClosedIssuesCount(increment); + } + incrementDeletedItemsLabelsCount(issue, increment = 1) { + if (issue.isPullRequest) { + return this._incrementDeletedPullRequestsLabelsCount(increment); + } + return this._incrementDeletedIssuesLabelsCount(increment); + } + incrementDeletedCloseItemsLabelsCount(issue, increment = 1) { + if (issue.isPullRequest) { + return this._incrementDeletedClosePullRequestsLabelsCount(increment); + } + return this._incrementDeletedCloseIssuesLabelsCount(increment); + } + incrementDeletedBranchesCount(increment = 1) { + this.deletedBranchesCount += increment; + return this; + } + incrementAddedItemsLabel(issue, increment = 1) { + if (issue.isPullRequest) { + return this._incrementAddedPullRequestsLabel(increment); + } + return this._incrementAddedIssuesLabel(increment); + } + incrementAddedItemsComment(issue, increment = 1) { + if (issue.isPullRequest) { + return this._incrementAddedPullRequestsComment(increment); + } + return this._incrementAddedIssuesComment(increment); + } + incrementFetchedItemsCount(increment = 1) { + this.fetchedItemsCount += increment; + return this; + } + incrementFetchedItemsEventsCount(increment = 1) { + this.fetchedItemsEventsCount += increment; + return this; + } + incrementFetchedItemsCommentsCount(increment = 1) { + this.fetchedItemsCommentsCount += increment; + return this; + } + incrementFetchedPullRequestsCount(increment = 1) { + this.fetchedPullRequestsCount += increment; + return this; + } + logStats() { + this._logger.info(logger_service_1.LoggerService.yellow(logger_service_1.LoggerService.bold(`Statistics:`))); + this._logProcessedIssuesAndPullRequestsCount(); + this._logStaleIssuesAndPullRequestsCount(); + this._logUndoStaleIssuesAndPullRequestsCount(); + this._logClosedIssuesAndPullRequestsCount(); + this._logDeletedIssuesAndPullRequestsLabelsCount(); + this._logDeletedCloseIssuesAndPullRequestsLabelsCount(); + this._logDeletedBranchesCount(); + this._logAddedIssuesAndPullRequestsLabelsCount(); + this._logAddedIssuesAndPullRequestsCommentsCount(); + this._logFetchedItemsCount(); + this._logFetchedItemsEventsCount(); + this._logFetchedItemsCommentsCount(); + this._logFetchedPullRequestsCount(); + this._logOperationsCount(); + return this; + } + _incrementProcessedIssuesCount(increment = 1) { + this.processedIssuesCount += increment; + return this; + } + _incrementProcessedPullRequestsCount(increment = 1) { + this.processedPullRequestsCount += increment; + return this; + } + _incrementStaleIssuesCount(increment = 1) { + this.staleIssuesCount += increment; + return this; + } + _incrementStalePullRequestsCount(increment = 1) { + this.stalePullRequestsCount += increment; + return this; + } + _incrementUndoStaleIssuesCount(increment = 1) { + this.undoStaleIssuesCount += increment; + return this; + } + _incrementUndoStalePullRequestsCount(increment = 1) { + this.undoStalePullRequestsCount += increment; + return this; + } + _incrementClosedIssuesCount(increment = 1) { + this.closedIssuesCount += increment; + return this; + } + _incrementClosedPullRequestsCount(increment = 1) { + this.closedPullRequestsCount += increment; + return this; + } + _incrementDeletedIssuesLabelsCount(increment = 1) { + this.deletedIssuesLabelsCount += increment; + return this; + } + _incrementDeletedPullRequestsLabelsCount(increment = 1) { + this.deletedPullRequestsLabelsCount += increment; + return this; + } + _incrementDeletedCloseIssuesLabelsCount(increment = 1) { + this.deletedCloseIssuesLabelsCount += increment; + return this; + } + _incrementDeletedClosePullRequestsLabelsCount(increment = 1) { + this.deletedClosePullRequestsLabelsCount += increment; + return this; + } + _incrementAddedIssuesLabel(increment = 1) { + this.addedIssuesLabelsCount += increment; + return this; + } + _incrementAddedPullRequestsLabel(increment = 1) { + this.addedPullRequestsLabelsCount += increment; + return this; + } + _incrementAddedIssuesComment(increment = 1) { + this.addedIssuesCommentsCount += increment; + return this; + } + _incrementAddedPullRequestsComment(increment = 1) { + this.addedPullRequestsCommentsCount += increment; + return this; + } + _logProcessedIssuesAndPullRequestsCount() { + this._logGroup('Processed items', [ + { + name: 'Processed issues', + count: this.processedIssuesCount + }, + { + name: 'Processed PRs', + count: this.processedPullRequestsCount + } + ]); + } + _logStaleIssuesAndPullRequestsCount() { + this._logGroup('New stale items', [ + { + name: 'New stale issues', + count: this.staleIssuesCount + }, + { + name: 'New stale PRs', + count: this.stalePullRequestsCount + } + ]); + } + _logUndoStaleIssuesAndPullRequestsCount() { + this._logGroup('No longer stale items', [ + { + name: 'No longer stale issues', + count: this.undoStaleIssuesCount + }, + { + name: 'No longer stale PRs', + count: this.undoStalePullRequestsCount + } + ]); + } + _logClosedIssuesAndPullRequestsCount() { + this._logGroup('Closed items', [ + { + name: 'Closed issues', + count: this.closedIssuesCount + }, + { + name: 'Closed PRs', + count: this.closedPullRequestsCount + } + ]); + } + _logDeletedIssuesAndPullRequestsLabelsCount() { + this._logGroup('Deleted items labels', [ + { + name: 'Deleted issues labels', + count: this.deletedIssuesLabelsCount + }, + { + name: 'Deleted PRs labels', + count: this.deletedPullRequestsLabelsCount + } + ]); + } + _logDeletedCloseIssuesAndPullRequestsLabelsCount() { + this._logGroup('Deleted close items labels', [ + { + name: 'Deleted close issues labels', + count: this.deletedCloseIssuesLabelsCount + }, + { + name: 'Deleted close PRs labels', + count: this.deletedClosePullRequestsLabelsCount + } + ]); + } + _logDeletedBranchesCount() { + this._logCount('Deleted branches', this.deletedBranchesCount); + } + _logAddedIssuesAndPullRequestsLabelsCount() { + this._logGroup('Added items labels', [ + { + name: 'Added issues labels', + count: this.addedIssuesLabelsCount + }, + { + name: 'Added PRs labels', + count: this.addedPullRequestsLabelsCount + } + ]); + } + _logAddedIssuesAndPullRequestsCommentsCount() { + this._logGroup('Added items comments', [ + { + name: 'Added issues comments', + count: this.addedIssuesCommentsCount + }, + { + name: 'Added PRs comments', + count: this.addedPullRequestsCommentsCount + } + ]); + } + _logFetchedItemsCount() { + this._logCount('Fetched items', this.fetchedItemsCount); + } + _logFetchedItemsEventsCount() { + this._logCount('Fetched items events', this.fetchedItemsEventsCount); + } + _logFetchedItemsCommentsCount() { + this._logCount('Fetched items comments', this.fetchedItemsCommentsCount); + } + _logFetchedPullRequestsCount() { + this._logCount('Fetched pull requests', this.fetchedPullRequestsCount); + } + _logOperationsCount() { + this._logCount('Operations performed', this.operationsCount); + } + _logCount(name, count) { + if (count > 0) { + this._logger.info(`${name}:`, logger_service_1.LoggerService.cyan(count)); + } + } + _logGroup(groupName, values) { + if (this._isGroupValuesPartiallySet(values)) { + this._logCount(groupName, this._getGroupValuesTotalCount(values)); + this._logGroupValues(values); + } + else { + // Only one value will be display + for (const value of values) { + this._logCount(value.name, value.count); + } + } + } + /** + * @private + * @description + * If there is a least two elements with a valid count then it's partially set + * Useful to defined if we should display the values as a group or not + * + * @param {IGroupValue[]} values The list of group values to check + */ + _isGroupValuesPartiallySet(values) { + return (values + .map((value) => { + return value.count > 0; + }) + .filter((isSet) => isSet).length >= 2); + } + _getGroupValuesTotalCount(values) { + return values.reduce((count, value) => { + return count + value.count; + }, 0); + } + _getAllGroupValuesSet(values) { + return values.filter((value) => { + return value.count > 0; + }); + } + _logGroupValues(values) { + const onlyValuesSet = this._getAllGroupValuesSet(values); + const longestValue = this._getLongestGroupValue(onlyValuesSet); + for (const [index, value] of onlyValuesSet.entries()) { + const prefix = index === onlyValuesSet.length - 1 ? '└──' : '├──'; + this._logCount(`${logger_service_1.LoggerService.white(prefix)} ${value.name.padEnd(longestValue, ' ')}`, value.count); + } + } + _getLongestGroupValue(values) { + return values.reduce((longestValue, value) => { + return value.name.length > longestValue + ? value.name.length + : longestValue; + }, 0); + } +} +exports.Statistics = Statistics; /***/ }), @@ -1821,60 +1789,58 @@ exports.Statistics = Statistics; /***/ ((__unused_webpack_module, exports) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Option = void 0; -var Option; -(function (Option) { - Option["RepoToken"] = "repo-token"; - Option["StaleIssueMessage"] = "stale-issue-message"; - Option["StalePrMessage"] = "stale-pr-message"; - Option["CloseIssueMessage"] = "close-issue-message"; - Option["ClosePrMessage"] = "close-pr-message"; - Option["DaysBeforeStale"] = "days-before-stale"; - Option["DaysBeforeIssueStale"] = "days-before-issue-stale"; - Option["DaysBeforePrStale"] = "days-before-pr-stale"; - Option["DaysBeforeClose"] = "days-before-close"; - Option["DaysBeforeIssueClose"] = "days-before-issue-close"; - Option["DaysBeforePrClose"] = "days-before-pr-close"; - Option["StaleIssueLabel"] = "stale-issue-label"; - Option["CloseIssueLabel"] = "close-issue-label"; - Option["ExemptIssueLabels"] = "exempt-issue-labels"; - Option["StalePrLabel"] = "stale-pr-label"; - Option["ClosePrLabel"] = "close-pr-label"; - Option["ExemptPrLabels"] = "exempt-pr-labels"; - Option["OnlyLabels"] = "only-labels"; - Option["OnlyIssueLabels"] = "only-issue-labels"; - Option["OnlyPrLabels"] = "only-pr-labels"; - Option["AnyOfLabels"] = "any-of-labels"; - Option["OperationsPerRun"] = "operations-per-run"; - Option["RemoveStaleWhenUpdated"] = "remove-stale-when-updated"; - Option["RemoveIssueStaleWhenUpdated"] = "remove-issue-stale-when-updated"; - Option["RemovePrStaleWhenUpdated"] = "remove-pr-stale-when-updated"; - Option["DebugOnly"] = "debug-only"; - Option["Ascending"] = "ascending"; - Option["DeleteBranch"] = "delete-branch"; - Option["StartDate"] = "start-date"; - Option["ExemptMilestones"] = "exempt-milestones"; - Option["ExemptIssueMilestones"] = "exempt-issue-milestones"; - Option["ExemptPrMilestones"] = "exempt-pr-milestones"; - Option["ExemptAllMilestones"] = "exempt-all-milestones"; - Option["ExemptAllIssueMilestones"] = "exempt-all-issue-milestones"; - Option["ExemptAllPrMilestones"] = "exempt-all-pr-milestones"; - Option["ExemptAssignees"] = "exempt-assignees"; - Option["ExemptIssueAssignees"] = "exempt-issue-assignees"; - Option["ExemptPrAssignees"] = "exempt-pr-assignees"; - Option["ExemptAllAssignees"] = "exempt-all-assignees"; - Option["ExemptAllIssueAssignees"] = "exempt-all-issue-assignees"; - Option["ExemptAllPrAssignees"] = "exempt-all-pr-assignees"; - Option["EnableStatistics"] = "enable-statistics"; - Option["LabelsToRemoveWhenUnstale"] = "labels-to-remove-when-unstale"; - Option["LabelsToAddWhenUnstale"] = "labels-to-add-when-unstale"; - Option["IgnoreUpdates"] = "ignore-updates"; - Option["IgnoreIssueUpdates"] = "ignore-issue-updates"; - Option["IgnorePrUpdates"] = "ignore-pr-updates"; - Option["ExemptDraftPr"] = "exempt-draft-pr"; -})(Option = exports.Option || (exports.Option = {})); + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Option = void 0; +var Option; +(function (Option) { + Option["RepoToken"] = "repo-token"; + Option["StaleIssueMessage"] = "stale-issue-message"; + Option["StalePrMessage"] = "stale-pr-message"; + Option["CloseIssueMessage"] = "close-issue-message"; + Option["ClosePrMessage"] = "close-pr-message"; + Option["DaysBeforeStale"] = "days-before-stale"; + Option["DaysBeforeIssueStale"] = "days-before-issue-stale"; + Option["DaysBeforePrStale"] = "days-before-pr-stale"; + Option["DaysBeforeClose"] = "days-before-close"; + Option["DaysBeforeIssueClose"] = "days-before-issue-close"; + Option["DaysBeforePrClose"] = "days-before-pr-close"; + Option["StaleIssueLabel"] = "stale-issue-label"; + Option["CloseIssueLabel"] = "close-issue-label"; + Option["ExemptIssueLabels"] = "exempt-issue-labels"; + Option["StalePrLabel"] = "stale-pr-label"; + Option["ClosePrLabel"] = "close-pr-label"; + Option["ExemptPrLabels"] = "exempt-pr-labels"; + Option["OnlyLabels"] = "only-labels"; + Option["OnlyIssueLabels"] = "only-issue-labels"; + Option["OnlyPrLabels"] = "only-pr-labels"; + Option["AnyOfLabels"] = "any-of-labels"; + Option["OperationsPerRun"] = "operations-per-run"; + Option["RemoveStaleWhenUpdated"] = "remove-stale-when-updated"; + Option["RemoveIssueStaleWhenUpdated"] = "remove-issue-stale-when-updated"; + Option["RemovePrStaleWhenUpdated"] = "remove-pr-stale-when-updated"; + Option["DebugOnly"] = "debug-only"; + Option["Ascending"] = "ascending"; + Option["DeleteBranch"] = "delete-branch"; + Option["StartDate"] = "start-date"; + Option["ExemptMilestones"] = "exempt-milestones"; + Option["ExemptIssueMilestones"] = "exempt-issue-milestones"; + Option["ExemptPrMilestones"] = "exempt-pr-milestones"; + Option["ExemptAllMilestones"] = "exempt-all-milestones"; + Option["ExemptAllIssueMilestones"] = "exempt-all-issue-milestones"; + Option["ExemptAllPrMilestones"] = "exempt-all-pr-milestones"; + Option["ExemptAssignees"] = "exempt-assignees"; + Option["ExemptIssueAssignees"] = "exempt-issue-assignees"; + Option["ExemptPrAssignees"] = "exempt-pr-assignees"; + Option["ExemptAllIssueAssignees"] = "exempt-all-issue-assignees"; + Option["ExemptAllPrAssignees"] = "exempt-all-pr-assignees"; + Option["EnableStatistics"] = "enable-statistics"; + Option["LabelsToRemoveWhenUnstale"] = "labels-to-remove-when-unstale"; + Option["LabelsToAddWhenUnstale"] = "labels-to-add-when-unstale"; + Option["IgnoreIssueUpdates"] = "ignore-issue-updates"; + Option["IgnorePrUpdates"] = "ignore-pr-updates"; + Option["ExemptDraftPr"] = "exempt-draft-pr"; +})(Option = exports.Option || (exports.Option = {})); /***/ }), @@ -1883,25 +1849,25 @@ var Option; /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; - -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.cleanLabel = void 0; -const lodash_deburr_1 = __importDefault(__nccwpck_require__(1601)); -/** - * @description - * Clean a label by lowercasing it and deburring it for consistency - * - * @param {string} label A raw GitHub label - * - * @return {string} A lowercased, deburred version of the passed in label - */ -function cleanLabel(label) { - return lodash_deburr_1.default(label.toLowerCase()); -} -exports.cleanLabel = cleanLabel; + +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.cleanLabel = void 0; +const lodash_deburr_1 = __importDefault(__nccwpck_require__(1601)); +/** + * @description + * Clean a label by lowercasing it and deburring it for consistency + * + * @param {string} label A raw GitHub label + * + * @return {string} A lowercased, deburred version of the passed in label + */ +function cleanLabel(label) { + return lodash_deburr_1.default(label.toLowerCase()); +} +exports.cleanLabel = cleanLabel; /***/ }), @@ -1910,22 +1876,22 @@ exports.cleanLabel = cleanLabel; /***/ ((__unused_webpack_module, exports) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getHumanizedDate = void 0; -function getHumanizedDate(date) { - const year = date.getFullYear(); - let month = `${date.getMonth() + 1}`; - let day = `${date.getDate()}`; - if (month.length < 2) { - month = `0${month}`; - } - if (day.length < 2) { - day = `0${day}`; - } - return [day, month, year].join('-'); -} -exports.getHumanizedDate = getHumanizedDate; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getHumanizedDate = void 0; +function getHumanizedDate(date) { + const year = date.getFullYear(); + let month = `${date.getMonth() + 1}`; + let day = `${date.getDate()}`; + if (month.length < 2) { + month = `0${month}`; + } + if (day.length < 2) { + day = `0${day}`; + } + return [day, month, year].join('-'); +} +exports.getHumanizedDate = getHumanizedDate; /***/ }), @@ -1934,13 +1900,13 @@ exports.getHumanizedDate = getHumanizedDate; /***/ ((__unused_webpack_module, exports) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isDateMoreRecentThan = void 0; -function isDateMoreRecentThan(date, comparedDate) { - return date > comparedDate; -} -exports.isDateMoreRecentThan = isDateMoreRecentThan; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isDateMoreRecentThan = void 0; +function isDateMoreRecentThan(date, comparedDate) { + return date > comparedDate; +} +exports.isDateMoreRecentThan = isDateMoreRecentThan; /***/ }), @@ -1949,27 +1915,27 @@ exports.isDateMoreRecentThan = isDateMoreRecentThan; /***/ ((__unused_webpack_module, exports) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isValidDate = void 0; -/** - * @description - * Check if a date is valid - * - * @see - * https://stackoverflow.com/a/1353711/4440414 - * - * @param {Readonly} date The date to check - * - * @returns {boolean} true when the given date is valid - */ -function isValidDate(date) { - if (Object.prototype.toString.call(date) === '[object Date]') { - return !isNaN(date.getTime()); - } - return false; -} -exports.isValidDate = isValidDate; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isValidDate = void 0; +/** + * @description + * Check if a date is valid + * + * @see + * https://stackoverflow.com/a/1353711/4440414 + * + * @param {Readonly} date The date to check + * + * @returns {boolean} true when the given date is valid + */ +function isValidDate(date) { + if (Object.prototype.toString.call(date) === '[object Date]') { + return !isNaN(date.getTime()); + } + return false; +} +exports.isValidDate = isValidDate; /***/ }), @@ -1978,13 +1944,13 @@ exports.isValidDate = isValidDate; /***/ ((__unused_webpack_module, exports) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isBoolean = void 0; -function isBoolean(value) { - return value === true || value === false; -} -exports.isBoolean = isBoolean; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isBoolean = void 0; +function isBoolean(value) { + return value === true || value === false; +} +exports.isBoolean = isBoolean; /***/ }), @@ -1993,25 +1959,25 @@ exports.isBoolean = isBoolean; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isLabeled = void 0; -const clean_label_1 = __nccwpck_require__(7752); -/** - * @description - * Check if the given label is listed as a label of the given issue - * - * @param {Readonly} issue A GitHub issue containing some labels - * @param {Readonly} label The label to check the presence with - * - * @return {boolean} Return true when the given label is also in the given issue labels - */ -function isLabeled(issue, label) { - return !!issue.labels.find((issueLabel) => { - return clean_label_1.cleanLabel(label) === clean_label_1.cleanLabel(issueLabel.name); - }); -} -exports.isLabeled = isLabeled; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isLabeled = void 0; +const clean_label_1 = __nccwpck_require__(7752); +/** + * @description + * Check if the given label is listed as a label of the given issue + * + * @param {Readonly} issue A GitHub issue containing some labels + * @param {Readonly} label The label to check the presence with + * + * @return {boolean} Return true when the given label is also in the given issue labels + */ +function isLabeled(issue, label) { + return !!issue.labels.find((issueLabel) => { + return clean_label_1.cleanLabel(label) === clean_label_1.cleanLabel(issueLabel.name); + }); +} +exports.isLabeled = isLabeled; /***/ }), @@ -2020,13 +1986,13 @@ exports.isLabeled = isLabeled; /***/ ((__unused_webpack_module, exports) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isPullRequest = void 0; -function isPullRequest(issue) { - return !!issue.pull_request; -} -exports.isPullRequest = isPullRequest; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isPullRequest = void 0; +function isPullRequest(issue) { + return !!issue.pull_request; +} +exports.isPullRequest = isPullRequest; /***/ }), @@ -2035,13 +2001,13 @@ exports.isPullRequest = isPullRequest; /***/ ((__unused_webpack_module, exports) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.shouldMarkWhenStale = void 0; -function shouldMarkWhenStale(daysBeforeStale) { - return daysBeforeStale >= 0; -} -exports.shouldMarkWhenStale = shouldMarkWhenStale; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.shouldMarkWhenStale = void 0; +function shouldMarkWhenStale(daysBeforeStale) { + return daysBeforeStale >= 0; +} +exports.shouldMarkWhenStale = shouldMarkWhenStale; /***/ }), @@ -2050,32 +2016,32 @@ exports.shouldMarkWhenStale = shouldMarkWhenStale; /***/ ((__unused_webpack_module, exports) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.wordsToList = void 0; -/** - * @description - * Transform a string of comma separated words - * to an array of words - * - * @example - * wordsToList('label') => ['label'] - * wordsToList('label,label') => ['label', 'label'] - * wordsToList('kebab-label') => ['kebab-label'] - * wordsToList('kebab%20label') => ['kebab%20label'] - * wordsToList('label with words') => ['label with words'] - * - * @param {Readonly} words A string of comma separated words - * - * @return {string[]} A list of words - */ -function wordsToList(words) { - if (!words.length) { - return []; - } - return words.split(',').map((word) => word.trim()); -} -exports.wordsToList = wordsToList; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.wordsToList = void 0; +/** + * @description + * Transform a string of comma separated words + * to an array of words + * + * @example + * wordsToList('label') => ['label'] + * wordsToList('label,label') => ['label', 'label'] + * wordsToList('kebab-label') => ['kebab-label'] + * wordsToList('kebab%20label') => ['kebab%20label'] + * wordsToList('label with words') => ['label with words'] + * + * @param {Readonly} words A string of comma separated words + * + * @return {string[]} A list of words + */ +function wordsToList(words) { + if (!words.length) { + return []; + } + return words.split(',').map((word) => word.trim()); +} +exports.wordsToList = wordsToList; /***/ }), @@ -2084,159 +2050,157 @@ exports.wordsToList = wordsToList; /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -const core = __importStar(__nccwpck_require__(2186)); -const issues_processor_1 = __nccwpck_require__(3292); -const is_valid_date_1 = __nccwpck_require__(891); -function _run() { - return __awaiter(this, void 0, void 0, function* () { - try { - const args = _getAndValidateArgs(); - const issueProcessor = new issues_processor_1.IssuesProcessor(args); - yield issueProcessor.processIssues(); - yield processOutput(issueProcessor.staleIssues, issueProcessor.closedIssues); - } - catch (error) { - core.error(error); - core.setFailed(error.message); - } - }); -} -function _getAndValidateArgs() { - const args = { - repoToken: core.getInput('repo-token'), - staleIssueMessage: core.getInput('stale-issue-message'), - stalePrMessage: core.getInput('stale-pr-message'), - closeIssueMessage: core.getInput('close-issue-message'), - closePrMessage: core.getInput('close-pr-message'), - daysBeforeStale: parseInt(core.getInput('days-before-stale', { required: true })), - daysBeforeIssueStale: parseInt(core.getInput('days-before-issue-stale')), - daysBeforePrStale: parseInt(core.getInput('days-before-pr-stale')), - daysBeforeClose: parseInt(core.getInput('days-before-close', { required: true })), - daysBeforeIssueClose: parseInt(core.getInput('days-before-issue-close')), - daysBeforePrClose: parseInt(core.getInput('days-before-pr-close')), - staleIssueLabel: core.getInput('stale-issue-label', { required: true }), - closeIssueLabel: core.getInput('close-issue-label'), - exemptIssueLabels: core.getInput('exempt-issue-labels'), - stalePrLabel: core.getInput('stale-pr-label', { required: true }), - closePrLabel: core.getInput('close-pr-label'), - exemptPrLabels: core.getInput('exempt-pr-labels'), - onlyLabels: core.getInput('only-labels'), - onlyIssueLabels: core.getInput('only-issue-labels'), - onlyPrLabels: core.getInput('only-pr-labels'), - anyOfLabels: core.getInput('any-of-labels'), - anyOfIssueLabels: core.getInput('any-of-issue-labels'), - anyOfPrLabels: core.getInput('any-of-pr-labels'), - operationsPerRun: parseInt(core.getInput('operations-per-run', { required: true })), - removeStaleWhenUpdated: !(core.getInput('remove-stale-when-updated') === 'false'), - removeIssueStaleWhenUpdated: _toOptionalBoolean('remove-issue-stale-when-updated'), - removePrStaleWhenUpdated: _toOptionalBoolean('remove-pr-stale-when-updated'), - debugOnly: core.getInput('debug-only') === 'true', - ascending: core.getInput('ascending') === 'true', - deleteBranch: core.getInput('delete-branch') === 'true', - startDate: core.getInput('start-date') !== '' - ? core.getInput('start-date') - : undefined, - exemptMilestones: core.getInput('exempt-milestones'), - exemptIssueMilestones: core.getInput('exempt-issue-milestones'), - exemptPrMilestones: core.getInput('exempt-pr-milestones'), - exemptAllMilestones: core.getInput('exempt-all-milestones') === 'true', - exemptAllIssueMilestones: _toOptionalBoolean('exempt-all-issue-milestones'), - exemptAllPrMilestones: _toOptionalBoolean('exempt-all-pr-milestones'), - exemptAssignees: core.getInput('exempt-assignees'), - exemptIssueAssignees: core.getInput('exempt-issue-assignees'), - exemptPrAssignees: core.getInput('exempt-pr-assignees'), - exemptAllAssignees: core.getInput('exempt-all-assignees') === 'true', - exemptAllIssueAssignees: _toOptionalBoolean('exempt-all-issue-assignees'), - exemptAllPrAssignees: _toOptionalBoolean('exempt-all-pr-assignees'), - enableStatistics: core.getInput('enable-statistics') === 'true', - labelsToRemoveWhenUnstale: core.getInput('labels-to-remove-when-unstale'), - labelsToAddWhenUnstale: core.getInput('labels-to-add-when-unstale'), - ignoreUpdates: core.getInput('ignore-updates') === 'true', - ignoreIssueUpdates: _toOptionalBoolean('ignore-issue-updates'), - ignorePrUpdates: _toOptionalBoolean('ignore-pr-updates'), - exemptDraftPr: core.getInput('exempt-draft-pr') === 'true' - }; - for (const numberInput of [ - 'days-before-stale', - 'days-before-close', - 'operations-per-run' - ]) { - if (isNaN(parseInt(core.getInput(numberInput)))) { - const errorMessage = `Option "${numberInput}" did not parse to a valid integer`; - core.setFailed(errorMessage); - throw new Error(errorMessage); - } - } - for (const optionalDateInput of ['start-date']) { - // Ignore empty dates because it is considered as the right type for a default value (so a valid one) - if (core.getInput(optionalDateInput) !== '') { - if (!is_valid_date_1.isValidDate(new Date(core.getInput(optionalDateInput)))) { - const errorMessage = `Option "${optionalDateInput}" did not parse to a valid date`; - core.setFailed(errorMessage); - throw new Error(errorMessage); - } - } - } - return args; -} -function processOutput(staledIssues, closedIssues) { - return __awaiter(this, void 0, void 0, function* () { - core.setOutput('staled-issues-prs', JSON.stringify(staledIssues)); - core.setOutput('closed-issues-prs', JSON.stringify(closedIssues)); - }); -} -/** - * @description - * From an argument name, get the value as an optional boolean - * This is very useful for all the arguments that override others - * It will allow us to easily use the original one when the return value is `undefined` - * Which is different from `true` or `false` that consider the argument as set - * - * @param {Readonly} argumentName The name of the argument to check - * - * @returns {boolean | undefined} The value matching the given argument name - */ -function _toOptionalBoolean(argumentName) { - const argument = core.getInput(argumentName); - if (argument === 'true') { - return true; - } - else if (argument === 'false') { - return false; - } - return undefined; -} -void _run(); + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +const core = __importStar(__nccwpck_require__(2186)); +const issues_processor_1 = __nccwpck_require__(3292); +const is_valid_date_1 = __nccwpck_require__(891); +function _run() { + return __awaiter(this, void 0, void 0, function* () { + try { + const args = _getAndValidateArgs(); + const issueProcessor = new issues_processor_1.IssuesProcessor(args); + yield issueProcessor.processIssues(); + yield processOutput(issueProcessor.staleIssues, issueProcessor.closedIssues); + } + catch (error) { + core.error(error); + core.setFailed(error.message); + } + }); +} +function _getAndValidateArgs() { + const args = { + repoToken: core.getInput('repo-token'), + staleIssueMessage: core.getInput('stale-issue-message'), + stalePrMessage: core.getInput('stale-pr-message'), + closeIssueMessage: core.getInput('close-issue-message'), + closePrMessage: core.getInput('close-pr-message'), + daysBeforeStale: parseInt(core.getInput('days-before-stale', { required: true })), + daysBeforeIssueStale: parseInt(core.getInput('days-before-issue-stale')), + daysBeforePrStale: parseInt(core.getInput('days-before-pr-stale')), + daysBeforeClose: parseInt(core.getInput('days-before-close', { required: true })), + daysBeforeIssueClose: parseInt(core.getInput('days-before-issue-close')), + daysBeforePrClose: parseInt(core.getInput('days-before-pr-close')), + staleIssueLabel: core.getInput('stale-issue-label', { required: true }), + closeIssueLabel: core.getInput('close-issue-label'), + exemptIssueLabels: core.getInput('exempt-issue-labels'), + stalePrLabel: core.getInput('stale-pr-label', { required: true }), + closePrLabel: core.getInput('close-pr-label'), + exemptPrLabels: core.getInput('exempt-pr-labels'), + onlyLabels: core.getInput('only-labels'), + onlyIssueLabels: core.getInput('only-issue-labels'), + onlyPrLabels: core.getInput('only-pr-labels'), + anyOfLabels: core.getInput('any-of-labels'), + anyOfIssueLabels: core.getInput('any-of-issue-labels'), + anyOfPrLabels: core.getInput('any-of-pr-labels'), + operationsPerRun: parseInt(core.getInput('operations-per-run', { required: true })), + removeStaleWhenUpdated: !(core.getInput('remove-stale-when-updated') === 'false'), + removeIssueStaleWhenUpdated: _toOptionalBoolean('remove-issue-stale-when-updated'), + removePrStaleWhenUpdated: _toOptionalBoolean('remove-pr-stale-when-updated'), + debugOnly: core.getInput('debug-only') === 'true', + ascending: core.getInput('ascending') === 'true', + deleteBranch: core.getInput('delete-branch') === 'true', + startDate: core.getInput('start-date') !== '' + ? core.getInput('start-date') + : undefined, + exemptMilestones: core.getInput('exempt-milestones'), + exemptIssueMilestones: core.getInput('exempt-issue-milestones'), + exemptPrMilestones: core.getInput('exempt-pr-milestones'), + exemptAllMilestones: core.getInput('exempt-all-milestones') === 'true', + exemptAllIssueMilestones: _toOptionalBoolean('exempt-all-issue-milestones'), + exemptAllPrMilestones: _toOptionalBoolean('exempt-all-pr-milestones'), + exemptAssignees: core.getInput('exempt-assignees'), + exemptIssueAssignees: core.getInput('exempt-issue-assignees'), + exemptPrAssignees: core.getInput('exempt-pr-assignees'), + exemptAllIssueAssignees: core.getInput('exempt-all-issue-assignees') === 'true', + exemptAllPrAssignees: core.getInput('exempt-all-pr-assignees') === 'true', + enableStatistics: core.getInput('enable-statistics') === 'true', + labelsToRemoveWhenUnstale: core.getInput('labels-to-remove-when-unstale'), + labelsToAddWhenUnstale: core.getInput('labels-to-add-when-unstale'), + ignoreIssueUpdates: core.getInput('ignore-issue-updates') === 'true', + ignorePrUpdates: core.getInput('ignore-pr-updates') === 'true', + exemptDraftPr: core.getInput('exempt-draft-pr') === 'true' + }; + for (const numberInput of [ + 'days-before-stale', + 'days-before-close', + 'operations-per-run' + ]) { + if (isNaN(parseInt(core.getInput(numberInput)))) { + const errorMessage = `Option "${numberInput}" did not parse to a valid integer`; + core.setFailed(errorMessage); + throw new Error(errorMessage); + } + } + for (const optionalDateInput of ['start-date']) { + // Ignore empty dates because it is considered as the right type for a default value (so a valid one) + if (core.getInput(optionalDateInput) !== '') { + if (!is_valid_date_1.isValidDate(new Date(core.getInput(optionalDateInput)))) { + const errorMessage = `Option "${optionalDateInput}" did not parse to a valid date`; + core.setFailed(errorMessage); + throw new Error(errorMessage); + } + } + } + return args; +} +function processOutput(staledIssues, closedIssues) { + return __awaiter(this, void 0, void 0, function* () { + core.setOutput('staled-issues-prs', JSON.stringify(staledIssues)); + core.setOutput('closed-issues-prs', JSON.stringify(closedIssues)); + }); +} +/** + * @description + * From an argument name, get the value as an optional boolean + * This is very useful for all the arguments that override others + * It will allow us to easily use the original one when the return value is `undefined` + * Which is different from `true` or `false` that consider the argument as set + * + * @param {Readonly} argumentName The name of the argument to check + * + * @returns {boolean | undefined} The value matching the given argument name + */ +function _toOptionalBoolean(argumentName) { + const argument = core.getInput(argumentName); + if (argument === 'true') { + return true; + } + else if (argument === 'false') { + return false; + } + return undefined; +} +void _run(); /***/ }), @@ -2245,49 +2209,49 @@ void _run(); /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; - -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LoggerService = void 0; -const ansi_styles_1 = __importDefault(__nccwpck_require__(2068)); -class LoggerService { - static whiteBright(message) { - return this._format(message, 'whiteBright'); - } - static yellowBright(message) { - return this._format(message, 'yellowBright'); - } - static magenta(message) { - return this._format(message, 'magenta'); - } - static cyan(message) { - return this._format(message, 'cyan'); - } - static yellow(message) { - return this._format(message, 'yellow'); - } - static white(message) { - return this._format(message, 'white'); - } - static green(message) { - return this._format(message, 'green'); - } - static red(message) { - return this._format(message, 'red'); - } - static blue(message) { - return this._format(message, 'blue'); - } - static bold(message) { - return this._format(message, 'bold'); - } - static _format(message, style) { - return `${ansi_styles_1.default[style].open}${message}${ansi_styles_1.default[style].close}`; - } -} -exports.LoggerService = LoggerService; + +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.LoggerService = void 0; +const ansi_styles_1 = __importDefault(__nccwpck_require__(2068)); +class LoggerService { + static whiteBright(message) { + return this._format(message, 'whiteBright'); + } + static yellowBright(message) { + return this._format(message, 'yellowBright'); + } + static magenta(message) { + return this._format(message, 'magenta'); + } + static cyan(message) { + return this._format(message, 'cyan'); + } + static yellow(message) { + return this._format(message, 'yellow'); + } + static white(message) { + return this._format(message, 'white'); + } + static green(message) { + return this._format(message, 'green'); + } + static red(message) { + return this._format(message, 'red'); + } + static blue(message) { + return this._format(message, 'blue'); + } + static bold(message) { + return this._format(message, 'bold'); + } + static _format(message, style) { + return `${ansi_styles_1.default[style].open}${message}${ansi_styles_1.default[style].close}`; + } +} +exports.LoggerService = LoggerService; /***/ }), diff --git a/src/classes/assignees.spec.ts b/src/classes/assignees.spec.ts index c74666f6f..0a5feb390 100644 --- a/src/classes/assignees.spec.ts +++ b/src/classes/assignees.spec.ts @@ -14,7 +14,8 @@ describe('Assignees', (): void => { beforeEach((): void => { optionsInterface = { ...DefaultProcessorOptions, - exemptAllAssignees: false + exemptAllIssueAssignees: false, + exemptAllPrAssignees: false }; issueInterface = generateIIssue(); }); @@ -316,9 +317,9 @@ describe('Assignees', (): void => { }); }); - describe('when the given options are configured to exempt all assignees', (): void => { + describe('when the given options are not configured to exempt all issue assignees', (): void => { beforeEach((): void => { - optionsInterface.exemptAllAssignees = true; + optionsInterface.exemptAllIssueAssignees = false; }); describe('when the given issue does not have an assignee', (): void => { @@ -347,100 +348,57 @@ describe('Assignees', (): void => { ]; }); - it('should return true', (): void => { + it('should return false', (): void => { expect.assertions(1); issue = new Issue(optionsInterface, issueInterface); assignees = new Assignees(optionsInterface, issue); const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(true); + expect(result).toStrictEqual(false); }); }); + }); - describe('when the given options are not configured to exempt all issue assignees', (): void => { - beforeEach((): void => { - optionsInterface.exemptAllIssueAssignees = false; - }); - - describe('when the given issue does not have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = []; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); - - const result = assignees.shouldExemptAssignees(); + describe('when the given options are configured to exempt all issue assignees', (): void => { + beforeEach((): void => { + optionsInterface.exemptAllIssueAssignees = true; + }); - expect(result).toStrictEqual(false); - }); + describe('when the given issue does not have an assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = []; }); - describe('when the given issue does have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-exempt-assignee', - type: 'User' - } - ]; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); }); - describe('when the given options are configured to exempt all issue assignees', (): void => { + describe('when the given issue does have an assignee', (): void => { beforeEach((): void => { - optionsInterface.exemptAllIssueAssignees = true; - }); - - describe('when the given issue does not have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = []; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); - - const result = assignees.shouldExemptAssignees(); - - expect(result).toStrictEqual(false); - }); + issueInterface.assignees = [ + { + login: 'dummy-exempt-issue-assignee', + type: 'User' + } + ]; }); - describe('when the given issue does have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-exempt-issue-assignee', - type: 'User' - } - ]; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return true', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(true); - }); + expect(result).toStrictEqual(true); }); }); }); @@ -740,9 +698,9 @@ describe('Assignees', (): void => { }); }); - describe('when the given options are configured to exempt all assignees', (): void => { + describe('when the given options are not configured to exempt all pull request assignees', (): void => { beforeEach((): void => { - optionsInterface.exemptAllAssignees = true; + optionsInterface.exemptAllPrAssignees = false; }); describe('when the given pull request does not have an assignee', (): void => { @@ -771,100 +729,57 @@ describe('Assignees', (): void => { ]; }); - it('should return true', (): void => { + it('should return false', (): void => { expect.assertions(1); issue = new Issue(optionsInterface, issueInterface); assignees = new Assignees(optionsInterface, issue); const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(true); + expect(result).toStrictEqual(false); }); }); + }); - describe('when the given options are not configured to exempt all pull request assignees', (): void => { - beforeEach((): void => { - optionsInterface.exemptAllPrAssignees = false; - }); - - describe('when the given pull request does not have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = []; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); - - const result = assignees.shouldExemptAssignees(); + describe('when the given options are configured to exempt all pull request assignees', (): void => { + beforeEach((): void => { + optionsInterface.exemptAllPrAssignees = true; + }); - expect(result).toStrictEqual(false); - }); + describe('when the given pull request does not have an assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = []; }); - describe('when the given pull request does have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-exempt-assignee', - type: 'User' - } - ]; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); }); - describe('when the given options are configured to exempt all pull request assignees', (): void => { + describe('when the given pull request does have an assignee', (): void => { beforeEach((): void => { - optionsInterface.exemptAllPrAssignees = true; - }); - - describe('when the given pull request does not have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = []; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); - - const result = assignees.shouldExemptAssignees(); - - expect(result).toStrictEqual(false); - }); + issueInterface.assignees = [ + { + login: 'dummy-exempt-issue-assignee', + type: 'User' + } + ]; }); - describe('when the given pull request does have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-exempt-issue-assignee', - type: 'User' - } - ]; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return true', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(true); - }); + expect(result).toStrictEqual(true); }); }); }); diff --git a/src/classes/assignees.ts b/src/classes/assignees.ts index c2492377e..a1bca1734 100644 --- a/src/classes/assignees.ts +++ b/src/classes/assignees.ts @@ -1,290 +1,266 @@ -import deburr from 'lodash.deburr'; -import {Option} from '../enums/option'; -import {wordsToList} from '../functions/words-to-list'; -import {Assignee} from '../interfaces/assignee'; -import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options'; -import {Issue} from './issue'; -import {IssueLogger} from './loggers/issue-logger'; -import {LoggerService} from '../services/logger.service'; - -type CleanAssignee = string; - -export class Assignees { - private readonly _options: IIssuesProcessorOptions; - private readonly _issue: Issue; - private readonly _issueLogger: IssueLogger; - - constructor(options: Readonly, issue: Issue) { - this._options = options; - this._issue = issue; - this._issueLogger = new IssueLogger(issue); - } - - private static _cleanAssignee(assignee: Readonly): CleanAssignee { - return deburr(assignee.toLowerCase()); - } - - shouldExemptAssignees(): boolean { - if (!this._issue.hasAssignees) { - this._issueLogger.info('This $$type has no assignee'); - this._logSkip(); - - return false; - } - - if (this._shouldExemptAllAssignees()) { - this._issueLogger.info( - LoggerService.white('└──'), - 'Skipping this $$type because it has an exempt assignee' - ); - - return true; - } - - const exemptAssignees: string[] = this._getExemptAssignees(); - - if (exemptAssignees.length === 0) { - this._issueLogger.info( - LoggerService.white('├──'), - `No assignee option was specified to skip the stale process for this $$type` - ); - this._logSkip(); - - return false; - } - - this._issueLogger.info( - LoggerService.white('├──'), - `Found ${LoggerService.cyan(exemptAssignees.length)} assignee${ - exemptAssignees.length > 1 ? 's' : '' - } that can exempt stale on this $$type` - ); - - const hasExemptAssignee: boolean = exemptAssignees.some( - (exemptAssignee: Readonly): boolean => - this._hasAssignee(exemptAssignee) - ); - - if (!hasExemptAssignee) { - this._issueLogger.info( - LoggerService.white('├──'), - 'No assignee on this $$type can exempt the stale process' - ); - this._logSkip(); - } else { - this._issueLogger.info( - LoggerService.white('└──'), - 'Skipping this $$type because it has an exempt assignee' - ); - } - - return hasExemptAssignee; - } - - private _getExemptAssignees(): string[] { - return this._issue.isPullRequest - ? this._getExemptPullRequestAssignees() - : this._getExemptIssueAssignees(); - } - - private _getExemptIssueAssignees(): string[] { - if (this._options.exemptIssueAssignees === '') { - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptIssueAssignees - )} is disabled. No specific assignee can skip the stale process for this $$type` - ); - - if (this._options.exemptAssignees === '') { - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAssignees - )} is disabled. No specific assignee can skip the stale process for this $$type` - ); - - return []; - } - - const exemptAssignees: string[] = wordsToList( - this._options.exemptAssignees - ); - - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAssignees - )} is set. ${LoggerService.cyan(exemptAssignees.length)} assignee${ - exemptAssignees.length === 1 ? '' : 's' - } can skip the stale process for this $$type` - ); - - return exemptAssignees; - } - - const exemptAssignees: string[] = wordsToList( - this._options.exemptIssueAssignees - ); - - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptIssueAssignees - )} is set. ${LoggerService.cyan(exemptAssignees.length)} assignee${ - exemptAssignees.length === 1 ? '' : 's' - } can skip the stale process for this $$type` - ); - - return exemptAssignees; - } - - private _getExemptPullRequestAssignees(): string[] { - if (this._options.exemptPrAssignees === '') { - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptPrAssignees - )} is disabled. No specific assignee can skip the stale process for this $$type` - ); - - if (this._options.exemptAssignees === '') { - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAssignees - )} is disabled. No specific assignee can skip the stale process for this $$type` - ); - - return []; - } - - const exemptAssignees: string[] = wordsToList( - this._options.exemptAssignees - ); - - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAssignees - )} is set. ${LoggerService.cyan(exemptAssignees.length)} assignee${ - exemptAssignees.length === 1 ? '' : 's' - } can skip the stale process for this $$type` - ); - - return exemptAssignees; - } - - const exemptAssignees: string[] = wordsToList( - this._options.exemptPrAssignees - ); - - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptPrAssignees - )} is set. ${LoggerService.cyan(exemptAssignees.length)} assignee${ - exemptAssignees.length === 1 ? '' : 's' - } can skip the stale process for this $$type` - ); - - return exemptAssignees; - } - - private _hasAssignee(assignee: Readonly): boolean { - const cleanAssignee: CleanAssignee = Assignees._cleanAssignee(assignee); - - return this._issue.assignees.some( - (issueAssignee: Readonly): boolean => { - const isSameAssignee: boolean = - cleanAssignee === Assignees._cleanAssignee(issueAssignee.login); - - if (isSameAssignee) { - this._issueLogger.info( - LoggerService.white('├──'), - `@${issueAssignee.login} is assigned on this $$type and is an exempt assignee` - ); - } - - return isSameAssignee; - } - ); - } - - private _shouldExemptAllAssignees(): boolean { - return this._issue.isPullRequest - ? this._shouldExemptAllPullRequestAssignees() - : this._shouldExemptAllIssueAssignees(); - } - - private _shouldExemptAllIssueAssignees(): boolean { - if (this._options.exemptAllIssueAssignees === true) { - this._issueLogger.info( - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAllIssueAssignees - )} is enabled. Any assignee on this $$type will skip the stale process` - ); - - return true; - } else if (this._options.exemptAllIssueAssignees === false) { - this._issueLogger.info( - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAllIssueAssignees - )} is disabled. Only some specific assignees on this $$type will skip the stale process` - ); - - return false; - } - - this._logExemptAllAssigneesOption(); - - return this._options.exemptAllAssignees; - } - - private _shouldExemptAllPullRequestAssignees(): boolean { - if (this._options.exemptAllPrAssignees === true) { - this._issueLogger.info( - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAllPrAssignees - )} is enabled. Any assignee on this $$type will skip the stale process` - ); - - return true; - } else if (this._options.exemptAllPrAssignees === false) { - this._issueLogger.info( - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAllPrAssignees - )} is disabled. Only some specific assignees on this $$type will skip the stale process` - ); - - return false; - } - - this._logExemptAllAssigneesOption(); - - return this._options.exemptAllAssignees; - } - - private _logExemptAllAssigneesOption(): void { - if (this._options.exemptAllAssignees) { - this._issueLogger.info( - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAllAssignees - )} is enabled. Any assignee on this $$type will skip the stale process` - ); - } else { - this._issueLogger.info( - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAllAssignees - )} is disabled. Only some specific assignees on this $$type will skip the stale process` - ); - } - } - - private _logSkip(): void { - this._issueLogger.info( - LoggerService.white('└──'), - 'Skip the assignees checks' - ); - } -} +import deburr from 'lodash.deburr'; +import {Option} from '../enums/option'; +import {wordsToList} from '../functions/words-to-list'; +import {Assignee} from '../interfaces/assignee'; +import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options'; +import {Issue} from './issue'; +import {IssueLogger} from './loggers/issue-logger'; +import {LoggerService} from '../services/logger.service'; + +type CleanAssignee = string; + +export class Assignees { + private readonly _options: IIssuesProcessorOptions; + private readonly _issue: Issue; + private readonly _issueLogger: IssueLogger; + + constructor(options: Readonly, issue: Issue) { + this._options = options; + this._issue = issue; + this._issueLogger = new IssueLogger(issue); + } + + private static _cleanAssignee(assignee: Readonly): CleanAssignee { + return deburr(assignee.toLowerCase()); + } + + shouldExemptAssignees(): boolean { + if (!this._issue.hasAssignees) { + this._issueLogger.info('This $$type has no assignee'); + this._logSkip(); + + return false; + } + + if (this._shouldExemptAllAssignees()) { + this._issueLogger.info( + LoggerService.white('└──'), + 'Skipping this $$type because it has an exempt assignee' + ); + + return true; + } + + const exemptAssignees: string[] = this._getExemptAssignees(); + + if (exemptAssignees.length === 0) { + this._issueLogger.info( + LoggerService.white('├──'), + `No assignee option was specified to skip the stale process for this $$type` + ); + this._logSkip(); + + return false; + } + + this._issueLogger.info( + LoggerService.white('├──'), + `Found ${LoggerService.cyan(exemptAssignees.length)} assignee${ + exemptAssignees.length > 1 ? 's' : '' + } that can exempt stale on this $$type` + ); + + const hasExemptAssignee: boolean = exemptAssignees.some( + (exemptAssignee: Readonly): boolean => + this._hasAssignee(exemptAssignee) + ); + + if (!hasExemptAssignee) { + this._issueLogger.info( + LoggerService.white('├──'), + 'No assignee on this $$type can exempt the stale process' + ); + this._logSkip(); + } else { + this._issueLogger.info( + LoggerService.white('└──'), + 'Skipping this $$type because it has an exempt assignee' + ); + } + + return hasExemptAssignee; + } + + private _getExemptAssignees(): string[] { + return this._issue.isPullRequest + ? this._getExemptPullRequestAssignees() + : this._getExemptIssueAssignees(); + } + + private _getExemptIssueAssignees(): string[] { + if (this._options.exemptIssueAssignees === '') { + this._issueLogger.info( + LoggerService.white('├──'), + `The option ${this._issueLogger.createOptionLink( + Option.ExemptIssueAssignees + )} is disabled. No specific assignee can skip the stale process for this $$type` + ); + + if (this._options.exemptAssignees === '') { + this._issueLogger.info( + LoggerService.white('├──'), + `The option ${this._issueLogger.createOptionLink( + Option.ExemptAssignees + )} is disabled. No specific assignee can skip the stale process for this $$type` + ); + + return []; + } + + const exemptAssignees: string[] = wordsToList( + this._options.exemptAssignees + ); + + this._issueLogger.info( + LoggerService.white('├──'), + `The option ${this._issueLogger.createOptionLink( + Option.ExemptAssignees + )} is set. ${LoggerService.cyan(exemptAssignees.length)} assignee${ + exemptAssignees.length === 1 ? '' : 's' + } can skip the stale process for this $$type` + ); + + return exemptAssignees; + } + + const exemptAssignees: string[] = wordsToList( + this._options.exemptIssueAssignees + ); + + this._issueLogger.info( + LoggerService.white('├──'), + `The option ${this._issueLogger.createOptionLink( + Option.ExemptIssueAssignees + )} is set. ${LoggerService.cyan(exemptAssignees.length)} assignee${ + exemptAssignees.length === 1 ? '' : 's' + } can skip the stale process for this $$type` + ); + + return exemptAssignees; + } + + private _getExemptPullRequestAssignees(): string[] { + if (this._options.exemptPrAssignees === '') { + this._issueLogger.info( + LoggerService.white('├──'), + `The option ${this._issueLogger.createOptionLink( + Option.ExemptPrAssignees + )} is disabled. No specific assignee can skip the stale process for this $$type` + ); + + if (this._options.exemptAssignees === '') { + this._issueLogger.info( + LoggerService.white('├──'), + `The option ${this._issueLogger.createOptionLink( + Option.ExemptAssignees + )} is disabled. No specific assignee can skip the stale process for this $$type` + ); + + return []; + } + + const exemptAssignees: string[] = wordsToList( + this._options.exemptAssignees + ); + + this._issueLogger.info( + LoggerService.white('├──'), + `The option ${this._issueLogger.createOptionLink( + Option.ExemptAssignees + )} is set. ${LoggerService.cyan(exemptAssignees.length)} assignee${ + exemptAssignees.length === 1 ? '' : 's' + } can skip the stale process for this $$type` + ); + + return exemptAssignees; + } + + const exemptAssignees: string[] = wordsToList( + this._options.exemptPrAssignees + ); + + this._issueLogger.info( + LoggerService.white('├──'), + `The option ${this._issueLogger.createOptionLink( + Option.ExemptPrAssignees + )} is set. ${LoggerService.cyan(exemptAssignees.length)} assignee${ + exemptAssignees.length === 1 ? '' : 's' + } can skip the stale process for this $$type` + ); + + return exemptAssignees; + } + + private _hasAssignee(assignee: Readonly): boolean { + const cleanAssignee: CleanAssignee = Assignees._cleanAssignee(assignee); + + return this._issue.assignees.some( + (issueAssignee: Readonly): boolean => { + const isSameAssignee: boolean = + cleanAssignee === Assignees._cleanAssignee(issueAssignee.login); + + if (isSameAssignee) { + this._issueLogger.info( + LoggerService.white('├──'), + `@${issueAssignee.login} is assigned on this $$type and is an exempt assignee` + ); + } + + return isSameAssignee; + } + ); + } + + private _shouldExemptAllAssignees(): boolean { + return this._issue.isPullRequest + ? this._shouldExemptAllPullRequestAssignees() + : this._shouldExemptAllIssueAssignees(); + } + + private _shouldExemptAllIssueAssignees(): boolean { + if (this._options.exemptAllIssueAssignees) { + this._issueLogger.info( + `The option ${this._issueLogger.createOptionLink( + Option.ExemptAllIssueAssignees + )} is enabled. Any assignee on this $$type will skip the stale process` + ); + + return true; + } + + this._issueLogger.info( + `The option ${this._issueLogger.createOptionLink( + Option.ExemptAllIssueAssignees + )} is disabled. Only some specific assignees on this $$type will skip the stale process` + ); + + return false; + } + + private _shouldExemptAllPullRequestAssignees(): boolean { + if (this._options.exemptAllPrAssignees) { + this._issueLogger.info( + `The option ${this._issueLogger.createOptionLink( + Option.ExemptAllPrAssignees + )} is enabled. Any assignee on this $$type will skip the stale process` + ); + + return true; + } + + this._issueLogger.info( + `The option ${this._issueLogger.createOptionLink( + Option.ExemptAllPrAssignees + )} is disabled. Only some specific assignees on this $$type will skip the stale process` + ); + + return false; + } + + private _logSkip(): void { + this._issueLogger.info( + LoggerService.white('└──'), + 'Skip the assignees checks' + ); + } +} diff --git a/src/classes/issue.spec.ts b/src/classes/issue.spec.ts index 6a361e435..a17f100c6 100644 --- a/src/classes/issue.spec.ts +++ b/src/classes/issue.spec.ts @@ -52,9 +52,8 @@ describe('Issue', (): void => { exemptAssignees: '', exemptIssueAssignees: '', exemptPrAssignees: '', - exemptAllAssignees: false, - exemptAllIssueAssignees: undefined, - exemptAllPrAssignees: undefined, + exemptAllIssueAssignees: false, + exemptAllPrAssignees: false, enableStatistics: false, labelsToRemoveWhenUnstale: '', labelsToAddWhenUnstale: '', diff --git a/src/enums/option.ts b/src/enums/option.ts index 0705fe510..916cd84ed 100644 --- a/src/enums/option.ts +++ b/src/enums/option.ts @@ -37,7 +37,6 @@ export enum Option { ExemptAssignees = 'exempt-assignees', ExemptIssueAssignees = 'exempt-issue-assignees', ExemptPrAssignees = 'exempt-pr-assignees', - ExemptAllAssignees = 'exempt-all-assignees', ExemptAllIssueAssignees = 'exempt-all-issue-assignees', ExemptAllPrAssignees = 'exempt-all-pr-assignees', EnableStatistics = 'enable-statistics', diff --git a/src/interfaces/issues-processor-options.ts b/src/interfaces/issues-processor-options.ts index ae55689ce..9de4c6b5d 100644 --- a/src/interfaces/issues-processor-options.ts +++ b/src/interfaces/issues-processor-options.ts @@ -41,9 +41,8 @@ export interface IIssuesProcessorOptions { exemptAssignees: string; exemptIssueAssignees: string; exemptPrAssignees: string; - exemptAllAssignees: boolean; - exemptAllIssueAssignees: boolean | undefined; - exemptAllPrAssignees: boolean | undefined; + exemptAllIssueAssignees: boolean; + exemptAllPrAssignees: boolean; enableStatistics: boolean; labelsToRemoveWhenUnstale: string; labelsToAddWhenUnstale: string; diff --git a/src/main.ts b/src/main.ts index 6f787cb9f..eedbf8edd 100644 --- a/src/main.ts +++ b/src/main.ts @@ -78,9 +78,9 @@ function _getAndValidateArgs(): IIssuesProcessorOptions { exemptAssignees: core.getInput('exempt-assignees'), exemptIssueAssignees: core.getInput('exempt-issue-assignees'), exemptPrAssignees: core.getInput('exempt-pr-assignees'), - exemptAllAssignees: core.getInput('exempt-all-assignees') === 'true', - exemptAllIssueAssignees: _toOptionalBoolean('exempt-all-issue-assignees'), - exemptAllPrAssignees: _toOptionalBoolean('exempt-all-pr-assignees'), + exemptAllIssueAssignees: + core.getInput('exempt-all-issue-assignees') === 'true', + exemptAllPrAssignees: core.getInput('exempt-all-pr-assignees') === 'true', enableStatistics: core.getInput('enable-statistics') === 'true', labelsToRemoveWhenUnstale: core.getInput('labels-to-remove-when-unstale'), labelsToAddWhenUnstale: core.getInput('labels-to-add-when-unstale'), From 4665995b654b338caee447984e033fd84d0cd7b0 Mon Sep 17 00:00:00 2001 From: TESTELIN Geoffrey Date: Fri, 8 Oct 2021 19:06:51 +0200 Subject: [PATCH 03/11] feat: remove the exempt-assignees option BREAKING CHANGE: The option exempt-assignees was removed --- README.md | 27 +- __tests__/assignees.spec.ts | 627 ++++++++-------- action.yml | 8 +- dist/index.js | 18 +- src/classes/assignees.spec.ts | 794 ++++++++++----------- src/classes/assignees.ts | 52 +- src/classes/issue.spec.ts | 1 - src/enums/option.ts | 1 - src/interfaces/issues-processor-options.ts | 1 - src/main.ts | 1 - 10 files changed, 714 insertions(+), 816 deletions(-) diff --git a/README.md b/README.md index 4cd6f3ddd..a25c234df 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,8 @@ Every argument is optional. | [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-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-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-issue-assignees](#exempt-issue-assignees) | Assignees on issues exempted from stale | | +| [exempt-pr-assignees](#exempt-pr-assignees) | Assignees on PRs exempted from stale | | | [exempt-all-issue-assignees](#exempt-all-issue-assignees) | Exempt all issues with assignees from stale | `false` | | [exempt-all-pr-assignees](#exempt-all-pr-assignees) | Exempt all PRs with assignees from stale | `false` | | [exempt-draft-pr](#exempt-draft-pr) | Skip the stale action for draft PRs | `false` | @@ -124,7 +123,8 @@ You can fine tune which issues or pull requests should be marked as stale based - [start-date](#start-date) - [exempt-milestones](#exempt-milestones) - [exempt-all-milestones](#exempt-all-milestones) -- [exempt-assignees](#exempt-assignees) +- [exempt-issue-assignees](#exempt-issue-assignees) +- [exempt-pr-assignees](#exempt-pr-assignees) - [exempt-all-issue-assignees](#exempt-all-issue-assignees) - [exempt-all-pr-assignees](#exempt-all-pr-assignees) - [ignore-issue-updates](#ignore-issue-updates) @@ -432,24 +432,21 @@ Override [exempt-all-milestones](#exempt-all-milestones) but only to exempt the Default value: unset -#### exempt-assignees +#### exempt-issue-assignees -An allow-list of assignee(s) to only process the issues or the pull requests that does not contain one of these assignee(s). +An allow-list of assignee(s) to only process the issues that does not contain one of these assignee(s). It can be a comma separated list of assignees (e.g: `marco,polo`). If unset (or an empty string), this option will not alter the stale workflow. Default value: unset -#### exempt-issue-assignees - -Override [exempt-assignees](#exempt-assignees) but only to process the issues that does not contain one of these assignee(s). - -Default value: unset - #### exempt-pr-assignees -Override [exempt-assignees](#exempt-assignees) but only to process the pull requests that does not contain one of these assignee(s). +An allow-list of assignee(s) to only process the pull requests that does not contain one of these assignee(s). +It can be a comma separated list of assignees (e.g: `marco,polo`). + +If unset (or an empty string), this option will not alter the stale workflow. Default value: unset @@ -457,7 +454,7 @@ Default value: unset If set to `true`, the issues with an assignee will not be marked as stale automatically. -Priority over [exempt-assignees](#exempt-assignees). +Priority over [exempt-issue-assignees](#exempt-issue-assignees). Default value: `false` @@ -465,7 +462,7 @@ Default value: `false` If set to `true`, the pull requests with an assignee will not be marked as stale automatically. -Priority over [exempt-assignees](#exempt-assignees). +Priority over [exempt-pr-assignees](#exempt-pr-assignees). Default value: `false` diff --git a/__tests__/assignees.spec.ts b/__tests__/assignees.spec.ts index 7e9b4907f..45e1a7962 100644 --- a/__tests__/assignees.spec.ts +++ b/__tests__/assignees.spec.ts @@ -10,7 +10,6 @@ interface ITestData { assignees: string[]; exemptAllIssueAssignees: boolean; exemptAllPrAssignees: boolean; - exemptAssignees: string; exemptIssueAssignees: string; exemptPrAssignees: string; shouldStale: boolean; @@ -58,318 +57,318 @@ describe('assignees options', (): void => { }); describe.each` - id | isPullRequest | assignees | exemptAllIssueAssignees | exemptAllPrAssignees | exemptAssignees | exemptIssueAssignees | exemptPrAssignees | shouldStale | description - ${100} | ${false} | ${[]} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee'} - ${101} | ${false} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and only exemptAllAssignees is enabled'} - ${102} | ${false} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and only exemptAllIssueAssignees is enabled'} - ${103} | ${false} | ${[]} | ${false} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and only exemptAllPrAssignees is enabled'} - ${104} | ${false} | ${[]} | ${false} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'} - ${105} | ${false} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'} - ${106} | ${false} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'} - ${107} | ${false} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'} - ${108} | ${false} | ${[]} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'} - ${109} | ${false} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'} - ${200} | ${false} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} - ${201} | ${false} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'} - ${202} | ${false} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and only exemptAllAssignees is enabled'} - ${203} | ${false} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and only exemptAllIssueAssignees is enabled'} - ${204} | ${false} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and only exemptAllPrAssignees is enabled'} - ${205} | ${false} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'} - ${206} | ${false} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'} - ${207} | ${false} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'} - ${208} | ${false} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'} - ${209} | ${false} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'} - ${210} | ${false} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'} - ${211} | ${false} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} - ${212} | ${false} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'} - ${213} | ${false} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} - ${300} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} - ${301} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} - ${302} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAssignees has a different assignee'} - ${303} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} - ${304} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} - ${305} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees has a different assignee'} - ${306} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} - ${307} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} - ${308} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} - ${309} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees has a different assignee'} - ${310} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} - ${311} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} - ${312} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} - ${313} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} - ${400} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} - ${401} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} - ${402} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAssignees has the same assignee'} - ${403} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} - ${404} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} - ${405} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees has the same assignee'} - ${406} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} - ${407} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} - ${408} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} - ${409} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees has the same assignee'} - ${410} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} - ${411} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} - ${412} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} - ${413} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} - ${500} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${501} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${502} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${503} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${504} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${505} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${506} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${507} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${508} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${509} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${510} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${511} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${512} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${513} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${600} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${601} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${602} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${603} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${604} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${605} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${606} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${607} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${608} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${609} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${610} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${611} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${612} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${613} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${700} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${701} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${702} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${703} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${704} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${705} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${706} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${707} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${708} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${709} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${710} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${711} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${712} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${713} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${800} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${801} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${802} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${803} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${804} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${805} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${806} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${807} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${808} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${809} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${810} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${811} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${812} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${813} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${900} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${901} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${902} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${903} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${904} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${905} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${906} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${907} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${908} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${909} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${910} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${911} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${912} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${913} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${1000} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1001} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1002} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1003} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1004} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1005} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1006} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1007} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1008} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1009} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1010} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1011} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1012} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1013} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${1100} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1101} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1102} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1103} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1104} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1105} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1106} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1107} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1108} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1109} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1110} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1111} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1112} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1113} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${1200} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1201} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1202} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1203} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1204} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1205} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1206} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1207} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1208} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1209} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1210} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1211} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1212} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1213} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${1300} | ${true} | ${[]} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee'} - ${1301} | ${true} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and only exemptAllAssignees is enabled'} - ${1302} | ${true} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and only exemptAllIssueAssignees is enabled'} - ${1303} | ${true} | ${[]} | ${false} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and only exemptAllPrAssignees is enabled'} - ${1304} | ${true} | ${[]} | ${false} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'} - ${1305} | ${true} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'} - ${1306} | ${true} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'} - ${1307} | ${true} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'} - ${1308} | ${true} | ${[]} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'} - ${1309} | ${true} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'} - ${1400} | ${true} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} - ${1401} | ${true} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'} - ${1402} | ${true} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and only exemptAllAssignees is enabled'} - ${1403} | ${true} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and only exemptAllIssueAssignees is enabled'} - ${1404} | ${true} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and only exemptAllPrAssignees is enabled'} - ${1405} | ${true} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'} - ${1406} | ${true} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'} - ${1407} | ${true} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'} - ${1408} | ${true} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'} - ${1409} | ${true} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'} - ${1410} | ${true} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'} - ${1411} | ${true} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} - ${1412} | ${true} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'} - ${1413} | ${true} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} - ${1500} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} - ${1501} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} - ${1502} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAssignees has a different assignee'} - ${1503} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} - ${1504} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} - ${1505} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees has a different assignee'} - ${1506} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} - ${1507} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} - ${1508} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'} - ${1509} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees has a different assignee'} - ${1510} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'} - ${1511} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} - ${1513} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'} - ${1600} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} - ${1601} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} - ${1602} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAssignees has the same assignee'} - ${1603} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} - ${1604} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} - ${1605} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees has the same assignee'} - ${1606} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} - ${1607} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} - ${1608} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} - ${1609} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees has the same assignee'} - ${1610} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'} - ${1611} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} - ${1612} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'} - ${1613} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'} - ${1701} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1702} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1703} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1704} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1705} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1706} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1707} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1708} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1709} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1710} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1711} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'} - ${1800} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1801} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1802} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1803} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1804} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1805} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1806} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1807} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1808} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1809} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1810} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'} - ${1900} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1901} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1902} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1903} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1904} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1905} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1906} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1907} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1908} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1909} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1910} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${1911} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'} - ${2000} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2001} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2002} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2003} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2004} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2005} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2006} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2007} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2008} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2009} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2010} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'} - ${2100} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2101} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2102} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2103} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2104} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2105} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2106} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2107} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2108} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2109} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2110} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'} - ${2200} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2201} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2202} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2203} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2204} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2205} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2206} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2207} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2208} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2209} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2210} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2311} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2312} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2313} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'} - ${2300} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2301} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2302} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2303} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2304} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2305} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2306} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2307} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2308} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2309} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2310} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2311} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'} - ${2400} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2401} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2402} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2403} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2404} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2405} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2406} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2407} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2408} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2409} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2410} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2411} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2412} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} - ${2413} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'} + id | isPullRequest | assignees | exemptAllIssueAssignees | exemptAllPrAssignees | exemptIssueAssignees | exemptPrAssignees | shouldStale | description + ${100} | ${false} | ${[]} | ${false} | ${false} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee'} + ${101} | ${false} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and only exemptAllAssignees is enabled'} + ${102} | ${false} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and only exemptAllIssueAssignees is enabled'} + ${103} | ${false} | ${[]} | ${false} | ${true} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and only exemptAllPrAssignees is enabled'} + ${104} | ${false} | ${[]} | ${false} | ${true} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'} + ${105} | ${false} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'} + ${106} | ${false} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'} + ${107} | ${false} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'} + ${108} | ${false} | ${[]} | ${false} | ${false} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'} + ${109} | ${false} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'} + ${200} | ${false} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} + ${201} | ${false} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'} + ${202} | ${false} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and only exemptAllAssignees is enabled'} + ${203} | ${false} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and only exemptAllIssueAssignees is enabled'} + ${204} | ${false} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and only exemptAllPrAssignees is enabled'} + ${205} | ${false} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'} + ${206} | ${false} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'} + ${207} | ${false} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'} + ${208} | ${false} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'} + ${209} | ${false} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'} + ${210} | ${false} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'} + ${211} | ${false} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} + ${212} | ${false} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'} + ${213} | ${false} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} + ${300} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${301} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${302} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled'} + ${303} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled'} + ${304} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled'} + ${305} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled'} + ${306} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled'} + ${307} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled'} + ${308} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled'} + ${309} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled'} + ${310} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled'} + ${311} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${312} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${313} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${400} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${401} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${402} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled'} + ${403} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled'} + ${404} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled'} + ${405} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled'} + ${406} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled'} + ${407} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled'} + ${408} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled'} + ${409} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled'} + ${410} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled'} + ${411} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${412} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${413} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${500} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptIssueAssignees has a different assignee'} + ${501} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptIssueAssignees has a different assignee'} + ${502} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptIssueAssignees has a different assignee'} + ${503} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptIssueAssignees has a different assignee'} + ${504} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptIssueAssignees has a different assignee'} + ${505} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptIssueAssignees has a different assignee'} + ${506} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptIssueAssignees has a different assignee'} + ${507} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptIssueAssignees has a different assignee'} + ${508} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptIssueAssignees has a different assignee'} + ${509} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptIssueAssignees has a different assignee'} + ${510} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptIssueAssignees has a different assignee'} + ${511} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptIssueAssignees has a different assignee'} + ${512} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptIssueAssignees has a different assignee'} + ${513} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptIssueAssignees has a different assignee'} + ${600} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptIssueAssignees has the same assignee'} + ${601} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptIssueAssignees has the same assignee'} + ${602} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptIssueAssignees has the same assignee'} + ${603} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptIssueAssignees has the same assignee'} + ${604} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptIssueAssignees has the same assignee'} + ${605} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptIssueAssignees has the same assignee'} + ${606} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptIssueAssignees has the same assignee'} + ${607} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptIssueAssignees has the same assignee'} + ${608} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptIssueAssignees has the same assignee'} + ${609} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptIssueAssignees has the same assignee'} + ${610} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptIssueAssignees has the same assignee'} + ${611} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptIssueAssignees has the same assignee'} + ${612} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptIssueAssignees has the same assignee'} + ${613} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptIssueAssignees has the same assignee'} + ${700} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptPrAssignees has a different assignee'} + ${701} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptPrAssignees has a different assignee'} + ${702} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptPrAssignees has a different assignee'} + ${703} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptPrAssignees has a different assignee'} + ${704} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptPrAssignees has a different assignee'} + ${705} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptPrAssignees has a different assignee'} + ${706} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptPrAssignees has a different assignee'} + ${707} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptPrAssignees has a different assignee'} + ${708} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptPrAssignees has a different assignee'} + ${709} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptPrAssignees has a different assignee'} + ${710} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptPrAssignees has a different assignee'} + ${711} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptPrAssignees has a different assignee'} + ${712} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptPrAssignees has a different assignee'} + ${713} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptPrAssignees has a different assignee'} + ${800} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${801} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${802} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled'} + ${803} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled'} + ${804} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled'} + ${805} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled'} + ${806} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled'} + ${807} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled'} + ${808} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled'} + ${809} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled'} + ${810} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled'} + ${811} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${812} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${813} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${900} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${901} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${902} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled'} + ${903} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled'} + ${904} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled'} + ${905} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled'} + ${906} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled'} + ${907} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled'} + ${908} | ${false} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled'} + ${909} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled'} + ${910} | ${false} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled'} + ${911} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${912} | ${false} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${913} | ${false} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${1000} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${1001} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${1002} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled'} + ${1003} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled'} + ${1004} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled'} + ${1005} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled'} + ${1006} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled'} + ${1007} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled'} + ${1008} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled'} + ${1009} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled'} + ${1010} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled'} + ${1011} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${1012} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${1013} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${1100} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${1101} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${1102} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled'} + ${1103} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled'} + ${1104} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled'} + ${1105} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled'} + ${1106} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled'} + ${1107} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled'} + ${1108} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled'} + ${1109} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled'} + ${1110} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled'} + ${1111} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${1112} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${1113} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${1200} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptPrAssignees has the same assignee'} + ${1201} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptPrAssignees has the same assignee'} + ${1202} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptPrAssignees has the same assignee'} + ${1203} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptPrAssignees has the same assignee'} + ${1204} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptPrAssignees has the same assignee'} + ${1205} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptPrAssignees has the same assignee'} + ${1206} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptPrAssignees has the same assignee'} + ${1207} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptPrAssignees has the same assignee'} + ${1208} | ${false} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptPrAssignees has the same assignee'} + ${1209} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptPrAssignees has the same assignee'} + ${1210} | ${false} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptPrAssignees has the same assignee'} + ${1211} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptPrAssignees has the same assignee'} + ${1212} | ${false} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptPrAssignees has the same assignee'} + ${1213} | ${false} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptPrAssignees has the same assignee'} + ${1300} | ${true} | ${[]} | ${false} | ${false} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee'} + ${1301} | ${true} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and only exemptAllAssignees is enabled'} + ${1302} | ${true} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and only exemptAllIssueAssignees is enabled'} + ${1303} | ${true} | ${[]} | ${false} | ${true} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and only exemptAllPrAssignees is enabled'} + ${1304} | ${true} | ${[]} | ${false} | ${true} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'} + ${1305} | ${true} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'} + ${1306} | ${true} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'} + ${1307} | ${true} | ${[]} | ${true} | ${true} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'} + ${1308} | ${true} | ${[]} | ${false} | ${false} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'} + ${1309} | ${true} | ${[]} | ${true} | ${false} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'} + ${1400} | ${true} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} + ${1401} | ${true} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'} + ${1402} | ${true} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and only exemptAllAssignees is enabled'} + ${1403} | ${true} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and only exemptAllIssueAssignees is enabled'} + ${1404} | ${true} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and only exemptAllPrAssignees is enabled'} + ${1405} | ${true} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'} + ${1406} | ${true} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'} + ${1407} | ${true} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'} + ${1408} | ${true} | ${['assignee']} | ${true} | ${true} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'} + ${1409} | ${true} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'} + ${1410} | ${true} | ${['assignee']} | ${true} | ${false} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'} + ${1411} | ${true} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} + ${1412} | ${true} | ${['assignee']} | ${false} | ${true} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'} + ${1413} | ${true} | ${['assignee']} | ${false} | ${false} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'} + ${1500} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${1501} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${1502} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled'} + ${1503} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled'} + ${1504} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled'} + ${1505} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled'} + ${1506} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled'} + ${1507} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled'} + ${1508} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled'} + ${1509} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled'} + ${1510} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled'} + ${1511} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${1513} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${1600} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${1601} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${1602} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled'} + ${1603} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled'} + ${1604} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled'} + ${1605} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled'} + ${1606} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled'} + ${1607} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled'} + ${1608} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled'} + ${1609} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled'} + ${1610} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled'} + ${1611} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${1612} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${1613} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${1701} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptIssueAssignees has a different assignee'} + ${1702} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptIssueAssignees has a different assignee'} + ${1703} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptIssueAssignees has a different assignee'} + ${1704} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptIssueAssignees has a different assignee'} + ${1705} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptIssueAssignees has a different assignee'} + ${1706} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptIssueAssignees has a different assignee'} + ${1707} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptIssueAssignees has a different assignee'} + ${1708} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptIssueAssignees has a different assignee'} + ${1709} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptIssueAssignees has a different assignee'} + ${1710} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptIssueAssignees has a different assignee'} + ${1711} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptIssueAssignees has a different assignee'} + ${1800} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptIssueAssignees has the same assignee'} + ${1801} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptIssueAssignees has the same assignee'} + ${1802} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptIssueAssignees has the same assignee'} + ${1803} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptIssueAssignees has the same assignee'} + ${1804} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptIssueAssignees has the same assignee'} + ${1805} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptIssueAssignees has the same assignee'} + ${1806} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptIssueAssignees has the same assignee'} + ${1807} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptIssueAssignees has the same assignee'} + ${1808} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptIssueAssignees has the same assignee'} + ${1809} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptIssueAssignees has the same assignee'} + ${1810} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptIssueAssignees has the same assignee'} + ${1900} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptPrAssignees has a different assignee'} + ${1901} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptPrAssignees has a different assignee'} + ${1902} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptPrAssignees has a different assignee'} + ${1903} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptPrAssignees has a different assignee'} + ${1904} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptPrAssignees has a different assignee'} + ${1905} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptPrAssignees has a different assignee'} + ${1906} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptPrAssignees has a different assignee'} + ${1907} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptPrAssignees has a different assignee'} + ${1908} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptPrAssignees has a different assignee'} + ${1909} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptPrAssignees has a different assignee'} + ${1910} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptPrAssignees has a different assignee'} + ${1911} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptPrAssignees has a different assignee'} + ${2000} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled'} + ${2001} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled'} + ${2002} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled'} + ${2003} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled'} + ${2004} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled'} + ${2005} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled'} + ${2006} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled'} + ${2007} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled'} + ${2008} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled'} + ${2009} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${2010} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${2100} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${2101} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled'} + ${2102} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled'} + ${2103} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled'} + ${2104} | ${true} | ${['assignee']} | ${false} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled'} + ${2105} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled'} + ${2106} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled'} + ${2107} | ${true} | ${['assignee']} | ${true} | ${true} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled'} + ${2108} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled'} + ${2109} | ${true} | ${['assignee']} | ${true} | ${false} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled'} + ${2110} | ${true} | ${['assignee']} | ${false} | ${false} | ${'bad'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${2200} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${2201} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${2202} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled'} + ${2203} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled'} + ${2204} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled'} + ${2205} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled'} + ${2206} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled'} + ${2207} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled'} + ${2208} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled'} + ${2209} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled'} + ${2210} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled'} + ${2311} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${2312} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${2313} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${2300} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled'} + ${2301} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${2302} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled'} + ${2303} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled'} + ${2304} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled'} + ${2305} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled'} + ${2306} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled'} + ${2307} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled'} + ${2308} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled'} + ${2309} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled'} + ${2310} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled'} + ${2311} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled'} + ${2400} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptPrAssignees has the same assignee'} + ${2401} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptPrAssignees has the same assignee'} + ${2402} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptPrAssignees has the same assignee'} + ${2403} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptPrAssignees has the same assignee'} + ${2404} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptPrAssignees has the same assignee'} + ${2405} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptPrAssignees has the same assignee'} + ${2406} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptPrAssignees has the same assignee'} + ${2407} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptPrAssignees has the same assignee'} + ${2408} | ${true} | ${['assignee']} | ${true} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptPrAssignees has the same assignee'} + ${2409} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptPrAssignees has the same assignee'} + ${2410} | ${true} | ${['assignee']} | ${true} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptPrAssignees has the same assignee'} + ${2411} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptPrAssignees has the same assignee'} + ${2412} | ${true} | ${['assignee']} | ${false} | ${true} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptPrAssignees has the same assignee'} + ${2413} | ${true} | ${['assignee']} | ${false} | ${false} | ${'assignee'} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptPrAssignees has the same assignee'} `( '$description', ({ @@ -378,7 +377,6 @@ describe('assignees options', (): void => { assignees, exemptAllIssueAssignees, exemptAllPrAssignees, - exemptAssignees, exemptIssueAssignees, exemptPrAssignees, shouldStale @@ -386,7 +384,6 @@ describe('assignees options', (): void => { beforeEach((): void => { opts.exemptAllIssueAssignees = exemptAllIssueAssignees; opts.exemptAllPrAssignees = exemptAllPrAssignees; - opts.exemptAssignees = exemptAssignees; opts.exemptIssueAssignees = exemptIssueAssignees; opts.exemptPrAssignees = exemptPrAssignees; setTestIssueList(isPullRequest, assignees, id); diff --git a/action.yml b/action.yml index 14bdfb9fe..d431807db 100644 --- a/action.yml +++ b/action.yml @@ -140,16 +140,12 @@ inputs: description: 'The date used to skip the stale action on issue/pull request created before it (ISO 8601 or RFC 2822).' default: '' required: false - exempt-assignees: - description: 'The assignees which exempt an issue or a pull request from being marked as stale. Separate multiple assignees with commas (eg. "user1,user2").' - default: '' - required: false exempt-issue-assignees: - description: 'The assignees which exempt an issue from being marked as stale. Separate multiple assignees with commas (eg. "user1,user2"). Override "exempt-assignees" option regarding only the issues.' + description: 'The assignees which exempt an issue from being marked as stale. Separate multiple assignees with commas (eg. "user1,user2").' default: '' required: false exempt-pr-assignees: - description: 'The assignees which exempt a pull request from being marked as stale. Separate multiple assignees with commas (eg. "user1,user2"). Override "exempt-assignees" option regarding only the pull requests.' + description: 'The assignees which exempt a pull request from being marked as stale. Separate multiple assignees with commas (eg. "user1,user2").' default: '' required: false exempt-all-issue-assignees: diff --git a/dist/index.js b/dist/index.js index 046c120c7..909d77e7d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -60,13 +60,7 @@ class Assignees { _getExemptIssueAssignees() { if (this._options.exemptIssueAssignees === '') { this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptIssueAssignees)} is disabled. No specific assignee can skip the stale process for this $$type`); - if (this._options.exemptAssignees === '') { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAssignees)} is disabled. No specific assignee can skip the stale process for this $$type`); - return []; - } - const exemptAssignees = words_to_list_1.wordsToList(this._options.exemptAssignees); - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAssignees)} is set. ${logger_service_1.LoggerService.cyan(exemptAssignees.length)} assignee${exemptAssignees.length === 1 ? '' : 's'} can skip the stale process for this $$type`); - return exemptAssignees; + return []; } const exemptAssignees = words_to_list_1.wordsToList(this._options.exemptIssueAssignees); this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptIssueAssignees)} is set. ${logger_service_1.LoggerService.cyan(exemptAssignees.length)} assignee${exemptAssignees.length === 1 ? '' : 's'} can skip the stale process for this $$type`); @@ -75,13 +69,7 @@ class Assignees { _getExemptPullRequestAssignees() { if (this._options.exemptPrAssignees === '') { this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptPrAssignees)} is disabled. No specific assignee can skip the stale process for this $$type`); - if (this._options.exemptAssignees === '') { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAssignees)} is disabled. No specific assignee can skip the stale process for this $$type`); - return []; - } - const exemptAssignees = words_to_list_1.wordsToList(this._options.exemptAssignees); - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAssignees)} is set. ${logger_service_1.LoggerService.cyan(exemptAssignees.length)} assignee${exemptAssignees.length === 1 ? '' : 's'} can skip the stale process for this $$type`); - return exemptAssignees; + return []; } const exemptAssignees = words_to_list_1.wordsToList(this._options.exemptPrAssignees); this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptPrAssignees)} is set. ${logger_service_1.LoggerService.cyan(exemptAssignees.length)} assignee${exemptAssignees.length === 1 ? '' : 's'} can skip the stale process for this $$type`); @@ -1829,7 +1817,6 @@ var Option; Option["ExemptAllMilestones"] = "exempt-all-milestones"; Option["ExemptAllIssueMilestones"] = "exempt-all-issue-milestones"; Option["ExemptAllPrMilestones"] = "exempt-all-pr-milestones"; - Option["ExemptAssignees"] = "exempt-assignees"; Option["ExemptIssueAssignees"] = "exempt-issue-assignees"; Option["ExemptPrAssignees"] = "exempt-pr-assignees"; Option["ExemptAllIssueAssignees"] = "exempt-all-issue-assignees"; @@ -2138,7 +2125,6 @@ function _getAndValidateArgs() { exemptAllMilestones: core.getInput('exempt-all-milestones') === 'true', exemptAllIssueMilestones: _toOptionalBoolean('exempt-all-issue-milestones'), exemptAllPrMilestones: _toOptionalBoolean('exempt-all-pr-milestones'), - exemptAssignees: core.getInput('exempt-assignees'), exemptIssueAssignees: core.getInput('exempt-issue-assignees'), exemptPrAssignees: core.getInput('exempt-pr-assignees'), exemptAllIssueAssignees: core.getInput('exempt-all-issue-assignees') === 'true', diff --git a/src/classes/assignees.spec.ts b/src/classes/assignees.spec.ts index 0a5feb390..b5b794b45 100644 --- a/src/classes/assignees.spec.ts +++ b/src/classes/assignees.spec.ts @@ -26,293 +26,279 @@ describe('Assignees', (): void => { issueInterface.pull_request = undefined; }); - describe('when the given options are not configured to exempt an assignee', (): void => { + describe('when the given options are not configured to exempt an issue with an assignee', (): void => { beforeEach((): void => { - optionsInterface.exemptAssignees = ''; + optionsInterface.exemptIssueAssignees = ''; }); - describe('when the given options are not configured to exempt an issue with an assignee', (): void => { + describe('when the given issue does not have an assignee', (): void => { beforeEach((): void => { - optionsInterface.exemptIssueAssignees = ''; + issueInterface.assignees = []; }); - describe('when the given issue does not have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = []; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given issue does have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-login', - type: 'User' - } - ]; - }); + describe('when the given issue does have an assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-login', + type: 'User' + } + ]; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); }); + }); + + describe('when the given options are configured to exempt an issue with an assignee', (): void => { + beforeEach((): void => { + optionsInterface.exemptIssueAssignees = 'dummy-exempt-issue-assignee'; + }); - describe('when the given options are configured to exempt an issue with an assignee', (): void => { + describe('when the given issue does not have an assignee', (): void => { beforeEach((): void => { - optionsInterface.exemptIssueAssignees = - 'dummy-exempt-issue-assignee'; + issueInterface.assignees = []; }); - describe('when the given issue does not have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = []; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given issue does have an assignee different than the exempt issue assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-login', - type: 'User' - } - ]; - }); + describe('when the given issue does have an assignee different than the exempt issue assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-login', + type: 'User' + } + ]; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given issue does have an assignee equaling the exempt issue assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-exempt-issue-assignee', - type: 'User' - } - ]; - }); + describe('when the given issue does have an assignee equaling the exempt issue assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-exempt-issue-assignee', + type: 'User' + } + ]; + }); - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return true', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(true); - }); + expect(result).toStrictEqual(true); }); }); }); - describe('when the given options are configured to exempt an assignee', (): void => { + describe('when the given options are not configured to exempt an issue with an assignee', (): void => { beforeEach((): void => { - optionsInterface.exemptAssignees = 'dummy-exempt-assignee'; + optionsInterface.exemptIssueAssignees = ''; }); - describe('when the given options are not configured to exempt an issue with an assignee', (): void => { + describe('when the given issue does not have an assignee', (): void => { beforeEach((): void => { - optionsInterface.exemptIssueAssignees = ''; + issueInterface.assignees = []; }); - describe('when the given issue does not have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = []; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given issue does have an assignee different than the exempt assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-login', - type: 'User' - } - ]; - }); + describe('when the given issue does have an assignee different than the exempt assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-login', + type: 'User' + } + ]; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given issue does have an assignee equaling the exempt assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-exempt-assignee', - type: 'User' - } - ]; - }); + describe('when the given issue does have an assignee equaling the exempt assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-exempt-assignee', + type: 'User' + } + ]; + }); - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(true); - }); + expect(result).toStrictEqual(false); }); }); + }); - describe('when the given options are configured to exempt an issue with an assignee', (): void => { + describe('when the given options are configured to exempt an issue with an assignee', (): void => { + beforeEach((): void => { + optionsInterface.exemptIssueAssignees = 'dummy-exempt-issue-assignee'; + }); + + describe('when the given issue does not have an assignee', (): void => { beforeEach((): void => { - optionsInterface.exemptIssueAssignees = - 'dummy-exempt-issue-assignee'; + issueInterface.assignees = []; }); - describe('when the given issue does not have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = []; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given issue does have an assignee different than the exempt issue assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-login', - type: 'User' - } - ]; - }); + describe('when the given issue does have an assignee different than the exempt issue assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-login', + type: 'User' + } + ]; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given issue does have an assignee equaling the exempt issue assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-exempt-issue-assignee', - type: 'User' - } - ]; - }); + describe('when the given issue does have an assignee equaling the exempt issue assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-exempt-issue-assignee', + type: 'User' + } + ]; + }); - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return true', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(true); - }); + expect(result).toStrictEqual(true); }); + }); - describe('when the given issue does have an assignee different than the exempt assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-login', - type: 'User' - } - ]; - }); + describe('when the given issue does have an assignee different than the exempt assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-login', + type: 'User' + } + ]; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given issue does have an assignee equaling the exempt assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-exempt-assignee', - type: 'User' - } - ]; - }); + describe('when the given issue does have an assignee equaling the exempt assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-exempt-assignee', + type: 'User' + } + ]; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); }); }); @@ -409,291 +395,279 @@ describe('Assignees', (): void => { issueInterface.pull_request = {}; }); - describe('when the given options are not configured to exempt an assignee', (): void => { + describe('when the given options are not configured to exempt a pull request with an assignee', (): void => { beforeEach((): void => { - optionsInterface.exemptAssignees = ''; + optionsInterface.exemptPrAssignees = ''; }); - describe('when the given options are not configured to exempt a pull request with an assignee', (): void => { + describe('when the given pull request does not have an assignee', (): void => { beforeEach((): void => { - optionsInterface.exemptPrAssignees = ''; + issueInterface.assignees = []; }); - describe('when the given pull request does not have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = []; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given pull request does have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-login', - type: 'User' - } - ]; - }); + describe('when the given pull request does have an assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-login', + type: 'User' + } + ]; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); }); + }); - describe('when the given options are configured to exempt a pull request with an assignee', (): void => { + describe('when the given options are configured to exempt a pull request with an assignee', (): void => { + beforeEach((): void => { + optionsInterface.exemptPrAssignees = 'dummy-exempt-pr-assignee'; + }); + + describe('when the given pull request does not have an assignee', (): void => { beforeEach((): void => { - optionsInterface.exemptPrAssignees = 'dummy-exempt-pr-assignee'; + issueInterface.assignees = []; }); - describe('when the given pull request does not have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = []; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given pull request does have an assignee different than the exempt pull request assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-login', - type: 'User' - } - ]; - }); + describe('when the given pull request does have an assignee different than the exempt pull request assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-login', + type: 'User' + } + ]; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given pull request does have an assignee equaling the exempt pull request assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-exempt-pr-assignee', - type: 'User' - } - ]; - }); + describe('when the given pull request does have an assignee equaling the exempt pull request assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-exempt-pr-assignee', + type: 'User' + } + ]; + }); - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return true', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(true); - }); + expect(result).toStrictEqual(true); }); }); }); - describe('when the given options are configured to exempt an assignee', (): void => { + describe('when the given options are not configured to exempt a pull request with an assignee', (): void => { beforeEach((): void => { - optionsInterface.exemptAssignees = 'dummy-exempt-assignee'; + optionsInterface.exemptPrAssignees = ''; }); - describe('when the given options are not configured to exempt a pull request with an assignee', (): void => { + describe('when the given pull request does not have an assignee', (): void => { beforeEach((): void => { - optionsInterface.exemptPrAssignees = ''; + issueInterface.assignees = []; }); - describe('when the given pull request does not have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = []; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given pull request does have an assignee different than the exempt assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-login', - type: 'User' - } - ]; - }); + describe('when the given pull request does have an assignee different than the exempt assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-login', + type: 'User' + } + ]; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given pull request does have an assignee equaling the exempt assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-exempt-assignee', - type: 'User' - } - ]; - }); + describe('when the given pull request does have an assignee equaling the exempt assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-exempt-assignee', + type: 'User' + } + ]; + }); - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(true); - }); + expect(result).toStrictEqual(false); }); }); + }); - describe('when the given options are configured to exempt a pull request with an assignee', (): void => { + describe('when the given options are configured to exempt a pull request with an assignee', (): void => { + beforeEach((): void => { + optionsInterface.exemptPrAssignees = 'dummy-exempt-pr-assignee'; + }); + + describe('when the given pull request does not have an assignee', (): void => { beforeEach((): void => { - optionsInterface.exemptPrAssignees = 'dummy-exempt-pr-assignee'; + issueInterface.assignees = []; }); - describe('when the given pull request does not have an assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = []; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given pull request does have an assignee different than the exempt pull request assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-login', - type: 'User' - } - ]; - }); + describe('when the given pull request does have an assignee different than the exempt pull request assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-login', + type: 'User' + } + ]; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given pull request does have an assignee equaling the exempt pull request assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-exempt-pr-assignee', - type: 'User' - } - ]; - }); + describe('when the given pull request does have an assignee equaling the exempt pull request assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-exempt-pr-assignee', + type: 'User' + } + ]; + }); - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return true', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(true); - }); + expect(result).toStrictEqual(true); }); + }); - describe('when the given pull request does have an assignee different than the exempt assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-login', - type: 'User' - } - ]; - }); + describe('when the given pull request does have an assignee different than the exempt assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-login', + type: 'User' + } + ]; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given pull request does have an assignee equaling the exempt assignee', (): void => { - beforeEach((): void => { - issueInterface.assignees = [ - { - login: 'dummy-exempt-assignee', - type: 'User' - } - ]; - }); + describe('when the given pull request does have an assignee equaling the exempt assignee', (): void => { + beforeEach((): void => { + issueInterface.assignees = [ + { + login: 'dummy-exempt-assignee', + type: 'User' + } + ]; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - assignees = new Assignees(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + assignees = new Assignees(optionsInterface, issue); - const result = assignees.shouldExemptAssignees(); + const result = assignees.shouldExemptAssignees(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); }); }); diff --git a/src/classes/assignees.ts b/src/classes/assignees.ts index a1bca1734..710148321 100644 --- a/src/classes/assignees.ts +++ b/src/classes/assignees.ts @@ -96,31 +96,7 @@ export class Assignees { )} is disabled. No specific assignee can skip the stale process for this $$type` ); - if (this._options.exemptAssignees === '') { - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAssignees - )} is disabled. No specific assignee can skip the stale process for this $$type` - ); - - return []; - } - - const exemptAssignees: string[] = wordsToList( - this._options.exemptAssignees - ); - - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAssignees - )} is set. ${LoggerService.cyan(exemptAssignees.length)} assignee${ - exemptAssignees.length === 1 ? '' : 's' - } can skip the stale process for this $$type` - ); - - return exemptAssignees; + return []; } const exemptAssignees: string[] = wordsToList( @@ -148,31 +124,7 @@ export class Assignees { )} is disabled. No specific assignee can skip the stale process for this $$type` ); - if (this._options.exemptAssignees === '') { - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAssignees - )} is disabled. No specific assignee can skip the stale process for this $$type` - ); - - return []; - } - - const exemptAssignees: string[] = wordsToList( - this._options.exemptAssignees - ); - - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAssignees - )} is set. ${LoggerService.cyan(exemptAssignees.length)} assignee${ - exemptAssignees.length === 1 ? '' : 's' - } can skip the stale process for this $$type` - ); - - return exemptAssignees; + return []; } const exemptAssignees: string[] = wordsToList( diff --git a/src/classes/issue.spec.ts b/src/classes/issue.spec.ts index a17f100c6..0dbe1b4cf 100644 --- a/src/classes/issue.spec.ts +++ b/src/classes/issue.spec.ts @@ -49,7 +49,6 @@ describe('Issue', (): void => { exemptAllMilestones: false, exemptAllIssueMilestones: undefined, exemptAllPrMilestones: undefined, - exemptAssignees: '', exemptIssueAssignees: '', exemptPrAssignees: '', exemptAllIssueAssignees: false, diff --git a/src/enums/option.ts b/src/enums/option.ts index 916cd84ed..a69e19c68 100644 --- a/src/enums/option.ts +++ b/src/enums/option.ts @@ -34,7 +34,6 @@ export enum Option { ExemptAllMilestones = 'exempt-all-milestones', ExemptAllIssueMilestones = 'exempt-all-issue-milestones', ExemptAllPrMilestones = 'exempt-all-pr-milestones', - ExemptAssignees = 'exempt-assignees', ExemptIssueAssignees = 'exempt-issue-assignees', ExemptPrAssignees = 'exempt-pr-assignees', ExemptAllIssueAssignees = 'exempt-all-issue-assignees', diff --git a/src/interfaces/issues-processor-options.ts b/src/interfaces/issues-processor-options.ts index 9de4c6b5d..9817cb691 100644 --- a/src/interfaces/issues-processor-options.ts +++ b/src/interfaces/issues-processor-options.ts @@ -38,7 +38,6 @@ export interface IIssuesProcessorOptions { exemptAllMilestones: boolean; exemptAllIssueMilestones: boolean | undefined; exemptAllPrMilestones: boolean | undefined; - exemptAssignees: string; exemptIssueAssignees: string; exemptPrAssignees: string; exemptAllIssueAssignees: boolean; diff --git a/src/main.ts b/src/main.ts index eedbf8edd..d9d298796 100644 --- a/src/main.ts +++ b/src/main.ts @@ -75,7 +75,6 @@ function _getAndValidateArgs(): IIssuesProcessorOptions { exemptAllMilestones: core.getInput('exempt-all-milestones') === 'true', exemptAllIssueMilestones: _toOptionalBoolean('exempt-all-issue-milestones'), exemptAllPrMilestones: _toOptionalBoolean('exempt-all-pr-milestones'), - exemptAssignees: core.getInput('exempt-assignees'), exemptIssueAssignees: core.getInput('exempt-issue-assignees'), exemptPrAssignees: core.getInput('exempt-pr-assignees'), exemptAllIssueAssignees: From 315391885d67a4497f6772284b77c43f16b12a88 Mon Sep 17 00:00:00 2001 From: TESTELIN Geoffrey Date: Fri, 8 Oct 2021 19:19:07 +0200 Subject: [PATCH 04/11] feat: remove the exempt-all-milestones option BREAKING CHANGE: The option exempt-all-milestones was removed --- README.md | 116 +- .../constants/default-processor-options.ts | 5 +- __tests__/milestones.spec.ts | 2910 ++--------------- action.yml | 12 +- dist/index.js | 34 +- src/classes/issue.spec.ts | 5 +- src/classes/milestones.spec.ts | 1520 ++++----- src/classes/milestones.ts | 570 ++-- src/enums/option.ts | 1 - src/interfaces/issues-processor-options.ts | 5 +- src/main.ts | 6 +- 11 files changed, 1395 insertions(+), 3789 deletions(-) diff --git a/README.md b/README.md index a25c234df..5e1644aef 100644 --- a/README.md +++ b/README.md @@ -28,55 +28,54 @@ You can find more information about the required permissions under the correspon Every argument is optional. -| Input | Description | Default | -| ------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------- | -| [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-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-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-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-pr-message](#stale-pr-message) | Comment on the staled PRs | | -| [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 | | -| [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 | | -| [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 | | -| [exempt-issue-labels](#exempt-issue-labels) | Labels on issues 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-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 | | -| [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-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` | -| [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-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-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` | -| [ascending](#ascending) | Order to get issues/PRs | `false` | -| [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` | -| [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-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-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-issue-assignees](#exempt-issue-assignees) | Assignees on issues exempted from stale | | -| [exempt-pr-assignees](#exempt-pr-assignees) | Assignees on PRs exempted from stale | | -| [exempt-all-issue-assignees](#exempt-all-issue-assignees) | Exempt all issues with assignees from stale | `false` | -| [exempt-all-pr-assignees](#exempt-all-pr-assignees) | Exempt all PRs with assignees from stale | `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` | -| [ignore-issue-updates](#ignore-issue-updates) | Any update (update/comment) can reset the stale idle time on the issues | `false` | -| [ignore-pr-updates](#ignore-pr-updates) | Any update (update/comment) can reset the stale idle time on the PRs | `false` | +| Input | Description | Default | +| ------------------------------------------------------------------- | ----------------------------------------------------------------------- | --------------------- | ------- | +| [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-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-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-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-pr-message](#stale-pr-message) | Comment on the staled PRs | | +| [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 | | +| [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 | | +| [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 | | +| [exempt-issue-labels](#exempt-issue-labels) | Labels on issues 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-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 | | +| [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-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` | +| [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-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-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` | +| [ascending](#ascending) | Order to get issues/PRs | `false` | +| [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` | +| [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-pr-milestones](#exempt-pr-milestones) | Override [exempt-milestones](#exempt-milestones) for PRs only | | +| [exempt-all-issue-milestones](#exempt-all-issue-milestones) | Exempt all issues with milestones from stale | | `false` | +| [exempt-all-pr-milestones](#exempt-all-pr-milestones) | Exempt all PRs with milestones from stale | | `false` | +| [exempt-issue-assignees](#exempt-issue-assignees) | Assignees on issues exempted from stale | | +| [exempt-pr-assignees](#exempt-pr-assignees) | Assignees on PRs exempted from stale | | +| [exempt-all-issue-assignees](#exempt-all-issue-assignees) | Exempt all issues with assignees from stale | `false` | +| [exempt-all-pr-assignees](#exempt-all-pr-assignees) | Exempt all PRs with assignees from stale | `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` | +| [ignore-issue-updates](#ignore-issue-updates) | Any update (update/comment) can reset the stale idle time on the issues | `false` | +| [ignore-pr-updates](#ignore-pr-updates) | Any update (update/comment) can reset the stale idle time on the PRs | `false` | ### List of output options @@ -122,7 +121,8 @@ You can fine tune which issues or pull requests should be marked as stale based - [any-of-labels](#any-of-labels) - [start-date](#start-date) - [exempt-milestones](#exempt-milestones) -- [exempt-all-milestones](#exempt-all-milestones) +- [exempt-all-issue-milestones](#exempt-all-issue-milestones) +- [exempt-all-pr-milestones](#exempt-all-pr-milestones) - [exempt-issue-assignees](#exempt-issue-assignees) - [exempt-pr-assignees](#exempt-pr-assignees) - [exempt-all-issue-assignees](#exempt-all-issue-assignees) @@ -412,25 +412,21 @@ Override [exempt-milestones](#exempt-milestones) but only to process the pull re Default value: unset -#### exempt-all-milestones +#### exempt-all-issue-milestones -If set to `true`, the issues or the pull requests with a milestone will not be marked as stale automatically. +If set to `true`, the issues with a milestone will not be marked as stale automatically. Priority over [exempt-milestones](#exempt-milestones). Default value: `false` -#### exempt-all-issue-milestones - -Override [exempt-all-milestones](#exempt-all-milestones) but only to exempt the issues with a milestone to be marked as stale automatically. - -Default value: unset - #### exempt-all-pr-milestones -Override [exempt-all-milestones](#exempt-all-milestones) but only to exempt the pull requests with a milestone to be marked as stale automatically. +If set to `true`, the pull requests with a milestone will not be marked as stale automatically. -Default value: unset +Priority over [exempt-milestones](#exempt-milestones). + +Default value: `false` #### exempt-issue-assignees diff --git a/__tests__/constants/default-processor-options.ts b/__tests__/constants/default-processor-options.ts index 370931923..0939ec108 100644 --- a/__tests__/constants/default-processor-options.ts +++ b/__tests__/constants/default-processor-options.ts @@ -35,9 +35,8 @@ export const DefaultProcessorOptions: IIssuesProcessorOptions = Object.freeze({ exemptMilestones: '', exemptIssueMilestones: '', exemptPrMilestones: '', - exemptAllMilestones: false, - exemptAllIssueMilestones: undefined, - exemptAllPrMilestones: undefined, + exemptAllIssueMilestones: false, + exemptAllPrMilestones: false, exemptAssignees: '', exemptIssueAssignees: '', exemptPrAssignees: '', diff --git a/__tests__/milestones.spec.ts b/__tests__/milestones.spec.ts index 3483d59da..b94a793e4 100644 --- a/__tests__/milestones.spec.ts +++ b/__tests__/milestones.spec.ts @@ -49,9 +49,9 @@ describe('milestones options', (): void => { opts = {...DefaultProcessorOptions}; }); - describe('when all the issues and pull requests milestones should not exempt', (): void => { + describe('when all the issues milestones should not exempt', (): void => { beforeEach((): void => { - opts.exemptAllMilestones = false; + opts.exemptAllIssueMilestones = false; }); describe.each` @@ -84,17 +84,19 @@ describe('milestones options', (): void => { } ); - describe('when all the issues milestones are not configured to exempt', (): void => { + describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptAllIssueMilestones = undefined; + opts.exemptMilestones = 'dummy-milestone'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone'} | ${true} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} + ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} + ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -119,19 +121,21 @@ describe('milestones options', (): void => { } ); - describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { + describe('when all the issues milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone'; + opts.exemptIssueMilestones = 'dummy-issue-milestone'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} + ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} + ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -155,1197 +159,23 @@ describe('milestones options', (): void => { }); } ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = 'dummy-issue-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = 'dummy-pull-request-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - }); - - describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { - beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = - 'dummy-issue-milestone1, dummy-issue-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = - 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - }); - }); - - describe('when all the issues milestones should not exempt', (): void => { - beforeEach((): void => { - opts.exemptAllIssueMilestones = false; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - - describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = 'dummy-issue-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = 'dummy-pull-request-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - }); - - describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { - beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = - 'dummy-issue-milestone1, dummy-issue-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = - 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - }); - }); - - describe('when all the issues milestones should exempt', (): void => { - beforeEach((): void => { - opts.exemptAllIssueMilestones = true; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - - describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = 'dummy-issue-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = 'dummy-pull-request-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - }); - - describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { - beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = - 'dummy-issue-milestone1, dummy-issue-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = - 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - }); - }); - - describe('when all the pull requests milestones are not configured to exempt', (): void => { - beforeEach((): void => { - opts.exemptAllPrMilestones = undefined; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - - describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = 'dummy-issue-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = 'dummy-pull-request-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - }); - - describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { - beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = - 'dummy-issue-milestone1, dummy-issue-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = - 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - }); - }); - - describe('when all the pull requests milestones should not exempt', (): void => { - beforeEach((): void => { - opts.exemptAllPrMilestones = false; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - - describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = 'dummy-issue-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = 'dummy-pull-request-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); }); - describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { + describe('when all the pull requests milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; + opts.exemptPrMilestones = 'dummy-pull-request-milestone'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} + ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -1369,102 +199,22 @@ describe('milestones options', (): void => { }); } ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = - 'dummy-issue-milestone1, dummy-issue-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = - 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); }); }); - describe('when all the pull requests milestones should exempt', (): void => { + describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { beforeEach((): void => { - opts.exemptAllPrMilestones = true; + opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} + ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} + ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -1489,19 +239,22 @@ describe('milestones options', (): void => { } ); - describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { + describe('when all the issues milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone'; + opts.exemptIssueMilestones = + 'dummy-issue-milestone1, dummy-issue-milestone2'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} + ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} + ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -1525,101 +278,24 @@ describe('milestones options', (): void => { }); } ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = 'dummy-issue-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = 'dummy-pull-request-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); }); - describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { + describe('when all the pull requests milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; + opts.exemptPrMilestones = + 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} + ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -1643,95 +319,13 @@ describe('milestones options', (): void => { }); } ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = - 'dummy-issue-milestone1, dummy-issue-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = - 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); }); }); }); - describe('when all the issues and pull requests milestones should exempt', (): void => { + describe('when all the issues milestones should exempt', (): void => { beforeEach((): void => { - opts.exemptAllMilestones = true; + opts.exemptAllIssueMilestones = true; }); describe.each` @@ -1739,7 +333,7 @@ describe('milestones options', (): void => { ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone'} | ${false} ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone'} | ${false} + ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone'} | ${true} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -1764,17 +358,19 @@ describe('milestones options', (): void => { } ); - describe('when all the issues milestones are not configured to exempt', (): void => { + describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptAllIssueMilestones = undefined; + opts.exemptMilestones = 'dummy-milestone'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${false} + ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} + ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -1799,19 +395,21 @@ describe('milestones options', (): void => { } ); - describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { + describe('when all the issues milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone'; + opts.exemptIssueMilestones = 'dummy-issue-milestone'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} + ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} + ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -1835,101 +433,23 @@ describe('milestones options', (): void => { }); } ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = 'dummy-issue-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = 'dummy-pull-request-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); }); - describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { + describe('when all the pull requests milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; + opts.exemptPrMilestones = 'dummy-pull-request-milestone'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} + ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} + ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} + ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -1953,102 +473,22 @@ describe('milestones options', (): void => { }); } ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = - 'dummy-issue-milestone1, dummy-issue-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = - 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); }); }); - describe('when all the issues milestones should not exempt', (): void => { + describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { beforeEach((): void => { - opts.exemptAllIssueMilestones = false; + opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${false} + ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} + ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -2073,19 +513,22 @@ describe('milestones options', (): void => { } ); - describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { + describe('when all the issues milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone'; + opts.exemptIssueMilestones = + 'dummy-issue-milestone1, dummy-issue-milestone2'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} + ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} + ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -2109,101 +552,24 @@ describe('milestones options', (): void => { }); } ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = 'dummy-issue-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = 'dummy-pull-request-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); }); - describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { + describe('when all the pull requests milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; + opts.exemptPrMilestones = + 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} + ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} + ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} + ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -2227,102 +593,58 @@ describe('milestones options', (): void => { }); } ); + }); + }); + }); - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = - 'dummy-issue-milestone1, dummy-issue-milestone2'; - }); + describe('when all the pull requests milestones should not exempt', (): void => { + beforeEach((): void => { + opts.exemptAllPrMilestones = false; + }); - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); + describe.each` + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone'} | ${true} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone'} | ${true} + `( + 'when $name', + ({isPullRequest, milestone, shouldStale}: ITestData): void => { + beforeEach((): void => { + setTestIssueList(isPullRequest, milestone); + setProcessor(); }); - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = - 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; - }); + test(`should${ + shouldStale ? '' : ' not' + } be marked as stale`, async () => { + expect.assertions(3); + + await processor.processIssues(1); - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } + expect(processor.staleIssues.length).toStrictEqual( + shouldStale ? 1 : 0 ); + expect(processor.closedIssues.length).toStrictEqual(0); + expect(processor.removedLabelIssues.length).toStrictEqual(0); }); - }); - }); + } + ); - describe('when all the issues milestones should exempt', (): void => { + describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptAllIssueMilestones = true; + opts.exemptMilestones = 'dummy-milestone'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} + ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} + ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -2347,19 +669,21 @@ describe('milestones options', (): void => { } ); - describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { + describe('when all the issues milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone'; + opts.exemptIssueMilestones = 'dummy-issue-milestone'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} + ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} + ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -2383,101 +707,23 @@ describe('milestones options', (): void => { }); } ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = 'dummy-issue-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = 'dummy-pull-request-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); }); - describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { + describe('when all the pull requests milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; + opts.exemptPrMilestones = 'dummy-pull-request-milestone'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} + ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -2501,102 +747,22 @@ describe('milestones options', (): void => { }); } ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = - 'dummy-issue-milestone1, dummy-issue-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = - 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); }); }); - describe('when all the pull requests milestones are not configured to exempt', (): void => { + describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { beforeEach((): void => { - opts.exemptAllPrMilestones = undefined; + opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} + ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} + ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -2621,19 +787,22 @@ describe('milestones options', (): void => { } ); - describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { + describe('when all the issues milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone'; + opts.exemptIssueMilestones = + 'dummy-issue-milestone1, dummy-issue-milestone2'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} + ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} + ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -2657,101 +826,24 @@ describe('milestones options', (): void => { }); } ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = 'dummy-issue-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = 'dummy-pull-request-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); }); - describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { + describe('when all the pull requests milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; + opts.exemptPrMilestones = + 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} + ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -2775,102 +867,58 @@ describe('milestones options', (): void => { }); } ); + }); + }); + }); - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = - 'dummy-issue-milestone1, dummy-issue-milestone2'; - }); + describe('when all the pull requests milestones should exempt', (): void => { + beforeEach((): void => { + opts.exemptAllPrMilestones = true; + }); - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); + describe.each` + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone'} | ${true} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone'} | ${false} + `( + 'when $name', + ({isPullRequest, milestone, shouldStale}: ITestData): void => { + beforeEach((): void => { + setTestIssueList(isPullRequest, milestone); + setProcessor(); }); - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = - 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; - }); + test(`should${ + shouldStale ? '' : ' not' + } be marked as stale`, async () => { + expect.assertions(3); + + await processor.processIssues(1); - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } + expect(processor.staleIssues.length).toStrictEqual( + shouldStale ? 1 : 0 ); + expect(processor.closedIssues.length).toStrictEqual(0); + expect(processor.removedLabelIssues.length).toStrictEqual(0); }); - }); - }); + } + ); - describe('when all the pull requests milestones should not exempt', (): void => { + describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptAllPrMilestones = false; + opts.exemptMilestones = 'dummy-milestone'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone'} | ${true} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} + ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${false} + ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -2895,19 +943,21 @@ describe('milestones options', (): void => { } ); - describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { + describe('when all the issues milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone'; + opts.exemptIssueMilestones = 'dummy-issue-milestone'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} + ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} + ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} + ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} + ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -2931,101 +981,23 @@ describe('milestones options', (): void => { }); } ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = 'dummy-issue-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = 'dummy-pull-request-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); }); - describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { + describe('when all the pull requests milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; + opts.exemptPrMilestones = 'dummy-pull-request-milestone'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} + ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} + ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -3049,102 +1021,22 @@ describe('milestones options', (): void => { }); } ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = - 'dummy-issue-milestone1, dummy-issue-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = - 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); }); }); - describe('when all the pull requests milestones should exempt', (): void => { + describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { beforeEach((): void => { - opts.exemptAllPrMilestones = true; + opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} + ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${false} + ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -3169,19 +1061,22 @@ describe('milestones options', (): void => { } ); - describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { + describe('when all the issues milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone'; + opts.exemptIssueMilestones = + 'dummy-issue-milestone1, dummy-issue-milestone2'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} + ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} + ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} + ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} + ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -3205,101 +1100,24 @@ describe('milestones options', (): void => { }); } ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = 'dummy-issue-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = 'dummy-pull-request-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); }); - describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { + describe('when all the pull requests milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; + opts.exemptPrMilestones = + 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} + ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} + ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -3323,88 +1141,6 @@ describe('milestones options', (): void => { }); } ); - - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = - 'dummy-issue-milestone1, dummy-issue-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); - - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = - 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); }); }); }); diff --git a/action.yml b/action.yml index d431807db..336357b92 100644 --- a/action.yml +++ b/action.yml @@ -72,17 +72,13 @@ inputs: description: 'The milestones that mean a pull request is exempt from being marked as stale. Separate multiple milestones with commas (eg. "milestone1,milestone2"). Override "exempt-milestones" option regarding only the pull requests.' default: '' required: false - exempt-all-milestones: - description: 'Exempt all issues and pull requests with milestones from being marked as stale. Default to false.' - default: 'false' - required: false exempt-all-issue-milestones: - description: 'Exempt all issues with milestones from being marked as stale. Override "exempt-all-milestones" option regarding only the issues.' - default: '' + description: 'Exempt all issues with milestones from being marked as stale. Default to false.' + default: 'false' required: false exempt-all-pr-milestones: - description: 'Exempt all pull requests with milestones from being marked as stale. Override "exempt-all-milestones" option regarding only the pull requests.' - default: '' + description: 'Exempt all pull requests with milestones from being marked as stale. Default to false.' + default: 'false' required: false only-labels: description: 'Only issues or pull requests with all of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels.' diff --git a/dist/index.js b/dist/index.js index 909d77e7d..6ec6a0806 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1315,36 +1315,20 @@ class Milestones { return false; } _shouldExemptAllIssueMilestones() { - if (this._options.exemptAllIssueMilestones === true) { + if (this._options.exemptAllIssueMilestones) { this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllIssueMilestones)} is enabled. Any milestone on this $$type will skip the stale process`); return true; } - else if (this._options.exemptAllIssueMilestones === false) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllIssueMilestones)} is disabled. Only some specific milestones on this $$type will skip the stale process`); - return false; - } - this._logExemptAllMilestonesOption(); - return this._options.exemptAllMilestones; + this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllIssueMilestones)} is disabled. Only some specific milestones on this $$type will skip the stale process`); + return false; } _shouldExemptAllPullRequestMilestones() { - if (this._options.exemptAllPrMilestones === true) { + if (this._options.exemptAllPrMilestones) { this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllPrMilestones)} is enabled. Any milestone on this $$type will skip the stale process`); return true; } - else if (this._options.exemptAllPrMilestones === false) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllPrMilestones)} is disabled. Only some specific milestones on this $$type will skip the stale process`); - return false; - } - this._logExemptAllMilestonesOption(); - return this._options.exemptAllMilestones; - } - _logExemptAllMilestonesOption() { - if (this._options.exemptAllMilestones) { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllMilestones)} is enabled. Any milestone on this $$type will skip the stale process`); - } - else { - this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllMilestones)} is disabled. Only some specific milestones on this $$type will skip the stale process`); - } + this._issueLogger.info(`The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptAllPrMilestones)} is disabled. Only some specific milestones on this $$type will skip the stale process`); + return false; } _logSkip() { this._issueLogger.info(logger_service_1.LoggerService.white('└──'), 'Skip the milestones checks'); @@ -1814,7 +1798,6 @@ var Option; Option["ExemptMilestones"] = "exempt-milestones"; Option["ExemptIssueMilestones"] = "exempt-issue-milestones"; Option["ExemptPrMilestones"] = "exempt-pr-milestones"; - Option["ExemptAllMilestones"] = "exempt-all-milestones"; Option["ExemptAllIssueMilestones"] = "exempt-all-issue-milestones"; Option["ExemptAllPrMilestones"] = "exempt-all-pr-milestones"; Option["ExemptIssueAssignees"] = "exempt-issue-assignees"; @@ -2122,9 +2105,8 @@ function _getAndValidateArgs() { exemptMilestones: core.getInput('exempt-milestones'), exemptIssueMilestones: core.getInput('exempt-issue-milestones'), exemptPrMilestones: core.getInput('exempt-pr-milestones'), - exemptAllMilestones: core.getInput('exempt-all-milestones') === 'true', - exemptAllIssueMilestones: _toOptionalBoolean('exempt-all-issue-milestones'), - exemptAllPrMilestones: _toOptionalBoolean('exempt-all-pr-milestones'), + exemptAllIssueMilestones: core.getInput('exempt-all-issue-milestones') === 'true', + exemptAllPrMilestones: core.getInput('exempt-all-pr-milestones') === 'true', exemptIssueAssignees: core.getInput('exempt-issue-assignees'), exemptPrAssignees: core.getInput('exempt-pr-assignees'), exemptAllIssueAssignees: core.getInput('exempt-all-issue-assignees') === 'true', diff --git a/src/classes/issue.spec.ts b/src/classes/issue.spec.ts index 0dbe1b4cf..b95a1e823 100644 --- a/src/classes/issue.spec.ts +++ b/src/classes/issue.spec.ts @@ -46,9 +46,8 @@ describe('Issue', (): void => { exemptMilestones: '', exemptIssueMilestones: '', exemptPrMilestones: '', - exemptAllMilestones: false, - exemptAllIssueMilestones: undefined, - exemptAllPrMilestones: undefined, + exemptAllIssueMilestones: false, + exemptAllPrMilestones: false, exemptIssueAssignees: '', exemptPrAssignees: '', exemptAllIssueAssignees: false, diff --git a/src/classes/milestones.spec.ts b/src/classes/milestones.spec.ts index bb87e8ffc..1f6fa58b8 100644 --- a/src/classes/milestones.spec.ts +++ b/src/classes/milestones.spec.ts @@ -1,798 +1,722 @@ -import {DefaultProcessorOptions} from '../../__tests__/constants/default-processor-options'; -import {generateIIssue} from '../../__tests__/functions/generate-iissue'; -import {IIssue} from '../interfaces/issue'; -import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options'; -import {Issue} from './issue'; -import {Milestones} from './milestones'; - -describe('Milestones', (): void => { - let milestones: Milestones; - let optionsInterface: IIssuesProcessorOptions; - let issue: Issue; - let issueInterface: IIssue; - - beforeEach((): void => { - optionsInterface = {...DefaultProcessorOptions, exemptAllMilestones: false}; - issueInterface = generateIIssue(); - }); - - describe('shouldExemptMilestones()', (): void => { - describe('when the given issue is not a pull request', (): void => { - beforeEach((): void => { - issueInterface.pull_request = undefined; - }); - - describe('when the given options are not configured to exempt a milestone', (): void => { - beforeEach((): void => { - optionsInterface.exemptMilestones = ''; - }); - - describe('when the given options are not configured to exempt an issue milestone', (): void => { - beforeEach((): void => { - optionsInterface.exemptIssueMilestones = ''; - }); - - describe('when the given issue does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given issue does have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - }); - - describe('when the given options are configured to exempt an issue milestone', (): void => { - beforeEach((): void => { - optionsInterface.exemptIssueMilestones = - 'dummy-exempt-issue-milestone'; - }); - - describe('when the given issue does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given issue does have a milestone different than the exempt issue milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given issue does have a milestone equaling the exempt issue milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-issue-milestone' - }; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(true); - }); - }); - }); - }); - - describe('when the given options are configured to exempt a milestone', (): void => { - beforeEach((): void => { - optionsInterface.exemptMilestones = 'dummy-exempt-milestone'; - }); - - describe('when the given options are not configured to exempt an issue milestone', (): void => { - beforeEach((): void => { - optionsInterface.exemptIssueMilestones = ''; - }); - - describe('when the given issue does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given issue does have a milestone different than the exempt milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given issue does have a milestone equaling the exempt milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-milestone' - }; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(true); - }); - }); - }); - - describe('when the given options are configured to exempt an issue milestone', (): void => { - beforeEach((): void => { - optionsInterface.exemptIssueMilestones = - 'dummy-exempt-issue-milestone'; - }); - - describe('when the given issue does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given issue does have a milestone different than the exempt issue milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given issue does have a milestone equaling the exempt issue milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-issue-milestone' - }; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(true); - }); - }); - - describe('when the given issue does have a milestone different than the exempt milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given issue does have a milestone equaling the exempt milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-milestone' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - }); - }); - - describe('when the given options are configured to exempt all milestones', (): void => { - beforeEach((): void => { - optionsInterface.exemptAllMilestones = true; - }); - - describe('when the given issue does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given issue does have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-issue-milestone' - }; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(true); - }); - }); - - describe('when the given options are not configured to exempt all issue milestones', (): void => { - beforeEach((): void => { - optionsInterface.exemptAllIssueMilestones = false; - }); - - describe('when the given issue does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given issue does have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-milestone' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - }); - - describe('when the given options are configured to exempt all issue milestones', (): void => { - beforeEach((): void => { - optionsInterface.exemptAllIssueMilestones = true; - }); - - describe('when the given issue does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given issue does have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-issue-milestone' - }; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(true); - }); - }); - }); - }); - }); - - describe('when the given issue is a pull request', (): void => { - beforeEach((): void => { - issueInterface.pull_request = {}; - }); - - describe('when the given options are not configured to exempt a milestone', (): void => { - beforeEach((): void => { - optionsInterface.exemptMilestones = ''; - }); - - describe('when the given options are not configured to exempt a pull request milestone', (): void => { - beforeEach((): void => { - optionsInterface.exemptPrMilestones = ''; - }); - - describe('when the given pull request does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given pull request does have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - }); - - describe('when the given options are configured to exempt a pull request milestone', (): void => { - beforeEach((): void => { - optionsInterface.exemptPrMilestones = 'dummy-exempt-pr-milestone'; - }); - - describe('when the given pull request does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given pull request does have a milestone different than the exempt pull request milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given pull request does have a milestone equaling the exempt pull request milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-pr-milestone' - }; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(true); - }); - }); - }); - }); - - describe('when the given options are configured to exempt a milestone', (): void => { - beforeEach((): void => { - optionsInterface.exemptMilestones = 'dummy-exempt-milestone'; - }); - - describe('when the given options are not configured to exempt a pull request milestone', (): void => { - beforeEach((): void => { - optionsInterface.exemptPrMilestones = ''; - }); - - describe('when the given pull request does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given pull request does have a milestone different than the exempt milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given pull request does have a milestone equaling the exempt milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-milestone' - }; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(true); - }); - }); - }); - - describe('when the given options are configured to exempt a pull request milestone', (): void => { - beforeEach((): void => { - optionsInterface.exemptPrMilestones = 'dummy-exempt-pr-milestone'; - }); - - describe('when the given pull request does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given pull request does have a milestone different than the exempt pull request milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given pull request does have a milestone equaling the exempt pull request milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-pr-milestone' - }; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(true); - }); - }); - - describe('when the given pull request does have a milestone different than the exempt milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given pull request does have a milestone equaling the exempt milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-milestone' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - }); - }); - - describe('when the given options are configured to exempt all milestones', (): void => { - beforeEach((): void => { - optionsInterface.exemptAllMilestones = true; - }); - - describe('when the given pull request does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given pull request does have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-pr-milestone' - }; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(true); - }); - }); - - describe('when the given options are not configured to exempt all pull request milestones', (): void => { - beforeEach((): void => { - optionsInterface.exemptAllPrMilestones = false; - }); - - describe('when the given pull request does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given pull request does have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-milestone' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - }); - - describe('when the given options are configured to exempt all pull request milestones', (): void => { - beforeEach((): void => { - optionsInterface.exemptAllPrMilestones = true; - }); - - describe('when the given pull request does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); - }); - - describe('when the given pull request does have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-pr-milestone' - }; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(true); - }); - }); - }); - }); - }); - }); -}); +import {DefaultProcessorOptions} from '../../__tests__/constants/default-processor-options'; +import {generateIIssue} from '../../__tests__/functions/generate-iissue'; +import {IIssue} from '../interfaces/issue'; +import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options'; +import {Issue} from './issue'; +import {Milestones} from './milestones'; + +describe('Milestones', (): void => { + let milestones: Milestones; + let optionsInterface: IIssuesProcessorOptions; + let issue: Issue; + let issueInterface: IIssue; + + beforeEach((): void => { + optionsInterface = { + ...DefaultProcessorOptions, + exemptAllIssueAssignees: false, + exemptAllPrMilestones: false + }; + issueInterface = generateIIssue(); + }); + + describe('shouldExemptMilestones()', (): void => { + describe('when the given issue is not a pull request', (): void => { + beforeEach((): void => { + issueInterface.pull_request = undefined; + }); + + describe('when the given options are not configured to exempt a milestone', (): void => { + beforeEach((): void => { + optionsInterface.exemptMilestones = ''; + }); + + describe('when the given options are not configured to exempt an issue milestone', (): void => { + beforeEach((): void => { + optionsInterface.exemptIssueMilestones = ''; + }); + + describe('when the given issue does not have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = undefined; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given issue does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + }); + + describe('when the given options are configured to exempt an issue milestone', (): void => { + beforeEach((): void => { + optionsInterface.exemptIssueMilestones = + 'dummy-exempt-issue-milestone'; + }); + + describe('when the given issue does not have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = undefined; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given issue does have a milestone different than the exempt issue milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given issue does have a milestone equaling the exempt issue milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-exempt-issue-milestone' + }; + }); + + it('should return true', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(true); + }); + }); + }); + }); + + describe('when the given options are configured to exempt a milestone', (): void => { + beforeEach((): void => { + optionsInterface.exemptMilestones = 'dummy-exempt-milestone'; + }); + + describe('when the given options are not configured to exempt an issue milestone', (): void => { + beforeEach((): void => { + optionsInterface.exemptIssueMilestones = ''; + }); + + describe('when the given issue does not have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = undefined; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given issue does have a milestone different than the exempt milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given issue does have a milestone equaling the exempt milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-exempt-milestone' + }; + }); + + it('should return true', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(true); + }); + }); + }); + + describe('when the given options are configured to exempt an issue milestone', (): void => { + beforeEach((): void => { + optionsInterface.exemptIssueMilestones = + 'dummy-exempt-issue-milestone'; + }); + + describe('when the given issue does not have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = undefined; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given issue does have a milestone different than the exempt issue milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given issue does have a milestone equaling the exempt issue milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-exempt-issue-milestone' + }; + }); + + it('should return true', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(true); + }); + }); + + describe('when the given issue does have a milestone different than the exempt milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given issue does have a milestone equaling the exempt milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-exempt-milestone' + }; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + }); + }); + + describe('when the given options are not configured to exempt all issue milestones', (): void => { + beforeEach((): void => { + optionsInterface.exemptAllIssueMilestones = false; + }); + + describe('when the given issue does not have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = undefined; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given issue does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-exempt-milestone' + }; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + }); + + describe('when the given options are configured to exempt all issue milestones', (): void => { + beforeEach((): void => { + optionsInterface.exemptAllIssueMilestones = true; + }); + + describe('when the given issue does not have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = undefined; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given issue does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-exempt-issue-milestone' + }; + }); + + it('should return true', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(true); + }); + }); + }); + }); + + describe('when the given issue is a pull request', (): void => { + beforeEach((): void => { + issueInterface.pull_request = {}; + }); + + describe('when the given options are not configured to exempt a milestone', (): void => { + beforeEach((): void => { + optionsInterface.exemptMilestones = ''; + }); + + describe('when the given options are not configured to exempt a pull request milestone', (): void => { + beforeEach((): void => { + optionsInterface.exemptPrMilestones = ''; + }); + + describe('when the given pull request does not have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = undefined; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given pull request does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + }); + + describe('when the given options are configured to exempt a pull request milestone', (): void => { + beforeEach((): void => { + optionsInterface.exemptPrMilestones = 'dummy-exempt-pr-milestone'; + }); + + describe('when the given pull request does not have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = undefined; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given pull request does have a milestone different than the exempt pull request milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given pull request does have a milestone equaling the exempt pull request milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-exempt-pr-milestone' + }; + }); + + it('should return true', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(true); + }); + }); + }); + }); + + describe('when the given options are configured to exempt a milestone', (): void => { + beforeEach((): void => { + optionsInterface.exemptMilestones = 'dummy-exempt-milestone'; + }); + + describe('when the given options are not configured to exempt a pull request milestone', (): void => { + beforeEach((): void => { + optionsInterface.exemptPrMilestones = ''; + }); + + describe('when the given pull request does not have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = undefined; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given pull request does have a milestone different than the exempt milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given pull request does have a milestone equaling the exempt milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-exempt-milestone' + }; + }); + + it('should return true', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(true); + }); + }); + }); + + describe('when the given options are configured to exempt a pull request milestone', (): void => { + beforeEach((): void => { + optionsInterface.exemptPrMilestones = 'dummy-exempt-pr-milestone'; + }); + + describe('when the given pull request does not have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = undefined; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given pull request does have a milestone different than the exempt pull request milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given pull request does have a milestone equaling the exempt pull request milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-exempt-pr-milestone' + }; + }); + + it('should return true', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(true); + }); + }); + + describe('when the given pull request does have a milestone different than the exempt milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given pull request does have a milestone equaling the exempt milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-exempt-milestone' + }; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + }); + }); + + describe('when the given options are not configured to exempt all pull request milestones', (): void => { + beforeEach((): void => { + optionsInterface.exemptAllPrMilestones = false; + }); + + describe('when the given pull request does not have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = undefined; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given pull request does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-exempt-milestone' + }; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + }); + + describe('when the given options are configured to exempt all pull request milestones', (): void => { + beforeEach((): void => { + optionsInterface.exemptAllPrMilestones = true; + }); + + describe('when the given pull request does not have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = undefined; + }); + + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(false); + }); + }); + + describe('when the given pull request does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-exempt-pr-milestone' + }; + }); + + it('should return true', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); + + const result = milestones.shouldExemptMilestones(); + + expect(result).toStrictEqual(true); + }); + }); + }); + }); + }); +}); diff --git a/src/classes/milestones.ts b/src/classes/milestones.ts index db002ea4a..05122b68b 100644 --- a/src/classes/milestones.ts +++ b/src/classes/milestones.ts @@ -1,297 +1,273 @@ -import deburr from 'lodash.deburr'; -import {Option} from '../enums/option'; -import {wordsToList} from '../functions/words-to-list'; -import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options'; -import {Issue} from './issue'; -import {IssueLogger} from './loggers/issue-logger'; -import {LoggerService} from '../services/logger.service'; - -type CleanMilestone = string; - -export class Milestones { - private static _cleanMilestone(milestone: Readonly): CleanMilestone { - return deburr(milestone.toLowerCase()); - } - - private readonly _options: IIssuesProcessorOptions; - private readonly _issue: Issue; - private readonly _issueLogger: IssueLogger; - - constructor(options: Readonly, issue: Issue) { - this._options = options; - this._issue = issue; - this._issueLogger = new IssueLogger(issue); - } - - shouldExemptMilestones(): boolean { - if (!this._issue.milestone) { - this._issueLogger.info('This $$type has no milestone'); - this._logSkip(); - - return false; - } - - if (this._shouldExemptAllMilestones()) { - this._issueLogger.info( - LoggerService.white('└──'), - 'Skipping this $$type because it has a milestone' - ); - - return true; - } - - const exemptMilestones: string[] = this._getExemptMilestones(); - - if (exemptMilestones.length === 0) { - this._issueLogger.info( - LoggerService.white('├──'), - `No milestone option was specified to skip the stale process for this $$type` - ); - this._logSkip(); - - return false; - } - - this._issueLogger.info( - LoggerService.white('├──'), - `Found ${LoggerService.cyan(exemptMilestones.length)} milestone${ - exemptMilestones.length > 1 ? 's' : '' - } that can exempt stale on this $$type` - ); - - const hasExemptMilestone: boolean = exemptMilestones.some( - (exemptMilestone: Readonly): boolean => - this._hasMilestone(exemptMilestone) - ); - - if (!hasExemptMilestone) { - this._issueLogger.info( - LoggerService.white('├──'), - 'No milestone on this $$type can exempt the stale process' - ); - this._logSkip(); - } else { - this._issueLogger.info( - LoggerService.white('└──'), - 'Skipping this $$type because it has an exempt milestone' - ); - } - - return hasExemptMilestone; - } - - private _getExemptMilestones(): string[] { - return this._issue.isPullRequest - ? this._getExemptPullRequestMilestones() - : this._getExemptIssueMilestones(); - } - - private _getExemptIssueMilestones(): string[] { - if (this._options.exemptIssueMilestones === '') { - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptIssueMilestones - )} is disabled. No specific milestone can skip the stale process for this $$type` - ); - - if (this._options.exemptMilestones === '') { - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptMilestones - )} is disabled. No specific milestone can skip the stale process for this $$type` - ); - - return []; - } - - const exemptMilestones: string[] = wordsToList( - this._options.exemptMilestones - ); - - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptMilestones - )} is set. ${LoggerService.cyan(exemptMilestones.length)} milestone${ - exemptMilestones.length === 1 ? '' : 's' - } can skip the stale process for this $$type` - ); - - return exemptMilestones; - } - - const exemptMilestones: string[] = wordsToList( - this._options.exemptIssueMilestones - ); - - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptIssueMilestones - )} is set. ${LoggerService.cyan(exemptMilestones.length)} milestone${ - exemptMilestones.length === 1 ? '' : 's' - } can skip the stale process for this $$type` - ); - - return exemptMilestones; - } - - private _getExemptPullRequestMilestones(): string[] { - if (this._options.exemptPrMilestones === '') { - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptPrMilestones - )} is disabled. No specific milestone can skip the stale process for this $$type` - ); - - if (this._options.exemptMilestones === '') { - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptMilestones - )} is disabled. No specific milestone can skip the stale process for this $$type` - ); - - return []; - } - - const exemptMilestones: string[] = wordsToList( - this._options.exemptMilestones - ); - - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptMilestones - )} is set. ${LoggerService.cyan(exemptMilestones.length)} milestone${ - exemptMilestones.length === 1 ? '' : 's' - } can skip the stale process for this $$type` - ); - - return exemptMilestones; - } - - const exemptMilestones: string[] = wordsToList( - this._options.exemptPrMilestones - ); - - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptPrMilestones - )} is set. ${LoggerService.cyan(exemptMilestones.length)} milestone${ - exemptMilestones.length === 1 ? '' : 's' - } can skip the stale process for this $$type` - ); - - return exemptMilestones; - } - - private _hasMilestone(milestone: Readonly): boolean { - if (!this._issue.milestone) { - return false; - } - - const cleanMilestone: CleanMilestone = - Milestones._cleanMilestone(milestone); - - const isSameMilestone: boolean = - cleanMilestone === - Milestones._cleanMilestone(this._issue.milestone.title); - - if (isSameMilestone) { - this._issueLogger.info( - LoggerService.white('├──'), - `The milestone "${LoggerService.cyan( - milestone - )}" is set on this $$type and is an exempt milestone` - ); - } - - return isSameMilestone; - } - - private _shouldExemptAllMilestones(): boolean { - if (this._issue.milestone) { - return this._issue.isPullRequest - ? this._shouldExemptAllPullRequestMilestones() - : this._shouldExemptAllIssueMilestones(); - } - - return false; - } - - private _shouldExemptAllIssueMilestones(): boolean { - if (this._options.exemptAllIssueMilestones === true) { - this._issueLogger.info( - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAllIssueMilestones - )} is enabled. Any milestone on this $$type will skip the stale process` - ); - - return true; - } else if (this._options.exemptAllIssueMilestones === false) { - this._issueLogger.info( - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAllIssueMilestones - )} is disabled. Only some specific milestones on this $$type will skip the stale process` - ); - - return false; - } - - this._logExemptAllMilestonesOption(); - - return this._options.exemptAllMilestones; - } - - private _shouldExemptAllPullRequestMilestones(): boolean { - if (this._options.exemptAllPrMilestones === true) { - this._issueLogger.info( - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAllPrMilestones - )} is enabled. Any milestone on this $$type will skip the stale process` - ); - - return true; - } else if (this._options.exemptAllPrMilestones === false) { - this._issueLogger.info( - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAllPrMilestones - )} is disabled. Only some specific milestones on this $$type will skip the stale process` - ); - - return false; - } - - this._logExemptAllMilestonesOption(); - - return this._options.exemptAllMilestones; - } - - private _logExemptAllMilestonesOption(): void { - if (this._options.exemptAllMilestones) { - this._issueLogger.info( - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAllMilestones - )} is enabled. Any milestone on this $$type will skip the stale process` - ); - } else { - this._issueLogger.info( - `The option ${this._issueLogger.createOptionLink( - Option.ExemptAllMilestones - )} is disabled. Only some specific milestones on this $$type will skip the stale process` - ); - } - } - - private _logSkip(): void { - this._issueLogger.info( - LoggerService.white('└──'), - 'Skip the milestones checks' - ); - } -} +import deburr from 'lodash.deburr'; +import {Option} from '../enums/option'; +import {wordsToList} from '../functions/words-to-list'; +import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options'; +import {Issue} from './issue'; +import {IssueLogger} from './loggers/issue-logger'; +import {LoggerService} from '../services/logger.service'; + +type CleanMilestone = string; + +export class Milestones { + private static _cleanMilestone(milestone: Readonly): CleanMilestone { + return deburr(milestone.toLowerCase()); + } + + private readonly _options: IIssuesProcessorOptions; + private readonly _issue: Issue; + private readonly _issueLogger: IssueLogger; + + constructor(options: Readonly, issue: Issue) { + this._options = options; + this._issue = issue; + this._issueLogger = new IssueLogger(issue); + } + + shouldExemptMilestones(): boolean { + if (!this._issue.milestone) { + this._issueLogger.info('This $$type has no milestone'); + this._logSkip(); + + return false; + } + + if (this._shouldExemptAllMilestones()) { + this._issueLogger.info( + LoggerService.white('└──'), + 'Skipping this $$type because it has a milestone' + ); + + return true; + } + + const exemptMilestones: string[] = this._getExemptMilestones(); + + if (exemptMilestones.length === 0) { + this._issueLogger.info( + LoggerService.white('├──'), + `No milestone option was specified to skip the stale process for this $$type` + ); + this._logSkip(); + + return false; + } + + this._issueLogger.info( + LoggerService.white('├──'), + `Found ${LoggerService.cyan(exemptMilestones.length)} milestone${ + exemptMilestones.length > 1 ? 's' : '' + } that can exempt stale on this $$type` + ); + + const hasExemptMilestone: boolean = exemptMilestones.some( + (exemptMilestone: Readonly): boolean => + this._hasMilestone(exemptMilestone) + ); + + if (!hasExemptMilestone) { + this._issueLogger.info( + LoggerService.white('├──'), + 'No milestone on this $$type can exempt the stale process' + ); + this._logSkip(); + } else { + this._issueLogger.info( + LoggerService.white('└──'), + 'Skipping this $$type because it has an exempt milestone' + ); + } + + return hasExemptMilestone; + } + + private _getExemptMilestones(): string[] { + return this._issue.isPullRequest + ? this._getExemptPullRequestMilestones() + : this._getExemptIssueMilestones(); + } + + private _getExemptIssueMilestones(): string[] { + if (this._options.exemptIssueMilestones === '') { + this._issueLogger.info( + LoggerService.white('├──'), + `The option ${this._issueLogger.createOptionLink( + Option.ExemptIssueMilestones + )} is disabled. No specific milestone can skip the stale process for this $$type` + ); + + if (this._options.exemptMilestones === '') { + this._issueLogger.info( + LoggerService.white('├──'), + `The option ${this._issueLogger.createOptionLink( + Option.ExemptMilestones + )} is disabled. No specific milestone can skip the stale process for this $$type` + ); + + return []; + } + + const exemptMilestones: string[] = wordsToList( + this._options.exemptMilestones + ); + + this._issueLogger.info( + LoggerService.white('├──'), + `The option ${this._issueLogger.createOptionLink( + Option.ExemptMilestones + )} is set. ${LoggerService.cyan(exemptMilestones.length)} milestone${ + exemptMilestones.length === 1 ? '' : 's' + } can skip the stale process for this $$type` + ); + + return exemptMilestones; + } + + const exemptMilestones: string[] = wordsToList( + this._options.exemptIssueMilestones + ); + + this._issueLogger.info( + LoggerService.white('├──'), + `The option ${this._issueLogger.createOptionLink( + Option.ExemptIssueMilestones + )} is set. ${LoggerService.cyan(exemptMilestones.length)} milestone${ + exemptMilestones.length === 1 ? '' : 's' + } can skip the stale process for this $$type` + ); + + return exemptMilestones; + } + + private _getExemptPullRequestMilestones(): string[] { + if (this._options.exemptPrMilestones === '') { + this._issueLogger.info( + LoggerService.white('├──'), + `The option ${this._issueLogger.createOptionLink( + Option.ExemptPrMilestones + )} is disabled. No specific milestone can skip the stale process for this $$type` + ); + + if (this._options.exemptMilestones === '') { + this._issueLogger.info( + LoggerService.white('├──'), + `The option ${this._issueLogger.createOptionLink( + Option.ExemptMilestones + )} is disabled. No specific milestone can skip the stale process for this $$type` + ); + + return []; + } + + const exemptMilestones: string[] = wordsToList( + this._options.exemptMilestones + ); + + this._issueLogger.info( + LoggerService.white('├──'), + `The option ${this._issueLogger.createOptionLink( + Option.ExemptMilestones + )} is set. ${LoggerService.cyan(exemptMilestones.length)} milestone${ + exemptMilestones.length === 1 ? '' : 's' + } can skip the stale process for this $$type` + ); + + return exemptMilestones; + } + + const exemptMilestones: string[] = wordsToList( + this._options.exemptPrMilestones + ); + + this._issueLogger.info( + LoggerService.white('├──'), + `The option ${this._issueLogger.createOptionLink( + Option.ExemptPrMilestones + )} is set. ${LoggerService.cyan(exemptMilestones.length)} milestone${ + exemptMilestones.length === 1 ? '' : 's' + } can skip the stale process for this $$type` + ); + + return exemptMilestones; + } + + private _hasMilestone(milestone: Readonly): boolean { + if (!this._issue.milestone) { + return false; + } + + const cleanMilestone: CleanMilestone = + Milestones._cleanMilestone(milestone); + + const isSameMilestone: boolean = + cleanMilestone === + Milestones._cleanMilestone(this._issue.milestone.title); + + if (isSameMilestone) { + this._issueLogger.info( + LoggerService.white('├──'), + `The milestone "${LoggerService.cyan( + milestone + )}" is set on this $$type and is an exempt milestone` + ); + } + + return isSameMilestone; + } + + private _shouldExemptAllMilestones(): boolean { + if (this._issue.milestone) { + return this._issue.isPullRequest + ? this._shouldExemptAllPullRequestMilestones() + : this._shouldExemptAllIssueMilestones(); + } + + return false; + } + + private _shouldExemptAllIssueMilestones(): boolean { + if (this._options.exemptAllIssueMilestones) { + this._issueLogger.info( + `The option ${this._issueLogger.createOptionLink( + Option.ExemptAllIssueMilestones + )} is enabled. Any milestone on this $$type will skip the stale process` + ); + + return true; + } + + this._issueLogger.info( + `The option ${this._issueLogger.createOptionLink( + Option.ExemptAllIssueMilestones + )} is disabled. Only some specific milestones on this $$type will skip the stale process` + ); + + return false; + } + + private _shouldExemptAllPullRequestMilestones(): boolean { + if (this._options.exemptAllPrMilestones) { + this._issueLogger.info( + `The option ${this._issueLogger.createOptionLink( + Option.ExemptAllPrMilestones + )} is enabled. Any milestone on this $$type will skip the stale process` + ); + + return true; + } + + this._issueLogger.info( + `The option ${this._issueLogger.createOptionLink( + Option.ExemptAllPrMilestones + )} is disabled. Only some specific milestones on this $$type will skip the stale process` + ); + + return false; + } + + private _logSkip(): void { + this._issueLogger.info( + LoggerService.white('└──'), + 'Skip the milestones checks' + ); + } +} diff --git a/src/enums/option.ts b/src/enums/option.ts index a69e19c68..3f957409b 100644 --- a/src/enums/option.ts +++ b/src/enums/option.ts @@ -31,7 +31,6 @@ export enum Option { ExemptMilestones = 'exempt-milestones', ExemptIssueMilestones = 'exempt-issue-milestones', ExemptPrMilestones = 'exempt-pr-milestones', - ExemptAllMilestones = 'exempt-all-milestones', ExemptAllIssueMilestones = 'exempt-all-issue-milestones', ExemptAllPrMilestones = 'exempt-all-pr-milestones', ExemptIssueAssignees = 'exempt-issue-assignees', diff --git a/src/interfaces/issues-processor-options.ts b/src/interfaces/issues-processor-options.ts index 9817cb691..b44804e95 100644 --- a/src/interfaces/issues-processor-options.ts +++ b/src/interfaces/issues-processor-options.ts @@ -35,9 +35,8 @@ export interface IIssuesProcessorOptions { exemptMilestones: string; exemptIssueMilestones: string; exemptPrMilestones: string; - exemptAllMilestones: boolean; - exemptAllIssueMilestones: boolean | undefined; - exemptAllPrMilestones: boolean | undefined; + exemptAllIssueMilestones: boolean; + exemptAllPrMilestones: boolean; exemptIssueAssignees: string; exemptPrAssignees: string; exemptAllIssueAssignees: boolean; diff --git a/src/main.ts b/src/main.ts index d9d298796..469bdebe4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -72,9 +72,9 @@ function _getAndValidateArgs(): IIssuesProcessorOptions { exemptMilestones: core.getInput('exempt-milestones'), exemptIssueMilestones: core.getInput('exempt-issue-milestones'), exemptPrMilestones: core.getInput('exempt-pr-milestones'), - exemptAllMilestones: core.getInput('exempt-all-milestones') === 'true', - exemptAllIssueMilestones: _toOptionalBoolean('exempt-all-issue-milestones'), - exemptAllPrMilestones: _toOptionalBoolean('exempt-all-pr-milestones'), + exemptAllIssueMilestones: + core.getInput('exempt-all-issue-milestones') === 'true', + exemptAllPrMilestones: core.getInput('exempt-all-pr-milestones') === 'true', exemptIssueAssignees: core.getInput('exempt-issue-assignees'), exemptPrAssignees: core.getInput('exempt-pr-assignees'), exemptAllIssueAssignees: From f6a70aa856b644851474e0bba0e605366840cb2e Mon Sep 17 00:00:00 2001 From: TESTELIN Geoffrey Date: Fri, 8 Oct 2021 19:48:38 +0200 Subject: [PATCH 05/11] feat: remove the exempt-milestones option BREAKING CHANGE: The option exempt-milestones was removed --- README.md | 33 +- .../constants/default-processor-options.ts | 1 - __tests__/main.spec.ts | 110 +- __tests__/milestones.spec.ts | 1040 ++++++----------- action.yml | 8 +- dist/index.js | 18 +- src/classes/issue.spec.ts | 1 - src/classes/milestones.spec.ts | 628 ++++------ src/classes/milestones.ts | 52 +- src/enums/option.ts | 1 - src/interfaces/issues-processor-options.ts | 1 - src/main.ts | 1 - 12 files changed, 625 insertions(+), 1269 deletions(-) diff --git a/README.md b/README.md index 5e1644aef..11fbd0a83 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ You can find more information about the required permissions under the correspon Every argument is optional. | Input | Description | Default | -| ------------------------------------------------------------------- | ----------------------------------------------------------------------- | --------------------- | ------- | +| ------------------------------------------------------------------- | ----------------------------------------------------------------------- | --------------------- | | [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-issue-stale](#days-before-issue-stale) | Override [days-before-stale](#days-before-stale) for issues only | | @@ -63,11 +63,10 @@ Every argument is optional. | [ascending](#ascending) | Order to get issues/PRs | `false` | | [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` | -| [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-pr-milestones](#exempt-pr-milestones) | Override [exempt-milestones](#exempt-milestones) for PRs only | | -| [exempt-all-issue-milestones](#exempt-all-issue-milestones) | Exempt all issues with milestones from stale | | `false` | -| [exempt-all-pr-milestones](#exempt-all-pr-milestones) | Exempt all PRs with milestones from stale | | `false` | +| [exempt-issue-milestones](#exempt-issue-milestones) | Milestones on issues exempted from stale | | +| [exempt-pr-milestones](#exempt-pr-milestones) | Milestones on PRs exempted from stale | | +| [exempt-all-issue-milestones](#exempt-all-issue-milestones) | Exempt all issues with milestones from stale | `false` | +| [exempt-all-pr-milestones](#exempt-all-pr-milestones) | Exempt all PRs with milestones from stale | `false` | | [exempt-issue-assignees](#exempt-issue-assignees) | Assignees on issues exempted from stale | | | [exempt-pr-assignees](#exempt-pr-assignees) | Assignees on PRs exempted from stale | | | [exempt-all-issue-assignees](#exempt-all-issue-assignees) | Exempt all issues with assignees from stale | `false` | @@ -120,7 +119,8 @@ You can fine tune which issues or pull requests should be marked as stale based - [only-labels](#only-labels) - [any-of-labels](#any-of-labels) - [start-date](#start-date) -- [exempt-milestones](#exempt-milestones) +- [exempt-issue-milestones](#exempt-issue-milestones) +- [exempt-pr-milestones](#exempt-pr-milestones) - [exempt-all-issue-milestones](#exempt-all-issue-milestones) - [exempt-all-pr-milestones](#exempt-all-pr-milestones) - [exempt-issue-assignees](#exempt-issue-assignees) @@ -391,24 +391,21 @@ If set to `true`, the stale workflow will automatically delete the GitHub branch Default value: `false` Required Permission: `pull-requests: write` -#### exempt-milestones +#### exempt-issue-milestones -A white-list of milestone(s) to only process the issues or the pull requests that does not contain one of these milestone(s). +A white-list of milestone(s) to only process the issues that does not contain one of these milestone(s). It can be a comma separated list of milestones (e.g: `V1,next`). If unset (or an empty string), this option will not alter the stale workflow. Default value: unset -#### exempt-issue-milestones - -Override [exempt-milestones](#exempt-milestones) but only to process the issues that does not contain one of these milestone(s). - -Default value: unset - #### exempt-pr-milestones -Override [exempt-milestones](#exempt-milestones) but only to process the pull requests that does not contain one of these milestone(s). +A white-list of milestone(s) to only process the pull requests that does not contain one of these milestone(s). +It can be a comma separated list of milestones (e.g: `V1,next`). + +If unset (or an empty string), this option will not alter the stale workflow. Default value: unset @@ -416,7 +413,7 @@ Default value: unset If set to `true`, the issues with a milestone will not be marked as stale automatically. -Priority over [exempt-milestones](#exempt-milestones). +Priority over [exempt-issue-milestones](#exempt-issue-milestones). Default value: `false` @@ -424,7 +421,7 @@ Default value: `false` If set to `true`, the pull requests with a milestone will not be marked as stale automatically. -Priority over [exempt-milestones](#exempt-milestones). +Priority over [exempt-pr-milestones](#exempt-pr-milestones). Default value: `false` diff --git a/__tests__/constants/default-processor-options.ts b/__tests__/constants/default-processor-options.ts index 0939ec108..e202a4512 100644 --- a/__tests__/constants/default-processor-options.ts +++ b/__tests__/constants/default-processor-options.ts @@ -32,7 +32,6 @@ export const DefaultProcessorOptions: IIssuesProcessorOptions = Object.freeze({ ascending: false, deleteBranch: false, startDate: '', - exemptMilestones: '', exemptIssueMilestones: '', exemptPrMilestones: '', exemptAllIssueMilestones: false, diff --git a/__tests__/main.spec.ts b/__tests__/main.spec.ts index 2abb5ee44..4153432e6 100644 --- a/__tests__/main.spec.ts +++ b/__tests__/main.spec.ts @@ -1689,7 +1689,7 @@ test('an issue without a milestone will be marked as stale', async () => { test('an issue without an exempted milestone will be marked as stale', async () => { expect.assertions(3); const opts = {...DefaultProcessorOptions}; - opts.exemptMilestones = 'Milestone1'; + opts.exemptIssueMilestones = 'Milestone1'; const TestIssueList: Issue[] = [ generateIssue( opts, @@ -1722,7 +1722,7 @@ test('an issue without an exempted milestone will be marked as stale', async () test('an issue with an exempted milestone will not be marked as stale', async () => { expect.assertions(3); const opts = {...DefaultProcessorOptions}; - opts.exemptMilestones = 'Milestone1'; + opts.exemptIssueMilestones = 'Milestone1'; const TestIssueList: Issue[] = [ generateIssue( opts, @@ -1755,7 +1755,7 @@ test('an issue with an exempted milestone will not be marked as stale', async () test('an issue with an exempted milestone will not be marked as stale (multi milestones with spaces)', async () => { expect.assertions(3); const opts = {...DefaultProcessorOptions}; - opts.exemptMilestones = 'Milestone1, Milestone2'; + opts.exemptIssueMilestones = 'Milestone1, Milestone2'; const TestIssueList: Issue[] = [ generateIssue( opts, @@ -1788,7 +1788,7 @@ test('an issue with an exempted milestone will not be marked as stale (multi mil test('an issue with an exempted milestone will not be marked as stale (multi milestones without spaces)', async () => { expect.assertions(3); const opts = {...DefaultProcessorOptions}; - opts.exemptMilestones = 'Milestone1,Milestone2'; + opts.exemptIssueMilestones = 'Milestone1,Milestone2'; const TestIssueList: Issue[] = [ generateIssue( opts, @@ -1818,108 +1818,6 @@ test('an issue with an exempted milestone will not be marked as stale (multi mil expect(processor.removedLabelIssues.length).toStrictEqual(0); }); -test('an issue with an exempted milestone but without an exempted issue milestone will not be marked as stale', async () => { - expect.assertions(3); - const opts = {...DefaultProcessorOptions}; - opts.exemptMilestones = 'Milestone1'; - opts.exemptIssueMilestones = ''; - const TestIssueList: Issue[] = [ - generateIssue( - opts, - 1, - 'My first issue', - '2020-01-01T17:00:00Z', - '2020-01-01T17:00:00Z', - false, - undefined, - undefined, - undefined, - 'Milestone1' - ) - ]; - const processor = new IssuesProcessorMock( - opts, - async p => (p === 1 ? TestIssueList : []), - async () => [], - async () => new Date().toDateString() - ); - - // process our fake issue list - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual(0); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); -}); - -test('an issue with an exempted milestone but with another exempted issue milestone will be marked as stale', async () => { - expect.assertions(3); - const opts = {...DefaultProcessorOptions}; - opts.exemptMilestones = 'Milestone1'; - opts.exemptIssueMilestones = 'Milestone2'; - const TestIssueList: Issue[] = [ - generateIssue( - opts, - 1, - 'My first issue', - '2020-01-01T17:00:00Z', - '2020-01-01T17:00:00Z', - false, - undefined, - undefined, - undefined, - 'Milestone1' - ) - ]; - const processor = new IssuesProcessorMock( - opts, - async p => (p === 1 ? TestIssueList : []), - async () => [], - async () => new Date().toDateString() - ); - - // process our fake issue list - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual(1); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); -}); - -test('an issue with an exempted milestone and with an exempted issue milestone will not be marked as stale', async () => { - expect.assertions(3); - const opts = {...DefaultProcessorOptions}; - opts.exemptMilestones = 'Milestone1'; - opts.exemptIssueMilestones = 'Milestone1'; - const TestIssueList: Issue[] = [ - generateIssue( - opts, - 1, - 'My first issue', - '2020-01-01T17:00:00Z', - '2020-01-01T17:00:00Z', - false, - undefined, - undefined, - undefined, - 'Milestone1' - ) - ]; - const processor = new IssuesProcessorMock( - opts, - async p => (p === 1 ? TestIssueList : []), - async () => [], - async () => new Date().toDateString() - ); - - // process our fake issue list - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual(0); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); -}); - test('processing an issue opened since 2 days and with the option "daysBeforeIssueStale" at 3 will not make it stale', async () => { expect.assertions(2); const opts: IIssuesProcessorOptions = { diff --git a/__tests__/milestones.spec.ts b/__tests__/milestones.spec.ts index b94a793e4..bc209ce15 100644 --- a/__tests__/milestones.spec.ts +++ b/__tests__/milestones.spec.ts @@ -84,19 +84,19 @@ describe('milestones options', (): void => { } ); - describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { + describe('when all the issues milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone'; + opts.exemptIssueMilestones = 'dummy-issue-milestone'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} + ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -120,101 +120,60 @@ describe('milestones options', (): void => { }); } ); + }); - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = 'dummy-issue-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); + describe('when all the pull requests milestones should exempt a specific milestone', (): void => { + beforeEach((): void => { + opts.exemptPrMilestones = 'dummy-pull-request-milestone'; }); - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = 'dummy-pull-request-milestone'; - }); + describe.each` + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} + `( + 'when $name', + ({isPullRequest, milestone, shouldStale}: ITestData): void => { + beforeEach((): void => { + setTestIssueList(isPullRequest, milestone); + setProcessor(); + }); - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); + test(`should${ + shouldStale ? '' : ' not' + } be marked as stale`, async () => { + expect.assertions(3); + + await processor.processIssues(1); + + expect(processor.staleIssues.length).toStrictEqual( + shouldStale ? 1 : 0 + ); + expect(processor.closedIssues.length).toStrictEqual(0); + expect(processor.removedLabelIssues.length).toStrictEqual(0); + }); + } + ); }); - describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { + describe('when all the issues milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; + opts.exemptIssueMilestones = + 'dummy-issue-milestone1, dummy-issue-milestone2'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} + ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -238,88 +197,45 @@ describe('milestones options', (): void => { }); } ); + }); - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = - 'dummy-issue-milestone1, dummy-issue-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); + describe('when all the pull requests milestones should exempt a specific milestone', (): void => { + beforeEach((): void => { + opts.exemptPrMilestones = + 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; }); - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = - 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; - }); + describe.each` + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} + `( + 'when $name', + ({isPullRequest, milestone, shouldStale}: ITestData): void => { + beforeEach((): void => { + setTestIssueList(isPullRequest, milestone); + setProcessor(); + }); - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); + test(`should${ + shouldStale ? '' : ' not' + } be marked as stale`, async () => { + expect.assertions(3); + + await processor.processIssues(1); + + expect(processor.staleIssues.length).toStrictEqual( + shouldStale ? 1 : 0 + ); + expect(processor.closedIssues.length).toStrictEqual(0); + expect(processor.removedLabelIssues.length).toStrictEqual(0); + }); + } + ); }); }); @@ -358,19 +274,19 @@ describe('milestones options', (): void => { } ); - describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { + describe('when all the issues milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone'; + opts.exemptIssueMilestones = 'dummy-issue-milestone'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} + ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -394,101 +310,60 @@ describe('milestones options', (): void => { }); } ); + }); - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = 'dummy-issue-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); + describe('when all the pull requests milestones should exempt a specific milestone', (): void => { + beforeEach((): void => { + opts.exemptPrMilestones = 'dummy-pull-request-milestone'; }); - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = 'dummy-pull-request-milestone'; - }); + describe.each` + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} + ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} + `( + 'when $name', + ({isPullRequest, milestone, shouldStale}: ITestData): void => { + beforeEach((): void => { + setTestIssueList(isPullRequest, milestone); + setProcessor(); + }); - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); + test(`should${ + shouldStale ? '' : ' not' + } be marked as stale`, async () => { + expect.assertions(3); + + await processor.processIssues(1); + + expect(processor.staleIssues.length).toStrictEqual( + shouldStale ? 1 : 0 + ); + expect(processor.closedIssues.length).toStrictEqual(0); + expect(processor.removedLabelIssues.length).toStrictEqual(0); + }); + } + ); }); - describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { + describe('when all the issues milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; + opts.exemptIssueMilestones = + 'dummy-issue-milestone1, dummy-issue-milestone2'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} + ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -512,88 +387,45 @@ describe('milestones options', (): void => { }); } ); + }); - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = - 'dummy-issue-milestone1, dummy-issue-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); + describe('when all the pull requests milestones should exempt a specific milestone', (): void => { + beforeEach((): void => { + opts.exemptPrMilestones = + 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; }); - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = - 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; - }); + describe.each` + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} + ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} + `( + 'when $name', + ({isPullRequest, milestone, shouldStale}: ITestData): void => { + beforeEach((): void => { + setTestIssueList(isPullRequest, milestone); + setProcessor(); + }); - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); + test(`should${ + shouldStale ? '' : ' not' + } be marked as stale`, async () => { + expect.assertions(3); + + await processor.processIssues(1); + + expect(processor.staleIssues.length).toStrictEqual( + shouldStale ? 1 : 0 + ); + expect(processor.closedIssues.length).toStrictEqual(0); + expect(processor.removedLabelIssues.length).toStrictEqual(0); + }); + } + ); }); }); @@ -632,19 +464,19 @@ describe('milestones options', (): void => { } ); - describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { + describe('when all the issues milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone'; + opts.exemptIssueMilestones = 'dummy-issue-milestone'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} + ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -668,101 +500,60 @@ describe('milestones options', (): void => { }); } ); + }); - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = 'dummy-issue-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); + describe('when all the pull requests milestones should exempt a specific milestone', (): void => { + beforeEach((): void => { + opts.exemptPrMilestones = 'dummy-pull-request-milestone'; }); - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = 'dummy-pull-request-milestone'; - }); + describe.each` + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} + `( + 'when $name', + ({isPullRequest, milestone, shouldStale}: ITestData): void => { + beforeEach((): void => { + setTestIssueList(isPullRequest, milestone); + setProcessor(); + }); - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); + test(`should${ + shouldStale ? '' : ' not' + } be marked as stale`, async () => { + expect.assertions(3); + + await processor.processIssues(1); + + expect(processor.staleIssues.length).toStrictEqual( + shouldStale ? 1 : 0 + ); + expect(processor.closedIssues.length).toStrictEqual(0); + expect(processor.removedLabelIssues.length).toStrictEqual(0); + }); + } + ); }); - describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { + describe('when all the issues milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; + opts.exemptIssueMilestones = + 'dummy-issue-milestone1, dummy-issue-milestone2'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} + ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} + ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -786,88 +577,45 @@ describe('milestones options', (): void => { }); } ); + }); - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = - 'dummy-issue-milestone1, dummy-issue-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${true} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); + describe('when all the pull requests milestones should exempt a specific milestone', (): void => { + beforeEach((): void => { + opts.exemptPrMilestones = + 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; }); - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = - 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; - }); + describe.each` + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} + `( + 'when $name', + ({isPullRequest, milestone, shouldStale}: ITestData): void => { + beforeEach((): void => { + setTestIssueList(isPullRequest, milestone); + setProcessor(); + }); - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${true} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); + test(`should${ + shouldStale ? '' : ' not' + } be marked as stale`, async () => { + expect.assertions(3); + + await processor.processIssues(1); + + expect(processor.staleIssues.length).toStrictEqual( + shouldStale ? 1 : 0 + ); + expect(processor.closedIssues.length).toStrictEqual(0); + expect(processor.removedLabelIssues.length).toStrictEqual(0); + }); + } + ); }); }); @@ -906,19 +654,19 @@ describe('milestones options', (): void => { } ); - describe('when all the issues and pull requests milestones should exempt a specific milestone', (): void => { + describe('when all the issues milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone'; + opts.exemptIssueMilestones = 'dummy-issue-milestone'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} + ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} + ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -942,101 +690,60 @@ describe('milestones options', (): void => { }); } ); + }); - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = 'dummy-issue-milestone'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-issue-milestone'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); + describe('when all the pull requests milestones should exempt a specific milestone', (): void => { + beforeEach((): void => { + opts.exemptPrMilestones = 'dummy-pull-request-milestone'; }); - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = 'dummy-pull-request-milestone'; - }); + describe.each` + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} + ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} + `( + 'when $name', + ({isPullRequest, milestone, shouldStale}: ITestData): void => { + beforeEach((): void => { + setTestIssueList(isPullRequest, milestone); + setProcessor(); + }); - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-pull-request-milestone'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); + test(`should${ + shouldStale ? '' : ' not' + } be marked as stale`, async () => { + expect.assertions(3); + + await processor.processIssues(1); + + expect(processor.staleIssues.length).toStrictEqual( + shouldStale ? 1 : 0 + ); + expect(processor.closedIssues.length).toStrictEqual(0); + expect(processor.removedLabelIssues.length).toStrictEqual(0); + }); + } + ); }); - describe('when all the issues and pull requests milestones should exempt some milestones', (): void => { + describe('when all the issues milestones should exempt a specific milestone', (): void => { beforeEach((): void => { - opts.exemptMilestones = 'dummy-milestone1, dummy-milestone2'; + opts.exemptIssueMilestones = + 'dummy-issue-milestone1, dummy-issue-milestone2'; }); describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} + ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} + ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} `( 'when $name', ({isPullRequest, milestone, shouldStale}: ITestData): void => { @@ -1060,88 +767,45 @@ describe('milestones options', (): void => { }); } ); + }); - describe('when all the issues milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptIssueMilestones = - 'dummy-issue-milestone1, dummy-issue-milestone2'; - }); - - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific issue exempted one'} | ${true} - ${false} | ${'dummy-issue-milestone2'} | ${'the issue does have a milestone matching the specific issue exempted one'} | ${false} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${true} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-issue-milestone2'} | ${'the PR does have a milestone matching the specific issue exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); + describe('when all the pull requests milestones should exempt a specific milestone', (): void => { + beforeEach((): void => { + opts.exemptPrMilestones = + 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; }); - describe('when all the pull requests milestones should exempt a specific milestone', (): void => { - beforeEach((): void => { - opts.exemptPrMilestones = - 'dummy-pull-request-milestone1, dummy-pull-request-milestone2'; - }); + describe.each` + isPullRequest | milestone | name | shouldStale + ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} + ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} + ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} + ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} + ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} + ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} + `( + 'when $name', + ({isPullRequest, milestone, shouldStale}: ITestData): void => { + beforeEach((): void => { + setTestIssueList(isPullRequest, milestone); + setProcessor(); + }); - describe.each` - isPullRequest | milestone | name | shouldStale - ${false} | ${''} | ${'the issue does not have a milestone'} | ${true} - ${false} | ${'dummy-milestone-not-exempted'} | ${'the issue does have a milestone but not matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-pull-request-milestone2'} | ${'the issue does have a milestone matching the specific pull request exempted one'} | ${true} - ${false} | ${'dummy-milestone2'} | ${'the issue does have a milestone matching the specific exempted one'} | ${false} - ${true} | ${''} | ${'the PR does not have a milestone'} | ${true} - ${true} | ${'dummy-milestone-not-exempted'} | ${'the PR does have a milestone but not matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-pull-request-milestone2'} | ${'the PR does have a milestone matching the specific pull request exempted one'} | ${false} - ${true} | ${'dummy-milestone2'} | ${'the PR does have a milestone matching the specific exempted one'} | ${false} - `( - 'when $name', - ({isPullRequest, milestone, shouldStale}: ITestData): void => { - beforeEach((): void => { - setTestIssueList(isPullRequest, milestone); - setProcessor(); - }); - - test(`should${ - shouldStale ? '' : ' not' - } be marked as stale`, async () => { - expect.assertions(3); - - await processor.processIssues(1); - - expect(processor.staleIssues.length).toStrictEqual( - shouldStale ? 1 : 0 - ); - expect(processor.closedIssues.length).toStrictEqual(0); - expect(processor.removedLabelIssues.length).toStrictEqual(0); - }); - } - ); - }); + test(`should${ + shouldStale ? '' : ' not' + } be marked as stale`, async () => { + expect.assertions(3); + + await processor.processIssues(1); + + expect(processor.staleIssues.length).toStrictEqual( + shouldStale ? 1 : 0 + ); + expect(processor.closedIssues.length).toStrictEqual(0); + expect(processor.removedLabelIssues.length).toStrictEqual(0); + }); + } + ); }); }); }); diff --git a/action.yml b/action.yml index 336357b92..96ff223c7 100644 --- a/action.yml +++ b/action.yml @@ -60,16 +60,12 @@ inputs: description: 'The labels that mean a pull request is exempt from being marked as stale. Separate multiple labels with commas (eg. "label1,label2").' default: '' required: false - exempt-milestones: - description: 'The milestones that mean an issue or a pull request is exempt from being marked as stale. Separate multiple milestones with commas (eg. "milestone1,milestone2").' - default: '' - required: false exempt-issue-milestones: - description: 'The milestones that mean an issue is exempt from being marked as stale. Separate multiple milestones with commas (eg. "milestone1,milestone2"). Override "exempt-milestones" option regarding only the issues.' + description: 'The milestones that mean an issue is exempt from being marked as stale. Separate multiple milestones with commas (eg. "milestone1,milestone2").' default: '' required: false exempt-pr-milestones: - description: 'The milestones that mean a pull request is exempt from being marked as stale. Separate multiple milestones with commas (eg. "milestone1,milestone2"). Override "exempt-milestones" option regarding only the pull requests.' + description: 'The milestones that mean a pull request is exempt from being marked as stale. Separate multiple milestones with commas (eg. "milestone1,milestone2").' default: '' required: false exempt-all-issue-milestones: diff --git a/dist/index.js b/dist/index.js index 6ec6a0806..c2a96a109 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1267,13 +1267,7 @@ class Milestones { _getExemptIssueMilestones() { if (this._options.exemptIssueMilestones === '') { this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptIssueMilestones)} is disabled. No specific milestone can skip the stale process for this $$type`); - if (this._options.exemptMilestones === '') { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptMilestones)} is disabled. No specific milestone can skip the stale process for this $$type`); - return []; - } - const exemptMilestones = words_to_list_1.wordsToList(this._options.exemptMilestones); - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptMilestones)} is set. ${logger_service_1.LoggerService.cyan(exemptMilestones.length)} milestone${exemptMilestones.length === 1 ? '' : 's'} can skip the stale process for this $$type`); - return exemptMilestones; + return []; } const exemptMilestones = words_to_list_1.wordsToList(this._options.exemptIssueMilestones); this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptIssueMilestones)} is set. ${logger_service_1.LoggerService.cyan(exemptMilestones.length)} milestone${exemptMilestones.length === 1 ? '' : 's'} can skip the stale process for this $$type`); @@ -1282,13 +1276,7 @@ class Milestones { _getExemptPullRequestMilestones() { if (this._options.exemptPrMilestones === '') { this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptPrMilestones)} is disabled. No specific milestone can skip the stale process for this $$type`); - if (this._options.exemptMilestones === '') { - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptMilestones)} is disabled. No specific milestone can skip the stale process for this $$type`); - return []; - } - const exemptMilestones = words_to_list_1.wordsToList(this._options.exemptMilestones); - this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptMilestones)} is set. ${logger_service_1.LoggerService.cyan(exemptMilestones.length)} milestone${exemptMilestones.length === 1 ? '' : 's'} can skip the stale process for this $$type`); - return exemptMilestones; + return []; } const exemptMilestones = words_to_list_1.wordsToList(this._options.exemptPrMilestones); this._issueLogger.info(logger_service_1.LoggerService.white('├──'), `The option ${this._issueLogger.createOptionLink(option_1.Option.ExemptPrMilestones)} is set. ${logger_service_1.LoggerService.cyan(exemptMilestones.length)} milestone${exemptMilestones.length === 1 ? '' : 's'} can skip the stale process for this $$type`); @@ -1795,7 +1783,6 @@ var Option; Option["Ascending"] = "ascending"; Option["DeleteBranch"] = "delete-branch"; Option["StartDate"] = "start-date"; - Option["ExemptMilestones"] = "exempt-milestones"; Option["ExemptIssueMilestones"] = "exempt-issue-milestones"; Option["ExemptPrMilestones"] = "exempt-pr-milestones"; Option["ExemptAllIssueMilestones"] = "exempt-all-issue-milestones"; @@ -2102,7 +2089,6 @@ function _getAndValidateArgs() { startDate: core.getInput('start-date') !== '' ? core.getInput('start-date') : undefined, - exemptMilestones: core.getInput('exempt-milestones'), exemptIssueMilestones: core.getInput('exempt-issue-milestones'), exemptPrMilestones: core.getInput('exempt-pr-milestones'), exemptAllIssueMilestones: core.getInput('exempt-all-issue-milestones') === 'true', diff --git a/src/classes/issue.spec.ts b/src/classes/issue.spec.ts index b95a1e823..03426c2b8 100644 --- a/src/classes/issue.spec.ts +++ b/src/classes/issue.spec.ts @@ -43,7 +43,6 @@ describe('Issue', (): void => { startDate: undefined, stalePrLabel: 'dummy-stale-pr-label', staleIssueLabel: 'dummy-stale-issue-label', - exemptMilestones: '', exemptIssueMilestones: '', exemptPrMilestones: '', exemptAllIssueMilestones: false, diff --git a/src/classes/milestones.spec.ts b/src/classes/milestones.spec.ts index 1f6fa58b8..9a31b7f4b 100644 --- a/src/classes/milestones.spec.ts +++ b/src/classes/milestones.spec.ts @@ -26,266 +26,200 @@ describe('Milestones', (): void => { issueInterface.pull_request = undefined; }); - describe('when the given options are not configured to exempt a milestone', (): void => { + describe('when the given options are not configured to exempt an issue milestone', (): void => { beforeEach((): void => { - optionsInterface.exemptMilestones = ''; + optionsInterface.exemptIssueMilestones = ''; }); - describe('when the given options are not configured to exempt an issue milestone', (): void => { + describe('when the given issue does not have a milestone', (): void => { beforeEach((): void => { - optionsInterface.exemptIssueMilestones = ''; + issueInterface.milestone = undefined; }); - describe('when the given issue does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given issue does have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); + describe('when the given issue does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); }); + }); + + describe('when the given options are configured to exempt an issue milestone', (): void => { + beforeEach((): void => { + optionsInterface.exemptIssueMilestones = + 'dummy-exempt-issue-milestone'; + }); - describe('when the given options are configured to exempt an issue milestone', (): void => { + describe('when the given issue does not have a milestone', (): void => { beforeEach((): void => { - optionsInterface.exemptIssueMilestones = - 'dummy-exempt-issue-milestone'; + issueInterface.milestone = undefined; }); - describe('when the given issue does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given issue does have a milestone different than the exempt issue milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); + describe('when the given issue does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; }); - describe('when the given issue does have a milestone equaling the exempt issue milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-issue-milestone' - }; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(true); - }); + expect(result).toStrictEqual(false); }); }); }); - describe('when the given options are configured to exempt a milestone', (): void => { + describe('when the given options are not configured to exempt an issue milestone', (): void => { beforeEach((): void => { - optionsInterface.exemptMilestones = 'dummy-exempt-milestone'; + optionsInterface.exemptIssueMilestones = ''; }); - describe('when the given options are not configured to exempt an issue milestone', (): void => { + describe('when the given issue does not have a milestone', (): void => { beforeEach((): void => { - optionsInterface.exemptIssueMilestones = ''; + issueInterface.milestone = undefined; }); - describe('when the given issue does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given issue does have a milestone different than the exempt milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); + describe('when the given issue does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; }); - describe('when the given issue does have a milestone equaling the exempt milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-milestone' - }; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(true); - }); + expect(result).toStrictEqual(false); }); }); + }); + + describe('when the given options are configured to exempt an issue milestone', (): void => { + beforeEach((): void => { + optionsInterface.exemptIssueMilestones = + 'dummy-exempt-issue-milestone'; + }); - describe('when the given options are configured to exempt an issue milestone', (): void => { + describe('when the given issue does not have a milestone', (): void => { beforeEach((): void => { - optionsInterface.exemptIssueMilestones = - 'dummy-exempt-issue-milestone'; + issueInterface.milestone = undefined; }); - describe('when the given issue does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given issue does have a milestone different than the exempt issue milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); + describe('when the given issue does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; }); - describe('when the given issue does have a milestone equaling the exempt issue milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-issue-milestone' - }; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(true); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given issue does have a milestone different than the exempt milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); + describe('when the given issue does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given issue does have a milestone equaling the exempt milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-milestone' - }; - }); + describe('when the given issue does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-exempt-milestone' + }; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); }); }); @@ -376,264 +310,198 @@ describe('Milestones', (): void => { issueInterface.pull_request = {}; }); - describe('when the given options are not configured to exempt a milestone', (): void => { + describe('when the given options are not configured to exempt a pull request milestone', (): void => { beforeEach((): void => { - optionsInterface.exemptMilestones = ''; + optionsInterface.exemptPrMilestones = ''; }); - describe('when the given options are not configured to exempt a pull request milestone', (): void => { + describe('when the given pull request does not have a milestone', (): void => { beforeEach((): void => { - optionsInterface.exemptPrMilestones = ''; + issueInterface.milestone = undefined; }); - describe('when the given pull request does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given pull request does have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); + describe('when the given pull request does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); }); + }); + + describe('when the given options are configured to exempt a pull request milestone', (): void => { + beforeEach((): void => { + optionsInterface.exemptPrMilestones = 'dummy-exempt-pr-milestone'; + }); - describe('when the given options are configured to exempt a pull request milestone', (): void => { + describe('when the given pull request does not have a milestone', (): void => { beforeEach((): void => { - optionsInterface.exemptPrMilestones = 'dummy-exempt-pr-milestone'; + issueInterface.milestone = undefined; }); - describe('when the given pull request does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given pull request does have a milestone different than the exempt pull request milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); + describe('when the given pull request does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; }); - describe('when the given pull request does have a milestone equaling the exempt pull request milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-pr-milestone' - }; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(true); - }); + expect(result).toStrictEqual(false); }); }); }); - describe('when the given options are configured to exempt a milestone', (): void => { + describe('when the given options are not configured to exempt a pull request milestone', (): void => { beforeEach((): void => { - optionsInterface.exemptMilestones = 'dummy-exempt-milestone'; + optionsInterface.exemptPrMilestones = ''; }); - describe('when the given options are not configured to exempt a pull request milestone', (): void => { + describe('when the given pull request does not have a milestone', (): void => { beforeEach((): void => { - optionsInterface.exemptPrMilestones = ''; + issueInterface.milestone = undefined; }); - describe('when the given pull request does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given pull request does have a milestone different than the exempt milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); + describe('when the given pull request does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; }); - describe('when the given pull request does have a milestone equaling the exempt milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-milestone' - }; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(true); - }); + expect(result).toStrictEqual(false); }); }); + }); + + describe('when the given options are configured to exempt a pull request milestone', (): void => { + beforeEach((): void => { + optionsInterface.exemptPrMilestones = 'dummy-exempt-pr-milestone'; + }); - describe('when the given options are configured to exempt a pull request milestone', (): void => { + describe('when the given pull request does not have a milestone', (): void => { beforeEach((): void => { - optionsInterface.exemptPrMilestones = 'dummy-exempt-pr-milestone'; + issueInterface.milestone = undefined; }); - describe('when the given pull request does not have a milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = undefined; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given pull request does have a milestone different than the exempt pull request milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); - - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); - - const result = milestones.shouldExemptMilestones(); - - expect(result).toStrictEqual(false); - }); + describe('when the given pull request does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; }); - describe('when the given pull request does have a milestone equaling the exempt pull request milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-pr-milestone' - }; - }); - - it('should return true', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(true); - }); + expect(result).toStrictEqual(false); }); + }); - describe('when the given pull request does have a milestone different than the exempt milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-title' - }; - }); + describe('when the given pull request does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-exempt-pr-milestone' + }; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return true', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(true); }); + }); - describe('when the given pull request does have a milestone equaling the exempt milestone', (): void => { - beforeEach((): void => { - issueInterface.milestone = { - title: 'dummy-exempt-milestone' - }; - }); + describe('when the given pull request does have a milestone', (): void => { + beforeEach((): void => { + issueInterface.milestone = { + title: 'dummy-title' + }; + }); - it('should return false', (): void => { - expect.assertions(1); - issue = new Issue(optionsInterface, issueInterface); - milestones = new Milestones(optionsInterface, issue); + it('should return false', (): void => { + expect.assertions(1); + issue = new Issue(optionsInterface, issueInterface); + milestones = new Milestones(optionsInterface, issue); - const result = milestones.shouldExemptMilestones(); + const result = milestones.shouldExemptMilestones(); - expect(result).toStrictEqual(false); - }); + expect(result).toStrictEqual(false); }); }); }); diff --git a/src/classes/milestones.ts b/src/classes/milestones.ts index 05122b68b..bc6464e4d 100644 --- a/src/classes/milestones.ts +++ b/src/classes/milestones.ts @@ -95,31 +95,7 @@ export class Milestones { )} is disabled. No specific milestone can skip the stale process for this $$type` ); - if (this._options.exemptMilestones === '') { - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptMilestones - )} is disabled. No specific milestone can skip the stale process for this $$type` - ); - - return []; - } - - const exemptMilestones: string[] = wordsToList( - this._options.exemptMilestones - ); - - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptMilestones - )} is set. ${LoggerService.cyan(exemptMilestones.length)} milestone${ - exemptMilestones.length === 1 ? '' : 's' - } can skip the stale process for this $$type` - ); - - return exemptMilestones; + return []; } const exemptMilestones: string[] = wordsToList( @@ -147,31 +123,7 @@ export class Milestones { )} is disabled. No specific milestone can skip the stale process for this $$type` ); - if (this._options.exemptMilestones === '') { - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptMilestones - )} is disabled. No specific milestone can skip the stale process for this $$type` - ); - - return []; - } - - const exemptMilestones: string[] = wordsToList( - this._options.exemptMilestones - ); - - this._issueLogger.info( - LoggerService.white('├──'), - `The option ${this._issueLogger.createOptionLink( - Option.ExemptMilestones - )} is set. ${LoggerService.cyan(exemptMilestones.length)} milestone${ - exemptMilestones.length === 1 ? '' : 's' - } can skip the stale process for this $$type` - ); - - return exemptMilestones; + return []; } const exemptMilestones: string[] = wordsToList( diff --git a/src/enums/option.ts b/src/enums/option.ts index 3f957409b..69b4c4093 100644 --- a/src/enums/option.ts +++ b/src/enums/option.ts @@ -28,7 +28,6 @@ export enum Option { Ascending = 'ascending', DeleteBranch = 'delete-branch', StartDate = 'start-date', - ExemptMilestones = 'exempt-milestones', ExemptIssueMilestones = 'exempt-issue-milestones', ExemptPrMilestones = 'exempt-pr-milestones', ExemptAllIssueMilestones = 'exempt-all-issue-milestones', diff --git a/src/interfaces/issues-processor-options.ts b/src/interfaces/issues-processor-options.ts index b44804e95..4032edd3a 100644 --- a/src/interfaces/issues-processor-options.ts +++ b/src/interfaces/issues-processor-options.ts @@ -32,7 +32,6 @@ export interface IIssuesProcessorOptions { ascending: boolean; deleteBranch: boolean; startDate: IsoOrRfcDateString | undefined; // Should be ISO 8601 or RFC 2822 - exemptMilestones: string; exemptIssueMilestones: string; exemptPrMilestones: string; exemptAllIssueMilestones: boolean; diff --git a/src/main.ts b/src/main.ts index 469bdebe4..35212c603 100644 --- a/src/main.ts +++ b/src/main.ts @@ -69,7 +69,6 @@ function _getAndValidateArgs(): IIssuesProcessorOptions { core.getInput('start-date') !== '' ? core.getInput('start-date') : undefined, - exemptMilestones: core.getInput('exempt-milestones'), exemptIssueMilestones: core.getInput('exempt-issue-milestones'), exemptPrMilestones: core.getInput('exempt-pr-milestones'), exemptAllIssueMilestones: From 1c81c38e2fc2641d73887d8221b1825af3182a1a Mon Sep 17 00:00:00 2001 From: TESTELIN Geoffrey Date: Fri, 8 Oct 2021 20:18:01 +0200 Subject: [PATCH 06/11] feat: remove the any-of-labels option BREAKING CHANGE: The option any-of-labels was removed --- README.md | 28 +- __tests__/any-of-labels.spec.ts | 1680 +++++++------------- action.yml | 8 +- dist/index.js | 19 +- src/classes/issue.spec.ts | 1 - src/classes/issues-processor.ts | 14 +- src/enums/option.ts | 3 +- src/interfaces/issues-processor-options.ts | 1 - src/main.ts | 1 - 9 files changed, 561 insertions(+), 1194 deletions(-) diff --git a/README.md b/README.md index 11fbd0a83..9191b5dae 100644 --- a/README.md +++ b/README.md @@ -50,9 +50,8 @@ Every argument is optional. | [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-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-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-issue-labels](#any-of-issue-labels) | Only issues with ANY of these labels are checked | | +| [any-of-pr-labels](#any-of-pr-labels) | Only PRs with ANY of these labels are checked | | | [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-issue-stale-when-updated](#remove-issue-stale-when-updated) | Remove stale label from issues on updates/comments | | @@ -117,7 +116,8 @@ You can fine tune which issues or pull requests should be marked as stale based - [exempt-issue-labels](#exempt-issue-labels) - [exempt-pr-labels](#exempt-pr-labels) - [only-labels](#only-labels) -- [any-of-labels](#any-of-labels) +- [any-of-issue-labels](#any-of-issue-labels) +- [any-of-pr-labels](#any-of-pr-labels) - [start-date](#start-date) - [exempt-issue-milestones](#exempt-issue-milestones) - [exempt-pr-milestones](#exempt-pr-milestones) @@ -260,7 +260,7 @@ It can be a comma separated list of labels (e.g: `answered,needs-rebase`). If unset (or an empty string), this option will not alter the stale workflow. -If you wish to only check that the issues or the pull requests contain one of these label(s), use instead [any-of-labels](#any-of-labels). +If you wish to only check that the issues or the pull requests contain one of these label(s), use instead [any-of-issue-labels](#any-of-issue-labels) and [any-of-pr-labels](#any-of-pr-labels). Default value: unset @@ -276,9 +276,9 @@ Override [only-labels](#only-labels) but only to process the pull requests that Default value: unset -#### any-of-labels +#### any-of-issue-labels -An allow-list of label(s) to only process the issues or the pull requests that contain one of these label(s). +An allow-list of label(s) to only process the issues that contain one of these label(s). It can be a comma separated list of labels (e.g: `answered,needs-rebase`). If unset (or an empty string), this option will not alter the stale workflow. @@ -287,15 +287,14 @@ If you wish to only check that the issues or the pull requests contain all these Default value: unset -#### any-of-issue-labels - -Override [any-of-labels](#any-of-labels) but only to process the issues that contain one of these label(s). +#### any-of-pr-labels -Default value: unset +An allow-list of label(s) to only process the pull requests that contain one of these label(s). +It can be a comma separated list of labels (e.g: `answered,needs-rebase`). -#### any-of-pr-labels +If unset (or an empty string), this option will not alter the stale workflow. -Override [any-of-labels](#any-of-labels) but only to process the pull requests that contain one of these label(s). +If you wish to only check that the issues or the pull requests contain all these label(s), use instead [only-labels](#only-labels). Default value: unset @@ -667,7 +666,8 @@ jobs: steps: - uses: actions/stale@v4 with: - any-of-labels: 'needs-more-info,needs-demo' + any-of-issue-labels: 'needs-more-info,needs-demo' + any-of-pr-labels: 'needs-more-info,needs-demo' # You can opt for 'only-labels' instead if your use-case requires all labels # to be present in the issue/PR ``` diff --git a/__tests__/any-of-labels.spec.ts b/__tests__/any-of-labels.spec.ts index ba3ba5015..a1f2fd7aa 100644 --- a/__tests__/any-of-labels.spec.ts +++ b/__tests__/any-of-labels.spec.ts @@ -1,1147 +1,533 @@ -import {Issue} from '../src/classes/issue'; -import {IIssue} from '../src/interfaces/issue'; -import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-options'; -import {IssuesProcessorMock} from './classes/issues-processor-mock'; -import {DefaultProcessorOptions} from './constants/default-processor-options'; -import {generateIssue} from './functions/generate-issue'; - -let issuesProcessorBuilder: IssuesProcessorBuilder; -let issuesProcessor: IssuesProcessorMock; - -describe('any-of-labels options', (): void => { - beforeEach((): void => { - issuesProcessorBuilder = new IssuesProcessorBuilder(); - }); - - test('should stale when not set even if the issue has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyAnyOfLabels() - .issuesOrPrs([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when not set even if the issue has a label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyAnyOfLabels() - .issuesOrPrs([{labels: [{name: 'label'}]}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should not stale when set and the issue has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfLabels('dummy-label') - .issuesOrPrs([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has a different label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfLabels('dummy-label') - .issuesOrPrs([ - { - labels: [ - { - name: 'label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has different labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfLabels('dummy-label') - .issuesOrPrs([ - { - labels: [ - { - name: 'label-1' - }, - { - name: 'label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the issue has the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfLabels('dummy-label') - .issuesOrPrs([ - { - labels: [ - { - name: 'dummy-label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when set and the issue has only one of the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfLabels('dummy-label-1,dummy-label-2') - .issuesOrPrs([ - { - labels: [ - { - name: 'dummy-label-1' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when set and the issue has all the same labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfLabels('dummy-label-1,dummy-label-2') - .issuesOrPrs([ - { - labels: [ - { - name: 'dummy-label-1' - }, - { - name: 'dummy-label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); -}); - -describe('any-of-issue-labels option', (): void => { - beforeEach((): void => { - issuesProcessorBuilder = new IssuesProcessorBuilder(); - }); - - describe('when the any-of-labels options is not set', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.emptyAnyOfLabels(); - }); - - test('should stale when not set even if the issue has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyAnyOfIssueLabels() - .issues([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when not set even if the issue has a label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyAnyOfIssueLabels() - .issues([{labels: [{name: 'dummy-label'}]}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should not stale when set and the issue has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label') - .issues([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has a different label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has different labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'label-1' - }, - { - name: 'label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the issue has the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'dummy-label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when set and the issue has only one of the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label-1,dummy-label-2') - .issues([ - { - labels: [ - { - name: 'dummy-label-1' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when set and the issue has all the same labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label-1,dummy-label-2') - .issues([ - { - labels: [ - { - name: 'dummy-label-1' - }, - { - name: 'dummy-label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - }); - - describe('when the any-of-labels options is set (same as any-of-issue-labels)', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.anyOfLabels('dummy-label'); - }); - - test('should not stale when not set even if the issue has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyAnyOfIssueLabels() - .issues([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when not set even if the issue has a label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyAnyOfIssueLabels() - .issues([{labels: [{name: 'label'}]}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label') - .issues([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has a different label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has different labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'label-1' - }, - { - name: 'label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the issue has the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'dummy-label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when set and the issue has only one of the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label-1,dummy-label-2') - .issues([ - { - labels: [ - { - name: 'dummy-label-1' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when set and the issue has all the same labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label-1,dummy-label-2') - .issues([ - { - labels: [ - { - name: 'dummy-label-1' - }, - { - name: 'dummy-label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - }); - - describe('when the any-of-labels options is set (different than any-of-issue-labels)', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.anyOfLabels('dummy-any-of-label'); - }); - - test('should not stale when not set even if the issue has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyAnyOfIssueLabels() - .issues([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when not set even if the issue has a label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyAnyOfIssueLabels() - .issues([{labels: [{name: 'label'}]}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label') - .issues([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has a different label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has different labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'label-1' - }, - { - name: 'label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the issue has the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'dummy-label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when set and the issue has only one of the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label-1,dummy-label-2') - .issues([ - { - labels: [ - { - name: 'dummy-label-1' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when set and the issue has all the same labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfIssueLabels('dummy-label-1,dummy-label-2') - .issues([ - { - labels: [ - { - name: 'dummy-label-1' - }, - { - name: 'dummy-label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - }); -}); - -describe('any-of-pr-labels option', (): void => { - beforeEach((): void => { - issuesProcessorBuilder = new IssuesProcessorBuilder(); - }); - - describe('when the any-of-labels options is not set', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.emptyAnyOfLabels(); - }); - - test('should stale when not set even if the pr has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyAnyOfPrLabels() - .prs([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when not set even if the pr has a label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyAnyOfPrLabels() - .prs([{labels: [{name: 'dummy-label'}]}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should not stale when set and the pr has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label') - .prs([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the pr has a different label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the pr has different labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'label-1' - }, - { - name: 'label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the pr has the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'dummy-label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when set and the pr has only one of the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label-1,dummy-label-2') - .prs([ - { - labels: [ - { - name: 'dummy-label-1' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when set and the pr has all the same labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label-1,dummy-label-2') - .prs([ - { - labels: [ - { - name: 'dummy-label-1' - }, - { - name: 'dummy-label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - }); - - describe('when the any-of-labels options is set (same as any-of-pr-labels)', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.anyOfLabels('dummy-label'); - }); - - test('should not stale when not set even if the pr has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyAnyOfPrLabels() - .prs([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when not set even if the pr has a label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyAnyOfPrLabels() - .prs([{labels: [{name: 'label'}]}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the pr has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label') - .prs([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the pr has a different label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the pr has different labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'label-1' - }, - { - name: 'label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the pr has the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'dummy-label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when set and the pr has only one of the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label-1,dummy-label-2') - .prs([ - { - labels: [ - { - name: 'dummy-label-1' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when set and the pr has all the same labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label-1,dummy-label-2') - .prs([ - { - labels: [ - { - name: 'dummy-label-1' - }, - { - name: 'dummy-label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - }); - - describe('when the any-of-labels options is set (different than any-of-pr-labels)', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.anyOfLabels('dummy-any-of-label'); - }); - - test('should not stale when not set even if the pr has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyAnyOfPrLabels() - .prs([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when not set even if the pr has a label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyAnyOfPrLabels() - .prs([{labels: [{name: 'label'}]}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the pr has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label') - .prs([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the pr has a different label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the pr has different labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'label-1' - }, - { - name: 'label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the pr has the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'dummy-label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when set and the pr has only one of the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label-1,dummy-label-2') - .prs([ - { - labels: [ - { - name: 'dummy-label-1' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when set and the pr has all the same labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .anyOfPrLabels('dummy-label-1,dummy-label-2') - .prs([ - { - labels: [ - { - name: 'dummy-label-1' - }, - { - name: 'dummy-label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - }); -}); - -class IssuesProcessorBuilder { - private _options: IIssuesProcessorOptions = { - ...DefaultProcessorOptions, - daysBeforeStale: 0 - }; - private _issues: Issue[] = []; - - anyOfLabels(labels: string): IssuesProcessorBuilder { - this._options.anyOfLabels = labels; - - return this; - } - - anyOfIssueLabels(labels: string): IssuesProcessorBuilder { - this._options.anyOfIssueLabels = labels; - - return this; - } - - anyOfPrLabels(labels: string): IssuesProcessorBuilder { - this._options.anyOfPrLabels = labels; - - return this; - } - - emptyAnyOfLabels(): IssuesProcessorBuilder { - return this.anyOfLabels(''); - } - - emptyAnyOfIssueLabels(): IssuesProcessorBuilder { - return this.anyOfIssueLabels(''); - } - - emptyAnyOfPrLabels(): IssuesProcessorBuilder { - return this.anyOfPrLabels(''); - } - - issuesOrPrs(issues: Partial[]): IssuesProcessorBuilder { - this._issues = issues.map( - (issue: Readonly>, index: Readonly): Issue => - generateIssue( - this._options, - index, - issue.title ?? 'dummy-title', - issue.updated_at ?? new Date().toDateString(), - issue.created_at ?? new Date().toDateString(), - !!issue.pull_request, - issue.labels ? issue.labels.map(label => label.name) : [] - ) - ); - - return this; - } - - issues(issues: Partial[]): IssuesProcessorBuilder { - this.issuesOrPrs( - issues.map((issue: Readonly>): Partial => { - return { - ...issue, - pull_request: null - }; - }) - ); - - return this; - } - - prs(issues: Partial[]): IssuesProcessorBuilder { - this.issuesOrPrs( - issues.map((issue: Readonly>): Partial => { - return { - ...issue, - pull_request: {key: 'value'} - }; - }) - ); - - return this; - } - - build(): IssuesProcessorMock { - return new IssuesProcessorMock( - this._options, - async p => (p === 1 ? this._issues : []), - async () => [], - async () => new Date().toDateString() - ); - } -} +import {Issue} from '../src/classes/issue'; +import {IIssue} from '../src/interfaces/issue'; +import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-options'; +import {IssuesProcessorMock} from './classes/issues-processor-mock'; +import {DefaultProcessorOptions} from './constants/default-processor-options'; +import {generateIssue} from './functions/generate-issue'; + +let issuesProcessorBuilder: IssuesProcessorBuilder; +let issuesProcessor: IssuesProcessorMock; + +describe('any-of-labels options', (): void => { + beforeEach((): void => { + issuesProcessorBuilder = new IssuesProcessorBuilder(); + }); + + test('should stale when not set even if the issue has no label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .emptyAnyOfIssueLabels() + .issuesOrPrs([{labels: []}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should stale when not set even if the issue has a label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .emptyAnyOfIssueLabels() + .issuesOrPrs([{labels: [{name: 'label'}]}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should not stale when set and the issue has no label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfIssueLabels('dummy-label') + .issuesOrPrs([{labels: []}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should not stale when set and the issue has a different label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfIssueLabels('dummy-label') + .issuesOrPrs([ + { + labels: [ + { + name: 'label' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should not stale when set and the issue has different labels', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfIssueLabels('dummy-label') + .issuesOrPrs([ + { + labels: [ + { + name: 'label-1' + }, + { + name: 'label-2' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should stale when set and the issue has the same label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfIssueLabels('dummy-label') + .issuesOrPrs([ + { + labels: [ + { + name: 'dummy-label' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should stale when set and the issue has only one of the same label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfIssueLabels('dummy-label-1,dummy-label-2') + .issuesOrPrs([ + { + labels: [ + { + name: 'dummy-label-1' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should stale when set and the issue has all the same labels', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfIssueLabels('dummy-label-1,dummy-label-2') + .issuesOrPrs([ + { + labels: [ + { + name: 'dummy-label-1' + }, + { + name: 'dummy-label-2' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); +}); + +describe('any-of-issue-labels option', (): void => { + beforeEach((): void => { + issuesProcessorBuilder = new IssuesProcessorBuilder(); + }); + + test('should stale when not set even if the issue has no label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .emptyAnyOfIssueLabels() + .issues([{labels: []}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should stale when not set even if the issue has a label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .emptyAnyOfIssueLabels() + .issues([{labels: [{name: 'dummy-label'}]}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should not stale when set and the issue has no label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfIssueLabels('dummy-label') + .issues([{labels: []}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should not stale when set and the issue has a different label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfIssueLabels('dummy-label') + .issues([ + { + labels: [ + { + name: 'label' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should not stale when set and the issue has different labels', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfIssueLabels('dummy-label') + .issues([ + { + labels: [ + { + name: 'label-1' + }, + { + name: 'label-2' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should stale when set and the issue has the same label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfIssueLabels('dummy-label') + .issues([ + { + labels: [ + { + name: 'dummy-label' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should stale when set and the issue has only one of the same label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfIssueLabels('dummy-label-1,dummy-label-2') + .issues([ + { + labels: [ + { + name: 'dummy-label-1' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should stale when set and the issue has all the same labels', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfIssueLabels('dummy-label-1,dummy-label-2') + .issues([ + { + labels: [ + { + name: 'dummy-label-1' + }, + { + name: 'dummy-label-2' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); +}); + +describe('any-of-pr-labels option', (): void => { + beforeEach((): void => { + issuesProcessorBuilder = new IssuesProcessorBuilder(); + }); + + test('should stale when not set even if the pr has no label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .emptyAnyOfPrLabels() + .prs([{labels: []}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should stale when not set even if the pr has a label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .emptyAnyOfPrLabels() + .prs([{labels: [{name: 'dummy-label'}]}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should not stale when set and the pr has no label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfPrLabels('dummy-label') + .prs([{labels: []}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should not stale when set and the pr has a different label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfPrLabels('dummy-label') + .prs([ + { + labels: [ + { + name: 'label' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should not stale when set and the pr has different labels', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfPrLabels('dummy-label') + .prs([ + { + labels: [ + { + name: 'label-1' + }, + { + name: 'label-2' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should stale when set and the pr has the same label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfPrLabels('dummy-label') + .prs([ + { + labels: [ + { + name: 'dummy-label' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should stale when set and the pr has only one of the same label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfPrLabels('dummy-label-1,dummy-label-2') + .prs([ + { + labels: [ + { + name: 'dummy-label-1' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should stale when set and the pr has all the same labels', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .anyOfPrLabels('dummy-label-1,dummy-label-2') + .prs([ + { + labels: [ + { + name: 'dummy-label-1' + }, + { + name: 'dummy-label-2' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); +}); + +class IssuesProcessorBuilder { + private _options: IIssuesProcessorOptions = { + ...DefaultProcessorOptions, + daysBeforeStale: 0 + }; + private _issues: Issue[] = []; + + anyOfIssueLabels(labels: string): IssuesProcessorBuilder { + this._options.anyOfIssueLabels = labels; + + return this; + } + + anyOfPrLabels(labels: string): IssuesProcessorBuilder { + this._options.anyOfPrLabels = labels; + + return this; + } + + emptyAnyOfIssueLabels(): IssuesProcessorBuilder { + return this.anyOfIssueLabels(''); + } + + emptyAnyOfPrLabels(): IssuesProcessorBuilder { + return this.anyOfPrLabels(''); + } + + issuesOrPrs(issues: Partial[]): IssuesProcessorBuilder { + this._issues = issues.map( + (issue: Readonly>, index: Readonly): Issue => + generateIssue( + this._options, + index, + issue.title ?? 'dummy-title', + issue.updated_at ?? new Date().toDateString(), + issue.created_at ?? new Date().toDateString(), + !!issue.pull_request, + issue.labels ? issue.labels.map(label => label.name) : [] + ) + ); + + return this; + } + + issues(issues: Partial[]): IssuesProcessorBuilder { + this.issuesOrPrs( + issues.map((issue: Readonly>): Partial => { + return { + ...issue, + pull_request: null + }; + }) + ); + + return this; + } + + prs(issues: Partial[]): IssuesProcessorBuilder { + this.issuesOrPrs( + issues.map((issue: Readonly>): Partial => { + return { + ...issue, + pull_request: {key: 'value'} + }; + }) + ); + + return this; + } + + build(): IssuesProcessorMock { + return new IssuesProcessorMock( + this._options, + async p => (p === 1 ? this._issues : []), + async () => [], + async () => new Date().toDateString() + ); + } +} diff --git a/action.yml b/action.yml index 96ff223c7..3b2290595 100644 --- a/action.yml +++ b/action.yml @@ -80,16 +80,12 @@ inputs: description: 'Only issues or pull requests with all of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels.' default: '' required: false - any-of-labels: - description: 'Only issues or pull requests with at least one of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels.' - default: '' - required: false any-of-issue-labels: - description: 'Only issues with at least one of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels. Override "any-of-labels" option regarding only the issues.' + description: 'Only issues with at least one of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels.' default: '' required: false any-of-pr-labels: - description: 'Only pull requests with at least one of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels. Override "any-of-labels" option regarding only the pull requests.' + description: 'Only pull requests with at least one of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels.' default: '' required: false only-issue-labels: diff --git a/dist/index.js b/dist/index.js index c2a96a109..7729abd8c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -482,7 +482,7 @@ class IssuesProcessor { } const anyOfLabels = words_to_list_1.wordsToList(this._getAnyOfLabels(issue)); if (anyOfLabels.length > 0) { - issueLogger.info(`The option ${issueLogger.createOptionLink(option_1.Option.AnyOfLabels)} was specified to only process the issues and pull requests with one of those labels (${logger_service_1.LoggerService.cyan(anyOfLabels.length)})`); + issueLogger.info(`The option ${issueLogger.createOptionLink(issue.isPullRequest ? option_1.Option.AnyOfPrLabels : option_1.Option.AnyOfIssueLabels)} was specified to only process the issues and pull requests with one of those labels (${logger_service_1.LoggerService.cyan(anyOfLabels.length)})`); const hasOneOfWhitelistedLabels = anyOfLabels.some((label) => { return is_labeled_1.isLabeled(issue, label); }); @@ -497,7 +497,7 @@ class IssuesProcessor { } } else { - issueLogger.info(`The option ${issueLogger.createOptionLink(option_1.Option.AnyOfLabels)} was not specified`); + issueLogger.info(`The option ${issueLogger.createOptionLink(issue.isPullRequest ? option_1.Option.AnyOfPrLabels : option_1.Option.AnyOfIssueLabels)} was not specified`); issueLogger.info(logger_service_1.LoggerService.white('└──'), `Continuing the process for this $$type`); } const milestones = new milestones_1.Milestones(this.options, issue); @@ -925,16 +925,9 @@ class IssuesProcessor { } _getAnyOfLabels(issue) { if (issue.isPullRequest) { - if (this.options.anyOfPrLabels !== '') { - return this.options.anyOfPrLabels; - } - } - else { - if (this.options.anyOfIssueLabels !== '') { - return this.options.anyOfIssueLabels; - } + return this.options.anyOfPrLabels; } - return this.options.anyOfLabels; + return this.options.anyOfIssueLabels; } _shouldRemoveStaleWhenUpdated(issue) { if (issue.isPullRequest) { @@ -1774,7 +1767,8 @@ var Option; Option["OnlyLabels"] = "only-labels"; Option["OnlyIssueLabels"] = "only-issue-labels"; Option["OnlyPrLabels"] = "only-pr-labels"; - Option["AnyOfLabels"] = "any-of-labels"; + Option["AnyOfIssueLabels"] = "any-of-issue-labels"; + Option["AnyOfPrLabels"] = "any-of-pr-labels"; Option["OperationsPerRun"] = "operations-per-run"; Option["RemoveStaleWhenUpdated"] = "remove-stale-when-updated"; Option["RemoveIssueStaleWhenUpdated"] = "remove-issue-stale-when-updated"; @@ -2076,7 +2070,6 @@ function _getAndValidateArgs() { onlyLabels: core.getInput('only-labels'), onlyIssueLabels: core.getInput('only-issue-labels'), onlyPrLabels: core.getInput('only-pr-labels'), - anyOfLabels: core.getInput('any-of-labels'), anyOfIssueLabels: core.getInput('any-of-issue-labels'), anyOfPrLabels: core.getInput('any-of-pr-labels'), operationsPerRun: parseInt(core.getInput('operations-per-run', { required: true })), diff --git a/src/classes/issue.spec.ts b/src/classes/issue.spec.ts index 03426c2b8..b89a34274 100644 --- a/src/classes/issue.spec.ts +++ b/src/classes/issue.spec.ts @@ -30,7 +30,6 @@ describe('Issue', (): void => { onlyLabels: '', onlyIssueLabels: '', onlyPrLabels: '', - anyOfLabels: '', anyOfIssueLabels: '', anyOfPrLabels: '', operationsPerRun: 0, diff --git a/src/classes/issues-processor.ts b/src/classes/issues-processor.ts index 708bafa4a..5109f026d 100644 --- a/src/classes/issues-processor.ts +++ b/src/classes/issues-processor.ts @@ -345,7 +345,7 @@ export class IssuesProcessor { if (anyOfLabels.length > 0) { issueLogger.info( `The option ${issueLogger.createOptionLink( - Option.AnyOfLabels + issue.isPullRequest ? Option.AnyOfPrLabels : Option.AnyOfIssueLabels )} was specified to only process the issues and pull requests with one of those labels (${LoggerService.cyan( anyOfLabels.length )})` @@ -377,7 +377,7 @@ export class IssuesProcessor { } else { issueLogger.info( `The option ${issueLogger.createOptionLink( - Option.AnyOfLabels + issue.isPullRequest ? Option.AnyOfPrLabels : Option.AnyOfIssueLabels )} was not specified` ); issueLogger.info( @@ -997,16 +997,10 @@ export class IssuesProcessor { private _getAnyOfLabels(issue: Issue): string { if (issue.isPullRequest) { - if (this.options.anyOfPrLabels !== '') { - return this.options.anyOfPrLabels; - } - } else { - if (this.options.anyOfIssueLabels !== '') { - return this.options.anyOfIssueLabels; - } + return this.options.anyOfPrLabels; } - return this.options.anyOfLabels; + return this.options.anyOfIssueLabels; } private _shouldRemoveStaleWhenUpdated(issue: Issue): boolean { diff --git a/src/enums/option.ts b/src/enums/option.ts index 69b4c4093..ec28e9373 100644 --- a/src/enums/option.ts +++ b/src/enums/option.ts @@ -19,7 +19,8 @@ export enum Option { OnlyLabels = 'only-labels', OnlyIssueLabels = 'only-issue-labels', OnlyPrLabels = 'only-pr-labels', - AnyOfLabels = 'any-of-labels', + AnyOfIssueLabels = 'any-of-issue-labels', + AnyOfPrLabels = 'any-of-pr-labels', OperationsPerRun = 'operations-per-run', RemoveStaleWhenUpdated = 'remove-stale-when-updated', RemoveIssueStaleWhenUpdated = 'remove-issue-stale-when-updated', diff --git a/src/interfaces/issues-processor-options.ts b/src/interfaces/issues-processor-options.ts index 4032edd3a..fdc7138d9 100644 --- a/src/interfaces/issues-processor-options.ts +++ b/src/interfaces/issues-processor-options.ts @@ -21,7 +21,6 @@ export interface IIssuesProcessorOptions { onlyLabels: string; onlyIssueLabels: string; onlyPrLabels: string; - anyOfLabels: string; anyOfIssueLabels: string; anyOfPrLabels: string; operationsPerRun: number; diff --git a/src/main.ts b/src/main.ts index 35212c603..1fb6bf39d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -47,7 +47,6 @@ function _getAndValidateArgs(): IIssuesProcessorOptions { onlyLabels: core.getInput('only-labels'), onlyIssueLabels: core.getInput('only-issue-labels'), onlyPrLabels: core.getInput('only-pr-labels'), - anyOfLabels: core.getInput('any-of-labels'), anyOfIssueLabels: core.getInput('any-of-issue-labels'), anyOfPrLabels: core.getInput('any-of-pr-labels'), operationsPerRun: parseInt( From a8c5bb1c29eeb17857599f5b26c992110f0f405c Mon Sep 17 00:00:00 2001 From: TESTELIN Geoffrey Date: Fri, 8 Oct 2021 20:26:58 +0200 Subject: [PATCH 07/11] feat: remove the only-labels option BREAKING CHANGE: The option only-labels was removed --- README.md | 34 +- __tests__/only-labels.spec.ts | 1680 +++++++------------- action.yml | 8 +- dist/index.js | 23 +- src/classes/issue.spec.ts | 1 - src/classes/issues-processor.ts | 22 +- src/enums/option.ts | 1 - src/interfaces/issues-processor-options.ts | 1 - src/main.ts | 1 - 9 files changed, 567 insertions(+), 1204 deletions(-) diff --git a/README.md b/README.md index 9191b5dae..bc5191860 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,8 @@ Every argument is optional. | [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-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-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-issue-labels](#only-issue-labels) | Only issues with ALL these labels are checked | | +| [only-pr-labels](#only-pr-labels) | Only PRs with ALL these labels are checked | | | [any-of-issue-labels](#any-of-issue-labels) | Only issues with ANY of these labels are checked | | | [any-of-pr-labels](#any-of-pr-labels) | Only PRs with ANY of these labels are checked | | | [operations-per-run](#operations-per-run) | Max number of operations per run | `30` | @@ -115,7 +114,8 @@ You can fine tune which issues or pull requests should be marked as stale based - [exempt-issue-labels](#exempt-issue-labels) - [exempt-pr-labels](#exempt-pr-labels) -- [only-labels](#only-labels) +- [only-issue-labels](#only-issue-labels) +- [only-pr-labels](#only-pr-labels) - [any-of-issue-labels](#any-of-issue-labels) - [any-of-pr-labels](#any-of-pr-labels) - [start-date](#start-date) @@ -253,26 +253,25 @@ If unset (or an empty string), this option will not alter the stale workflow. Default value: unset -#### only-labels +#### only-issue-labels -An allow-list of label(s) to only process the issues or the pull requests that contain all these label(s). +An allow-list of label(s) to only process the issues that contain all these label(s). It can be a comma separated list of labels (e.g: `answered,needs-rebase`). If unset (or an empty string), this option will not alter the stale workflow. -If you wish to only check that the issues or the pull requests contain one of these label(s), use instead [any-of-issue-labels](#any-of-issue-labels) and [any-of-pr-labels](#any-of-pr-labels). +If you wish to only check that the issues contain one of these label(s), use instead [any-of-issue-labels](#any-of-issue-labels). Default value: unset -#### only-issue-labels - -Override [only-labels](#only-labels) but only to process the issues that contain all these label(s). +#### only-pr-labels -Default value: unset +An allow-list of label(s) to only process the pull requests that contain all these label(s). +It can be a comma separated list of labels (e.g: `answered,needs-rebase`). -#### only-pr-labels +If unset (or an empty string), this option will not alter the stale workflow. -Override [only-labels](#only-labels) but only to process the pull requests that contain all these label(s). +If you wish to only check that the pull requests contain one of these label(s), use instead [any-of-pr-labels](#any-of-pr-labels). Default value: unset @@ -283,7 +282,7 @@ It can be a comma separated list of labels (e.g: `answered,needs-rebase`). If unset (or an empty string), this option will not alter the stale workflow. -If you wish to only check that the issues or the pull requests contain all these label(s), use instead [only-labels](#only-labels). +If you wish to only check that the issues or the pull requests contain all these label(s), use instead [only-issue-labels](#only-issue-labels). Default value: unset @@ -294,7 +293,7 @@ It can be a comma separated list of labels (e.g: `answered,needs-rebase`). If unset (or an empty string), this option will not alter the stale workflow. -If you wish to only check that the issues or the pull requests contain all these label(s), use instead [only-labels](#only-labels). +If you wish to only check that the issues or the pull requests contain all these label(s), use instead [only-pr-labels](#only-pr-labels). Default value: unset @@ -597,7 +596,8 @@ jobs: exempt-issue-labels: 'awaiting-approval,work-in-progress' stale-pr-label: 'no-pr-activity' exempt-pr-labels: 'awaiting-approval,work-in-progress' - only-labels: 'awaiting-feedback,awaiting-answers' + only-issue-labels: 'awaiting-feedback,awaiting-answers' + only-pr-labels: 'awaiting-feedback,awaiting-answers' ``` Configure the stale action to only stale issue/PR created after the 18th april 2020: @@ -668,7 +668,7 @@ jobs: with: any-of-issue-labels: 'needs-more-info,needs-demo' any-of-pr-labels: 'needs-more-info,needs-demo' - # You can opt for 'only-labels' instead if your use-case requires all labels + # You can opt for 'only-issue-labels' and 'only-pr-labels' instead if your use-case requires all labels # to be present in the issue/PR ``` diff --git a/__tests__/only-labels.spec.ts b/__tests__/only-labels.spec.ts index 690cb118d..45fef6e7f 100644 --- a/__tests__/only-labels.spec.ts +++ b/__tests__/only-labels.spec.ts @@ -1,1147 +1,533 @@ -import {Issue} from '../src/classes/issue'; -import {IIssue} from '../src/interfaces/issue'; -import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-options'; -import {IssuesProcessorMock} from './classes/issues-processor-mock'; -import {DefaultProcessorOptions} from './constants/default-processor-options'; -import {generateIssue} from './functions/generate-issue'; - -let issuesProcessorBuilder: IssuesProcessorBuilder; -let issuesProcessor: IssuesProcessorMock; - -describe('only-labels options', (): void => { - beforeEach((): void => { - issuesProcessorBuilder = new IssuesProcessorBuilder(); - }); - - test('should stale when not set even if the issue has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyOnlyLabels() - .issuesOrPrs([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when not set even if the issue has a label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyOnlyLabels() - .issuesOrPrs([{labels: [{name: 'label'}]}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should not stale when set and the issue has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyLabels('dummy-label') - .issuesOrPrs([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has a different label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyLabels('dummy-label') - .issuesOrPrs([ - { - labels: [ - { - name: 'label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has different labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyLabels('dummy-label') - .issuesOrPrs([ - { - labels: [ - { - name: 'label-1' - }, - { - name: 'label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the issue has the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyLabels('dummy-label') - .issuesOrPrs([ - { - labels: [ - { - name: 'dummy-label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should not stale when set and the issue has only one of the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyLabels('dummy-label-1,dummy-label-2') - .issuesOrPrs([ - { - labels: [ - { - name: 'dummy-label-1' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the issue has all the same labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyLabels('dummy-label-1,dummy-label-2') - .issuesOrPrs([ - { - labels: [ - { - name: 'dummy-label-1' - }, - { - name: 'dummy-label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); -}); - -describe('only-issue-labels option', (): void => { - beforeEach((): void => { - issuesProcessorBuilder = new IssuesProcessorBuilder(); - }); - - describe('when the only-labels options is not set', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.emptyOnlyLabels(); - }); - - test('should stale when not set even if the issue has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyOnlyIssueLabels() - .issues([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when not set even if the issue has a label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyOnlyIssueLabels() - .issues([{labels: [{name: 'dummy-label'}]}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should not stale when set and the issue has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label') - .issues([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has a different label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has different labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'label-1' - }, - { - name: 'label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the issue has the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'dummy-label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should not stale when set and the issue has only one of the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label-1,dummy-label-2') - .issues([ - { - labels: [ - { - name: 'dummy-label-1' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the issue has all the same labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label-1,dummy-label-2') - .issues([ - { - labels: [ - { - name: 'dummy-label-1' - }, - { - name: 'dummy-label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - }); - - describe('when the only-labels options is set (same as only-issue-labels)', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.onlyLabels('dummy-label'); - }); - - test('should not stale when not set even if the issue has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyOnlyIssueLabels() - .issues([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when not set even if the issue has a label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyOnlyIssueLabels() - .issues([{labels: [{name: 'label'}]}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label') - .issues([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has a different label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has different labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'label-1' - }, - { - name: 'label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the issue has the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'dummy-label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should not stale when set and the issue has only one of the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label-1,dummy-label-2') - .issues([ - { - labels: [ - { - name: 'dummy-label-1' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the issue has all the same labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label-1,dummy-label-2') - .issues([ - { - labels: [ - { - name: 'dummy-label-1' - }, - { - name: 'dummy-label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - }); - - describe('when the only-labels options is set (different than only-issue-labels)', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.onlyLabels('dummy-only-label'); - }); - - test('should not stale when not set even if the issue has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyOnlyIssueLabels() - .issues([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when not set even if the issue has a label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyOnlyIssueLabels() - .issues([{labels: [{name: 'label'}]}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label') - .issues([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has a different label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the issue has different labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'label-1' - }, - { - name: 'label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the issue has the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label') - .issues([ - { - labels: [ - { - name: 'dummy-label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should not stale when set and the issue has only one of the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label-1,dummy-label-2') - .issues([ - { - labels: [ - { - name: 'dummy-label-1' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the issue has all the same labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyIssueLabels('dummy-label-1,dummy-label-2') - .issues([ - { - labels: [ - { - name: 'dummy-label-1' - }, - { - name: 'dummy-label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - }); -}); - -describe('only-pr-labels option', (): void => { - beforeEach((): void => { - issuesProcessorBuilder = new IssuesProcessorBuilder(); - }); - - describe('when the only-labels options is not set', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.emptyOnlyLabels(); - }); - - test('should stale when not set even if the pr has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyOnlyPrLabels() - .prs([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should stale when not set even if the pr has a label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyOnlyPrLabels() - .prs([{labels: [{name: 'dummy-label'}]}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should not stale when set and the pr has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label') - .prs([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the pr has a different label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the pr has different labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'label-1' - }, - { - name: 'label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the pr has the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'dummy-label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should not stale when set and the pr has only one of the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label-1,dummy-label-2') - .prs([ - { - labels: [ - { - name: 'dummy-label-1' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the pr has all the same labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label-1,dummy-label-2') - .prs([ - { - labels: [ - { - name: 'dummy-label-1' - }, - { - name: 'dummy-label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - }); - - describe('when the only-labels options is set (same as only-pr-labels)', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.onlyLabels('dummy-label'); - }); - - test('should not stale when not set even if the pr has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyOnlyPrLabels() - .prs([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when not set even if the pr has a label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyOnlyPrLabels() - .prs([{labels: [{name: 'label'}]}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the pr has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label') - .prs([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the pr has a different label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the pr has different labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'label-1' - }, - { - name: 'label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the pr has the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'dummy-label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should not stale when set and the pr has only one of the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label-1,dummy-label-2') - .prs([ - { - labels: [ - { - name: 'dummy-label-1' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the pr has all the same labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label-1,dummy-label-2') - .prs([ - { - labels: [ - { - name: 'dummy-label-1' - }, - { - name: 'dummy-label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - }); - - describe('when the only-labels options is set (different than only-pr-labels)', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.onlyLabels('dummy-only-label'); - }); - - test('should not stale when not set even if the pr has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyOnlyPrLabels() - .prs([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when not set even if the pr has a label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .emptyOnlyPrLabels() - .prs([{labels: [{name: 'label'}]}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the pr has no label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label') - .prs([{labels: []}]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the pr has a different label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should not stale when set and the pr has different labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'label-1' - }, - { - name: 'label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the pr has the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label') - .prs([ - { - labels: [ - { - name: 'dummy-label' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - - test('should not stale when set and the pr has only one of the same label', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label-1,dummy-label-2') - .prs([ - { - labels: [ - { - name: 'dummy-label-1' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(0); - }); - - test('should stale when set and the pr has all the same labels', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder - .onlyPrLabels('dummy-label-1,dummy-label-2') - .prs([ - { - labels: [ - { - name: 'dummy-label-1' - }, - { - name: 'dummy-label-2' - } - ] - } - ]) - .build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.staleIssues).toHaveLength(1); - }); - }); -}); - -class IssuesProcessorBuilder { - private _options: IIssuesProcessorOptions = { - ...DefaultProcessorOptions, - daysBeforeStale: 0 - }; - private _issues: Issue[] = []; - - onlyLabels(labels: string): IssuesProcessorBuilder { - this._options.onlyLabels = labels; - - return this; - } - - onlyIssueLabels(labels: string): IssuesProcessorBuilder { - this._options.onlyIssueLabels = labels; - - return this; - } - - onlyPrLabels(labels: string): IssuesProcessorBuilder { - this._options.onlyPrLabels = labels; - - return this; - } - - emptyOnlyLabels(): IssuesProcessorBuilder { - return this.onlyLabels(''); - } - - emptyOnlyIssueLabels(): IssuesProcessorBuilder { - return this.onlyIssueLabels(''); - } - - emptyOnlyPrLabels(): IssuesProcessorBuilder { - return this.onlyPrLabels(''); - } - - issuesOrPrs(issues: Partial[]): IssuesProcessorBuilder { - this._issues = issues.map( - (issue: Readonly>, index: Readonly): Issue => - generateIssue( - this._options, - index, - issue.title ?? 'dummy-title', - issue.updated_at ?? new Date().toDateString(), - issue.created_at ?? new Date().toDateString(), - !!issue.pull_request, - issue.labels ? issue.labels.map(label => label.name) : [] - ) - ); - - return this; - } - - issues(issues: Partial[]): IssuesProcessorBuilder { - this.issuesOrPrs( - issues.map((issue: Readonly>): Partial => { - return { - ...issue, - pull_request: null - }; - }) - ); - - return this; - } - - prs(issues: Partial[]): IssuesProcessorBuilder { - this.issuesOrPrs( - issues.map((issue: Readonly>): Partial => { - return { - ...issue, - pull_request: {key: 'value'} - }; - }) - ); - - return this; - } - - build(): IssuesProcessorMock { - return new IssuesProcessorMock( - this._options, - async p => (p === 1 ? this._issues : []), - async () => [], - async () => new Date().toDateString() - ); - } -} +import {Issue} from '../src/classes/issue'; +import {IIssue} from '../src/interfaces/issue'; +import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-options'; +import {IssuesProcessorMock} from './classes/issues-processor-mock'; +import {DefaultProcessorOptions} from './constants/default-processor-options'; +import {generateIssue} from './functions/generate-issue'; + +let issuesProcessorBuilder: IssuesProcessorBuilder; +let issuesProcessor: IssuesProcessorMock; + +describe('only-labels options', (): void => { + beforeEach((): void => { + issuesProcessorBuilder = new IssuesProcessorBuilder(); + }); + + test('should stale when not set even if the issue has no label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .emptyOnlyIssueLabels() + .issuesOrPrs([{labels: []}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should stale when not set even if the issue has a label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .emptyOnlyIssueLabels() + .issuesOrPrs([{labels: [{name: 'label'}]}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should not stale when set and the issue has no label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyIssueLabels('dummy-label') + .issuesOrPrs([{labels: []}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should not stale when set and the issue has a different label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyIssueLabels('dummy-label') + .issuesOrPrs([ + { + labels: [ + { + name: 'label' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should not stale when set and the issue has different labels', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyIssueLabels('dummy-label') + .issuesOrPrs([ + { + labels: [ + { + name: 'label-1' + }, + { + name: 'label-2' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should stale when set and the issue has the same label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyIssueLabels('dummy-label') + .issuesOrPrs([ + { + labels: [ + { + name: 'dummy-label' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should not stale when set and the issue has only one of the same label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyIssueLabels('dummy-label-1,dummy-label-2') + .issuesOrPrs([ + { + labels: [ + { + name: 'dummy-label-1' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should stale when set and the issue has all the same labels', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyIssueLabels('dummy-label-1,dummy-label-2') + .issuesOrPrs([ + { + labels: [ + { + name: 'dummy-label-1' + }, + { + name: 'dummy-label-2' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); +}); + +describe('only-issue-labels option', (): void => { + beforeEach((): void => { + issuesProcessorBuilder = new IssuesProcessorBuilder(); + }); + + test('should stale when not set even if the issue has no label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .emptyOnlyIssueLabels() + .issues([{labels: []}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should stale when not set even if the issue has a label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .emptyOnlyIssueLabels() + .issues([{labels: [{name: 'dummy-label'}]}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should not stale when set and the issue has no label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyIssueLabels('dummy-label') + .issues([{labels: []}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should not stale when set and the issue has a different label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyIssueLabels('dummy-label') + .issues([ + { + labels: [ + { + name: 'label' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should not stale when set and the issue has different labels', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyIssueLabels('dummy-label') + .issues([ + { + labels: [ + { + name: 'label-1' + }, + { + name: 'label-2' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should stale when set and the issue has the same label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyIssueLabels('dummy-label') + .issues([ + { + labels: [ + { + name: 'dummy-label' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should not stale when set and the issue has only one of the same label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyIssueLabels('dummy-label-1,dummy-label-2') + .issues([ + { + labels: [ + { + name: 'dummy-label-1' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should stale when set and the issue has all the same labels', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyIssueLabels('dummy-label-1,dummy-label-2') + .issues([ + { + labels: [ + { + name: 'dummy-label-1' + }, + { + name: 'dummy-label-2' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); +}); + +describe('only-pr-labels option', (): void => { + beforeEach((): void => { + issuesProcessorBuilder = new IssuesProcessorBuilder(); + }); + + test('should stale when not set even if the pr has no label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .emptyOnlyPrLabels() + .prs([{labels: []}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should stale when not set even if the pr has a label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .emptyOnlyPrLabels() + .prs([{labels: [{name: 'dummy-label'}]}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should not stale when set and the pr has no label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyPrLabels('dummy-label') + .prs([{labels: []}]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should not stale when set and the pr has a different label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyPrLabels('dummy-label') + .prs([ + { + labels: [ + { + name: 'label' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should not stale when set and the pr has different labels', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyPrLabels('dummy-label') + .prs([ + { + labels: [ + { + name: 'label-1' + }, + { + name: 'label-2' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should stale when set and the pr has the same label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyPrLabels('dummy-label') + .prs([ + { + labels: [ + { + name: 'dummy-label' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); + + test('should not stale when set and the pr has only one of the same label', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyPrLabels('dummy-label-1,dummy-label-2') + .prs([ + { + labels: [ + { + name: 'dummy-label-1' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(0); + }); + + test('should stale when set and the pr has all the same labels', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder + .onlyPrLabels('dummy-label-1,dummy-label-2') + .prs([ + { + labels: [ + { + name: 'dummy-label-1' + }, + { + name: 'dummy-label-2' + } + ] + } + ]) + .build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.staleIssues).toHaveLength(1); + }); +}); + +class IssuesProcessorBuilder { + private _options: IIssuesProcessorOptions = { + ...DefaultProcessorOptions, + daysBeforeStale: 0 + }; + private _issues: Issue[] = []; + + onlyIssueLabels(labels: string): IssuesProcessorBuilder { + this._options.onlyIssueLabels = labels; + + return this; + } + + onlyPrLabels(labels: string): IssuesProcessorBuilder { + this._options.onlyPrLabels = labels; + + return this; + } + + emptyOnlyIssueLabels(): IssuesProcessorBuilder { + return this.onlyIssueLabels(''); + } + + emptyOnlyPrLabels(): IssuesProcessorBuilder { + return this.onlyPrLabels(''); + } + + issuesOrPrs(issues: Partial[]): IssuesProcessorBuilder { + this._issues = issues.map( + (issue: Readonly>, index: Readonly): Issue => + generateIssue( + this._options, + index, + issue.title ?? 'dummy-title', + issue.updated_at ?? new Date().toDateString(), + issue.created_at ?? new Date().toDateString(), + !!issue.pull_request, + issue.labels ? issue.labels.map(label => label.name) : [] + ) + ); + + return this; + } + + issues(issues: Partial[]): IssuesProcessorBuilder { + this.issuesOrPrs( + issues.map((issue: Readonly>): Partial => { + return { + ...issue, + pull_request: null + }; + }) + ); + + return this; + } + + prs(issues: Partial[]): IssuesProcessorBuilder { + this.issuesOrPrs( + issues.map((issue: Readonly>): Partial => { + return { + ...issue, + pull_request: {key: 'value'} + }; + }) + ); + + return this; + } + + build(): IssuesProcessorMock { + return new IssuesProcessorMock( + this._options, + async p => (p === 1 ? this._issues : []), + async () => [], + async () => new Date().toDateString() + ); + } +} diff --git a/action.yml b/action.yml index 3b2290595..36c2fcc6f 100644 --- a/action.yml +++ b/action.yml @@ -76,16 +76,12 @@ inputs: description: 'Exempt all pull requests with milestones from being marked as stale. Default to false.' default: 'false' required: false - only-labels: - description: 'Only issues or pull requests with all of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels.' - default: '' - required: false any-of-issue-labels: - description: 'Only issues with at least one of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels.' + description: 'Only issues with all of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels.' default: '' required: false any-of-pr-labels: - description: 'Only pull requests with at least one of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels.' + description: 'Only pull requests with all of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels.' default: '' required: false only-issue-labels: diff --git a/dist/index.js b/dist/index.js index 7729abd8c..ab00b6de6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -293,24 +293,24 @@ exports.IssuesProcessor = void 0; const core = __importStar(__nccwpck_require__(2186)); const github_1 = __nccwpck_require__(5438); const option_1 = __nccwpck_require__(5931); +const clean_label_1 = __nccwpck_require__(7752); const get_humanized_date_1 = __nccwpck_require__(965); const is_date_more_recent_than_1 = __nccwpck_require__(1473); const is_valid_date_1 = __nccwpck_require__(891); const is_boolean_1 = __nccwpck_require__(8236); const is_labeled_1 = __nccwpck_require__(6792); -const clean_label_1 = __nccwpck_require__(7752); const should_mark_when_stale_1 = __nccwpck_require__(2461); const words_to_list_1 = __nccwpck_require__(1883); +const logger_service_1 = __nccwpck_require__(1973); const assignees_1 = __nccwpck_require__(7236); -const ignore_updates_1 = __nccwpck_require__(2935); const exempt_draft_pull_request_1 = __nccwpck_require__(854); +const ignore_updates_1 = __nccwpck_require__(2935); const issue_1 = __nccwpck_require__(4783); const issue_logger_1 = __nccwpck_require__(2984); const logger_1 = __nccwpck_require__(6212); const milestones_1 = __nccwpck_require__(4601); const stale_operations_1 = __nccwpck_require__(5080); const statistics_1 = __nccwpck_require__(3334); -const logger_service_1 = __nccwpck_require__(1973); /*** * Handle processing of issues for staleness/closure. */ @@ -423,7 +423,7 @@ class IssuesProcessor { } const onlyLabels = words_to_list_1.wordsToList(this._getOnlyLabels(issue)); if (onlyLabels.length > 0) { - issueLogger.info(`The option ${issueLogger.createOptionLink(option_1.Option.OnlyLabels)} was specified to only process issues and pull requests with all those labels (${logger_service_1.LoggerService.cyan(onlyLabels.length)})`); + issueLogger.info(`The option ${issueLogger.createOptionLink(issue.isPullRequest ? option_1.Option.OnlyPrLabels : option_1.Option.OnlyIssueLabels)} was specified to only process issues and pull requests with all those labels (${logger_service_1.LoggerService.cyan(onlyLabels.length)})`); const hasAllWhitelistedLabels = onlyLabels.every((label) => { return is_labeled_1.isLabeled(issue, label); }); @@ -438,7 +438,7 @@ class IssuesProcessor { } } else { - issueLogger.info(`The option ${issueLogger.createOptionLink(option_1.Option.OnlyLabels)} was not specified`); + issueLogger.info(`The option ${issueLogger.createOptionLink(issue.isPullRequest ? option_1.Option.OnlyPrLabels : option_1.Option.OnlyIssueLabels)} was not specified`); issueLogger.info(logger_service_1.LoggerService.white('└──'), `Continuing the process for this $$type`); } issueLogger.info(`Days before $$type stale: ${logger_service_1.LoggerService.cyan(daysBeforeStale)}`); @@ -912,16 +912,9 @@ class IssuesProcessor { } _getOnlyLabels(issue) { if (issue.isPullRequest) { - if (this.options.onlyPrLabels !== '') { - return this.options.onlyPrLabels; - } - } - else { - if (this.options.onlyIssueLabels !== '') { - return this.options.onlyIssueLabels; - } + return this.options.onlyPrLabels; } - return this.options.onlyLabels; + return this.options.onlyIssueLabels; } _getAnyOfLabels(issue) { if (issue.isPullRequest) { @@ -1764,7 +1757,6 @@ var Option; Option["StalePrLabel"] = "stale-pr-label"; Option["ClosePrLabel"] = "close-pr-label"; Option["ExemptPrLabels"] = "exempt-pr-labels"; - Option["OnlyLabels"] = "only-labels"; Option["OnlyIssueLabels"] = "only-issue-labels"; Option["OnlyPrLabels"] = "only-pr-labels"; Option["AnyOfIssueLabels"] = "any-of-issue-labels"; @@ -2067,7 +2059,6 @@ function _getAndValidateArgs() { stalePrLabel: core.getInput('stale-pr-label', { required: true }), closePrLabel: core.getInput('close-pr-label'), exemptPrLabels: core.getInput('exempt-pr-labels'), - onlyLabels: core.getInput('only-labels'), onlyIssueLabels: core.getInput('only-issue-labels'), onlyPrLabels: core.getInput('only-pr-labels'), anyOfIssueLabels: core.getInput('any-of-issue-labels'), diff --git a/src/classes/issue.spec.ts b/src/classes/issue.spec.ts index b89a34274..84e1f8829 100644 --- a/src/classes/issue.spec.ts +++ b/src/classes/issue.spec.ts @@ -27,7 +27,6 @@ describe('Issue', (): void => { deleteBranch: false, exemptIssueLabels: '', exemptPrLabels: '', - onlyLabels: '', onlyIssueLabels: '', onlyPrLabels: '', anyOfIssueLabels: '', diff --git a/src/classes/issues-processor.ts b/src/classes/issues-processor.ts index 5109f026d..1a4f3e0ff 100644 --- a/src/classes/issues-processor.ts +++ b/src/classes/issues-processor.ts @@ -3,29 +3,29 @@ import {context, getOctokit} from '@actions/github'; import {GitHub} from '@actions/github/lib/utils'; import {GetResponseTypeFromEndpointMethod} from '@octokit/types'; import {Option} from '../enums/option'; +import {cleanLabel} from '../functions/clean-label'; import {getHumanizedDate} from '../functions/dates/get-humanized-date'; import {isDateMoreRecentThan} from '../functions/dates/is-date-more-recent-than'; import {isValidDate} from '../functions/dates/is-valid-date'; import {isBoolean} from '../functions/is-boolean'; import {isLabeled} from '../functions/is-labeled'; -import {cleanLabel} from '../functions/clean-label'; import {shouldMarkWhenStale} from '../functions/should-mark-when-stale'; import {wordsToList} from '../functions/words-to-list'; import {IComment} from '../interfaces/comment'; +import {IIssue} from '../interfaces/issue'; import {IIssueEvent} from '../interfaces/issue-event'; import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options'; import {IPullRequest} from '../interfaces/pull-request'; +import {LoggerService} from '../services/logger.service'; import {Assignees} from './assignees'; -import {IgnoreUpdates} from './ignore-updates'; import {ExemptDraftPullRequest} from './exempt-draft-pull-request'; +import {IgnoreUpdates} from './ignore-updates'; import {Issue} from './issue'; import {IssueLogger} from './loggers/issue-logger'; import {Logger} from './loggers/logger'; import {Milestones} from './milestones'; import {StaleOperations} from './stale-operations'; import {Statistics} from './statistics'; -import {LoggerService} from '../services/logger.service'; -import {IIssue} from '../interfaces/issue'; /*** * Handle processing of issues for staleness/closure. @@ -227,7 +227,7 @@ export class IssuesProcessor { if (onlyLabels.length > 0) { issueLogger.info( `The option ${issueLogger.createOptionLink( - Option.OnlyLabels + issue.isPullRequest ? Option.OnlyPrLabels : Option.OnlyIssueLabels )} was specified to only process issues and pull requests with all those labels (${LoggerService.cyan( onlyLabels.length )})` @@ -260,7 +260,7 @@ export class IssuesProcessor { } else { issueLogger.info( `The option ${issueLogger.createOptionLink( - Option.OnlyLabels + issue.isPullRequest ? Option.OnlyPrLabels : Option.OnlyIssueLabels )} was not specified` ); issueLogger.info( @@ -983,16 +983,10 @@ export class IssuesProcessor { private _getOnlyLabels(issue: Issue): string { if (issue.isPullRequest) { - if (this.options.onlyPrLabels !== '') { - return this.options.onlyPrLabels; - } - } else { - if (this.options.onlyIssueLabels !== '') { - return this.options.onlyIssueLabels; - } + return this.options.onlyPrLabels; } - return this.options.onlyLabels; + return this.options.onlyIssueLabels; } private _getAnyOfLabels(issue: Issue): string { diff --git a/src/enums/option.ts b/src/enums/option.ts index ec28e9373..96f5d4f75 100644 --- a/src/enums/option.ts +++ b/src/enums/option.ts @@ -16,7 +16,6 @@ export enum Option { StalePrLabel = 'stale-pr-label', ClosePrLabel = 'close-pr-label', ExemptPrLabels = 'exempt-pr-labels', - OnlyLabels = 'only-labels', OnlyIssueLabels = 'only-issue-labels', OnlyPrLabels = 'only-pr-labels', AnyOfIssueLabels = 'any-of-issue-labels', diff --git a/src/interfaces/issues-processor-options.ts b/src/interfaces/issues-processor-options.ts index fdc7138d9..2db3abb78 100644 --- a/src/interfaces/issues-processor-options.ts +++ b/src/interfaces/issues-processor-options.ts @@ -18,7 +18,6 @@ export interface IIssuesProcessorOptions { stalePrLabel: string; closePrLabel: string; exemptPrLabels: string; - onlyLabels: string; onlyIssueLabels: string; onlyPrLabels: string; anyOfIssueLabels: string; diff --git a/src/main.ts b/src/main.ts index 1fb6bf39d..c930af0b9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -44,7 +44,6 @@ function _getAndValidateArgs(): IIssuesProcessorOptions { stalePrLabel: core.getInput('stale-pr-label', {required: true}), closePrLabel: core.getInput('close-pr-label'), exemptPrLabels: core.getInput('exempt-pr-labels'), - onlyLabels: core.getInput('only-labels'), onlyIssueLabels: core.getInput('only-issue-labels'), onlyPrLabels: core.getInput('only-pr-labels'), anyOfIssueLabels: core.getInput('any-of-issue-labels'), From 6299c36a0db593f5fe9356b6606fcefdcab59dda Mon Sep 17 00:00:00 2001 From: TESTELIN Geoffrey Date: Fri, 8 Oct 2021 20:39:44 +0200 Subject: [PATCH 08/11] feat: remove the only-labels option BREAKING CHANGE: The option only-labels was removed --- .github/workflows/stale.yml | 39 +++++----- README.md | 37 +++++----- .../constants/default-processor-options.ts | 5 +- __tests__/main.spec.ts | 73 ++++++------------- action.yml | 10 +-- dist/index.js | 23 ++---- src/classes/issue.spec.ts | 1 - src/classes/issues-processor.ts | 16 +--- src/enums/option.ts | 1 - src/interfaces/issues-processor-options.ts | 5 +- src/main.ts | 12 +-- 11 files changed, 84 insertions(+), 138 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index a6f78c1dc..0ba299913 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,19 +1,20 @@ -name: 'Stale issue handler' -on: - workflow_dispatch: - schedule: - - cron: '0 0 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@main - id: stale - with: - stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days' - days-before-stale: 30 - days-before-close: 5 - exempt-issue-labels: 'blocked,must,should,keep' - - name: Print outputs - run: echo ${{ join(steps.stale.outputs.*, ',') }} +name: 'Stale issue handler' +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@main + id: stale + with: + stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days' + days-before-stale: 30 + days-before-issue-close: 5 + days-before-pr-close: 5 + exempt-issue-labels: 'blocked,must,should,keep' + - name: Print outputs + run: echo ${{ join(steps.stale.outputs.*, ',') }} diff --git a/README.md b/README.md index bc5191860..67550cf02 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,8 @@ Every argument is optional. | [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-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-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-issue-close](#days-before-issue-close) | Idle number of days before closing stale issues | `7` | +| [days-before-pr-close](#days-before-pr-close) | Idle number of days before closing stale PRs | `7` | | [stale-issue-message](#stale-issue-message) | Comment on the staled issues | | | [stale-pr-message](#stale-pr-message) | Comment on the staled PRs | | | [close-issue-message](#close-issue-message) | Comment on the staled issues while closed | | @@ -144,32 +143,29 @@ Useful to override [days-before-stale](#days-before-stale) but only for the idle Default value: unset -#### days-before-close +#### days-before-issue-close -The idle number of days before closing the stale issues or the stale pull requests (due to the stale label). -The issues or the pull requests will be closed 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 idle number of days before closing the stale issues (due to the stale label). +The issues will be closed 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. Since adding the stale label will alter the last update date, we can calculate the number of days from this date. -If set to a negative number like `-1`, the issues or the pull requests will never be closed automatically. - -The label used to stale is defined by these two options: +If set to a negative number like `-1`, the issues will never be closed automatically. -- [stale-issue-label](#stale-issue-label) -- [stale-pr-label](#stale-pr-label) +The label used to stale is defined by this option: [stale-issue-label](#stale-issue-label) Default value: `7` -#### days-before-issue-close - -Override [days-before-close](#days-before-close) but only for the idle number of days before closing the stale issues. +#### days-before-pr-close -Default value: unset +The idle number of days before closing the stale pull requests (due to the stale label). +The pull requests will be closed 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. +Since adding the stale label will alter the last update date, we can calculate the number of days from this date. -#### days-before-pr-close +If set to a negative number like `-1`, the pull requests will never be closed automatically. -Override [days-before-close](#days-before-close) but only for the idle number of days before closing the stale pull requests. +The label used to stale is defined by this option: [stale-pr-label](#stale-pr-label) -Default value: unset +Default value: `7` #### stale-issue-message @@ -527,7 +523,8 @@ jobs: with: stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.' days-before-stale: 30 - days-before-close: 5 + days-before-issue-close: 5 + days-before-pr-close: 5 ``` Configure different stale timeouts but never close a PR: @@ -548,7 +545,7 @@ jobs: stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.' close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.' days-before-stale: 30 - days-before-close: 5 + days-before-issue-close: 5 days-before-pr-close: -1 ``` diff --git a/__tests__/constants/default-processor-options.ts b/__tests__/constants/default-processor-options.ts index e202a4512..b09a1c194 100644 --- a/__tests__/constants/default-processor-options.ts +++ b/__tests__/constants/default-processor-options.ts @@ -9,9 +9,8 @@ export const DefaultProcessorOptions: IIssuesProcessorOptions = Object.freeze({ daysBeforeStale: 1, daysBeforeIssueStale: NaN, daysBeforePrStale: NaN, - daysBeforeClose: 30, - daysBeforeIssueClose: NaN, - daysBeforePrClose: NaN, + daysBeforeIssueClose: 30, + daysBeforePrClose: 30, staleIssueLabel: 'Stale', closeIssueLabel: '', exemptIssueLabels: '', diff --git a/__tests__/main.spec.ts b/__tests__/main.spec.ts index 4153432e6..cd7f7a5f7 100644 --- a/__tests__/main.spec.ts +++ b/__tests__/main.spec.ts @@ -9,7 +9,7 @@ import {generateIssue} from './functions/generate-issue'; test('processing an issue with no label will make it stale and close it, if it is old enough only if days-before-close is set to 0', async () => { const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeClose: 0 + daysBeforeIssueClose: 0 }; const TestIssueList: Issue[] = [ generateIssue(opts, 1, 'An issue with no label', '2020-01-01T17:00:00Z') @@ -33,7 +33,7 @@ test('processing an issue with no label and a start date as ECMAScript epoch in const january2000 = 946681200000; const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeClose: 0, + daysBeforeIssueClose: 0, startDate: january2000.toString() }; const TestIssueList: Issue[] = [ @@ -64,7 +64,7 @@ test('processing an issue with no label and a start date as ECMAScript epoch in const january2021 = 1609455600000; const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeClose: 0, + daysBeforeIssueClose: 0, startDate: january2021.toString() }; const TestIssueList: Issue[] = [ @@ -95,7 +95,7 @@ test('processing an issue with no label and a start date as ECMAScript epoch in const january2000 = 946681200000000; const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeClose: 0, + daysBeforeIssueClose: 0, startDate: january2000.toString() }; const TestIssueList: Issue[] = [ @@ -126,7 +126,7 @@ test('processing an issue with no label and a start date as ECMAScript epoch in const january2021 = 1609455600000; const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeClose: 0, + daysBeforeIssueClose: 0, startDate: january2021.toString() }; const TestIssueList: Issue[] = [ @@ -157,7 +157,7 @@ test('processing an issue with no label and a start date as ISO 8601 being befor const january2000 = '2000-01-01T00:00:00Z'; const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeClose: 0, + daysBeforeIssueClose: 0, startDate: january2000.toString() }; const TestIssueList: Issue[] = [ @@ -188,7 +188,7 @@ test('processing an issue with no label and a start date as ISO 8601 being after const january2021 = '2021-01-01T00:00:00Z'; const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeClose: 0, + daysBeforeIssueClose: 0, startDate: january2021.toString() }; const TestIssueList: Issue[] = [ @@ -219,7 +219,7 @@ test('processing an issue with no label and a start date as RFC 2822 being befor const january2000 = 'January 1, 2000 00:00:00'; const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeClose: 0, + daysBeforeIssueClose: 0, startDate: january2000.toString() }; const TestIssueList: Issue[] = [ @@ -250,7 +250,7 @@ test('processing an issue with no label and a start date as RFC 2822 being after const january2021 = 'January 1, 2021 00:00:00'; const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeClose: 0, + daysBeforeIssueClose: 0, startDate: january2021.toString() }; const TestIssueList: Issue[] = [ @@ -279,7 +279,6 @@ test('processing an issue with no label and a start date as RFC 2822 being after test('processing an issue with no label will make it stale and close it, if it is old enough only if days-before-close is set to > 0 and days-before-issue-close is set to 0', async () => { const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeClose: 1, daysBeforeIssueClose: 0 }; const TestIssueList: Issue[] = [ @@ -300,33 +299,10 @@ test('processing an issue with no label will make it stale and close it, if it i expect(processor.deletedBranchIssues).toHaveLength(0); }); -test('processing an issue with no label will make it stale and not close it, if it is old enough only if days-before-close is set to > 0 and days-before-issue-close is set to > 0', async () => { - const opts: IIssuesProcessorOptions = { - ...DefaultProcessorOptions, - daysBeforeClose: 1, - daysBeforeIssueClose: 1 - }; - const TestIssueList: Issue[] = [ - generateIssue(opts, 1, 'An issue with no label', '2020-01-01T17:00:00Z') - ]; - const processor = new IssuesProcessorMock( - opts, - async p => (p === 1 ? TestIssueList : []), - async () => [], - async () => new Date().toDateString() - ); - - // process our fake issue list - await processor.processIssues(1); - - expect(processor.staleIssues).toHaveLength(1); - expect(processor.closedIssues).toHaveLength(0); -}); - test('processing an issue with no label will make it stale and not close it if days-before-close is set to > 0', async () => { const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeClose: 15 + daysBeforeIssueClose: 15 }; const TestIssueList: Issue[] = [ generateIssue(opts, 1, 'An issue with no label', '2020-01-01T17:00:00Z') @@ -348,7 +324,6 @@ test('processing an issue with no label will make it stale and not close it if d test('processing an issue with no label will make it stale and not close it if days-before-close is set to -1 and days-before-issue-close is set to > 0', async () => { const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeClose: -1, daysBeforeIssueClose: 15 }; const TestIssueList: Issue[] = [ @@ -445,7 +420,7 @@ test('processing an issue with no label will make it stale but not close it', as test('processing a stale issue will close it', async () => { const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeClose: 30 + daysBeforeIssueClose: 30 }; const TestIssueList: Issue[] = [ generateIssue( @@ -535,7 +510,7 @@ test('processing a stale issue containing a slash in the label will close it', a test('processing a stale issue will close it when days-before-issue-stale override days-before-stale', async () => { const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeClose: 30, + daysBeforeIssueClose: 30, daysBeforeIssueStale: 30 }; const TestIssueList: Issue[] = [ @@ -566,7 +541,7 @@ test('processing a stale issue will close it when days-before-issue-stale overri test('processing a stale PR will close it', async () => { const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeClose: 30 + daysBeforePrClose: 30 }; const TestIssueList: Issue[] = [ generateIssue( @@ -596,7 +571,6 @@ test('processing a stale PR will close it', async () => { test('processing a stale PR will close it when days-before-pr-stale override days-before-stale', async () => { const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeClose: 30, daysBeforePrClose: 30 }; const TestIssueList: Issue[] = [ @@ -1134,7 +1108,8 @@ test('exempt issue labels will not be marked stale and will remove the existing test('stale issues should not be closed if days is set to -1', async () => { const opts = {...DefaultProcessorOptions}; - opts.daysBeforeClose = -1; + opts.daysBeforeIssueClose = -1; + opts.daysBeforePrClose = -1; const TestIssueList: Issue[] = [ generateIssue( opts, @@ -1330,7 +1305,7 @@ test('stale label containing a space should be removed if a comment was added to test('stale issues should not be closed until after the closed number of days', async () => { const opts = {...DefaultProcessorOptions}; opts.daysBeforeStale = 5; // stale after 5 days - opts.daysBeforeClose = 1; // closes after 6 days + opts.daysBeforeIssueClose = 1; // closes after 6 days const lastUpdate = new Date(); lastUpdate.setDate(lastUpdate.getDate() - 5); const TestIssueList: Issue[] = [ @@ -1361,7 +1336,7 @@ test('stale issues should not be closed until after the closed number of days', test('stale issues should be closed if the closed nubmer of days (additive) is also passed', async () => { const opts = {...DefaultProcessorOptions}; opts.daysBeforeStale = 5; // stale after 5 days - opts.daysBeforeClose = 1; // closes after 6 days + opts.daysBeforeIssueClose = 1; // closes after 6 days const lastUpdate = new Date(); lastUpdate.setDate(lastUpdate.getDate() - 7); const TestIssueList: Issue[] = [ @@ -1393,7 +1368,7 @@ test('stale issues should be closed if the closed nubmer of days (additive) is a test('stale issues should not be closed until after the closed number of days (long)', async () => { const opts = {...DefaultProcessorOptions}; opts.daysBeforeStale = 5; // stale after 5 days - opts.daysBeforeClose = 20; // closes after 25 days + opts.daysBeforeIssueClose = 20; // closes after 25 days const lastUpdate = new Date(); lastUpdate.setDate(lastUpdate.getDate() - 10); const TestIssueList: Issue[] = [ @@ -1424,7 +1399,7 @@ test('stale issues should not be closed until after the closed number of days (l test('skips stale message on issues when stale-issue-message is empty', async () => { const opts = {...DefaultProcessorOptions}; opts.daysBeforeStale = 5; // stale after 5 days - opts.daysBeforeClose = 20; // closes after 25 days + opts.daysBeforeIssueClose = 20; // closes after 25 days opts.staleIssueMessage = ''; const lastUpdate = new Date(); lastUpdate.setDate(lastUpdate.getDate() - 10); @@ -1468,7 +1443,7 @@ test('skips stale message on issues when stale-issue-message is empty', async () test('send stale message on issues when stale-issue-message is not empty', async () => { const opts = {...DefaultProcessorOptions}; opts.daysBeforeStale = 5; // stale after 5 days - opts.daysBeforeClose = 20; // closes after 25 days + opts.daysBeforeIssueClose = 20; // closes after 25 days opts.staleIssueMessage = 'dummy issue message'; const lastUpdate = new Date(); lastUpdate.setDate(lastUpdate.getDate() - 10); @@ -1512,7 +1487,7 @@ test('send stale message on issues when stale-issue-message is not empty', async test('skips stale message on prs when stale-pr-message is empty', async () => { const opts = {...DefaultProcessorOptions}; opts.daysBeforeStale = 5; // stale after 5 days - opts.daysBeforeClose = 20; // closes after 25 days + opts.daysBeforeIssueClose = 20; // closes after 25 days opts.stalePrMessage = ''; const lastUpdate = new Date(); lastUpdate.setDate(lastUpdate.getDate() - 10); @@ -1556,7 +1531,7 @@ test('skips stale message on prs when stale-pr-message is empty', async () => { test('send stale message on prs when stale-pr-message is not empty', async () => { const opts = {...DefaultProcessorOptions}; opts.daysBeforeStale = 5; // stale after 5 days - opts.daysBeforeClose = 20; // closes after 25 days + opts.daysBeforeIssueClose = 20; // closes after 25 days opts.stalePrMessage = 'dummy pr message'; const lastUpdate = new Date(); lastUpdate.setDate(lastUpdate.getDate() - 10); @@ -2106,7 +2081,7 @@ test('processing an issue stale since less than the daysBeforeStale with a stale ...DefaultProcessorOptions, staleIssueLabel: 'stale-label', daysBeforeStale: 30, - daysBeforeClose: 7, + daysBeforeIssueClose: 7, closeIssueMessage: 'close message', removeStaleWhenUpdated: false }; @@ -2147,7 +2122,7 @@ test('processing an issue stale since less than the daysBeforeStale without a st ...DefaultProcessorOptions, staleIssueLabel: 'stale-label', daysBeforeStale: 30, - daysBeforeClose: 7, + daysBeforeIssueClose: 7, closeIssueMessage: 'close message', removeStaleWhenUpdated: false }; diff --git a/action.yml b/action.yml index 36c2fcc6f..83df724ff 100644 --- a/action.yml +++ b/action.yml @@ -28,15 +28,13 @@ inputs: days-before-pr-stale: description: 'The number of days old a pull request can be before marking it stale. Set to -1 to never mark pull requests as stale automatically. Override "days-before-stale" option regarding only the pull requests.' required: false - days-before-close: - description: 'The number of days to wait to close an issue or a pull request after it being marked stale. Set to -1 to never close stale issues or pull requests.' - required: false - default: '7' days-before-issue-close: - description: 'The number of days to wait to close an issue after it being marked stale. Set to -1 to never close stale issues. Override "days-before-close" option regarding only the issues.' + description: 'The number of days to wait to close an issue after it being marked stale. Set to -1 to never close stale issues or pull requests.' + default: '7' required: false days-before-pr-close: - description: 'The number of days to wait to close a pull request after it being marked stale. Set to -1 to never close stale pull requests. Override "days-before-close" option regarding only the pull requests.' + description: 'The number of days to wait to close a pull request after it being marked stale. Set to -1 to never close stale issues or pull requests.' + default: '7' required: false stale-issue-label: description: 'The label to apply when an issue is stale.' diff --git a/dist/index.js b/dist/index.js index ab00b6de6..a0a7b5f49 100644 --- a/dist/index.js +++ b/dist/index.js @@ -669,8 +669,8 @@ class IssuesProcessor { const issueHasComments = yield this._hasCommentsSince(issue, markedStaleOn, staleMessage); issueLogger.info(`$$type has been commented on: ${logger_service_1.LoggerService.cyan(issueHasComments)}`); const daysBeforeClose = issue.isPullRequest - ? this._getDaysBeforePrClose() - : this._getDaysBeforeIssueClose(); + ? this.options.daysBeforePrClose + : this.options.daysBeforeIssueClose; issueLogger.info(`Days before $$type close: ${logger_service_1.LoggerService.cyan(daysBeforeClose)}`); const issueHasUpdate = IssuesProcessor._updatedSince(issue.updated_at, daysBeforeClose); issueLogger.info(`$$type has been updated: ${logger_service_1.LoggerService.cyan(issueHasUpdate)}`); @@ -900,16 +900,6 @@ class IssuesProcessor { ? this.options.daysBeforeStale : this.options.daysBeforePrStale; } - _getDaysBeforeIssueClose() { - return isNaN(this.options.daysBeforeIssueClose) - ? this.options.daysBeforeClose - : this.options.daysBeforeIssueClose; - } - _getDaysBeforePrClose() { - return isNaN(this.options.daysBeforePrClose) - ? this.options.daysBeforeClose - : this.options.daysBeforePrClose; - } _getOnlyLabels(issue) { if (issue.isPullRequest) { return this.options.onlyPrLabels; @@ -1748,7 +1738,6 @@ var Option; Option["DaysBeforeStale"] = "days-before-stale"; Option["DaysBeforeIssueStale"] = "days-before-issue-stale"; Option["DaysBeforePrStale"] = "days-before-pr-stale"; - Option["DaysBeforeClose"] = "days-before-close"; Option["DaysBeforeIssueClose"] = "days-before-issue-close"; Option["DaysBeforePrClose"] = "days-before-pr-close"; Option["StaleIssueLabel"] = "stale-issue-label"; @@ -2050,9 +2039,8 @@ function _getAndValidateArgs() { daysBeforeStale: parseInt(core.getInput('days-before-stale', { required: true })), daysBeforeIssueStale: parseInt(core.getInput('days-before-issue-stale')), daysBeforePrStale: parseInt(core.getInput('days-before-pr-stale')), - daysBeforeClose: parseInt(core.getInput('days-before-close', { required: true })), - daysBeforeIssueClose: parseInt(core.getInput('days-before-issue-close')), - daysBeforePrClose: parseInt(core.getInput('days-before-pr-close')), + daysBeforeIssueClose: parseInt(core.getInput('days-before-issue-close', { required: true })), + daysBeforePrClose: parseInt(core.getInput('days-before-pr-close', { required: true })), staleIssueLabel: core.getInput('stale-issue-label', { required: true }), closeIssueLabel: core.getInput('close-issue-label'), exemptIssueLabels: core.getInput('exempt-issue-labels'), @@ -2090,7 +2078,8 @@ function _getAndValidateArgs() { }; for (const numberInput of [ 'days-before-stale', - 'days-before-close', + 'days-before-issue-close', + 'days-before-pr-close', 'operations-per-run' ]) { if (isNaN(parseInt(core.getInput(numberInput)))) { diff --git a/src/classes/issue.spec.ts b/src/classes/issue.spec.ts index 84e1f8829..7aa0a6ed4 100644 --- a/src/classes/issue.spec.ts +++ b/src/classes/issue.spec.ts @@ -17,7 +17,6 @@ describe('Issue', (): void => { closeIssueMessage: '', closePrLabel: '', closePrMessage: '', - daysBeforeClose: 0, daysBeforeIssueClose: 0, daysBeforeIssueStale: 0, daysBeforePrClose: 0, diff --git a/src/classes/issues-processor.ts b/src/classes/issues-processor.ts index 1a4f3e0ff..d27965910 100644 --- a/src/classes/issues-processor.ts +++ b/src/classes/issues-processor.ts @@ -640,8 +640,8 @@ export class IssuesProcessor { ); const daysBeforeClose: number = issue.isPullRequest - ? this._getDaysBeforePrClose() - : this._getDaysBeforeIssueClose(); + ? this.options.daysBeforePrClose + : this.options.daysBeforeIssueClose; issueLogger.info( `Days before $$type close: ${LoggerService.cyan(daysBeforeClose)}` @@ -969,18 +969,6 @@ export class IssuesProcessor { : this.options.daysBeforePrStale; } - private _getDaysBeforeIssueClose(): number { - return isNaN(this.options.daysBeforeIssueClose) - ? this.options.daysBeforeClose - : this.options.daysBeforeIssueClose; - } - - private _getDaysBeforePrClose(): number { - return isNaN(this.options.daysBeforePrClose) - ? this.options.daysBeforeClose - : this.options.daysBeforePrClose; - } - private _getOnlyLabels(issue: Issue): string { if (issue.isPullRequest) { return this.options.onlyPrLabels; diff --git a/src/enums/option.ts b/src/enums/option.ts index 96f5d4f75..68d76fdff 100644 --- a/src/enums/option.ts +++ b/src/enums/option.ts @@ -7,7 +7,6 @@ export enum Option { DaysBeforeStale = 'days-before-stale', DaysBeforeIssueStale = 'days-before-issue-stale', DaysBeforePrStale = 'days-before-pr-stale', - DaysBeforeClose = 'days-before-close', DaysBeforeIssueClose = 'days-before-issue-close', DaysBeforePrClose = 'days-before-pr-close', StaleIssueLabel = 'stale-issue-label', diff --git a/src/interfaces/issues-processor-options.ts b/src/interfaces/issues-processor-options.ts index 2db3abb78..07087b4e9 100644 --- a/src/interfaces/issues-processor-options.ts +++ b/src/interfaces/issues-processor-options.ts @@ -9,9 +9,8 @@ export interface IIssuesProcessorOptions { daysBeforeStale: number; daysBeforeIssueStale: number; // Could be NaN daysBeforePrStale: number; // Could be NaN - daysBeforeClose: number; - daysBeforeIssueClose: number; // Could be NaN - daysBeforePrClose: number; // Could be NaN + daysBeforeIssueClose: number; + daysBeforePrClose: number; staleIssueLabel: string; closeIssueLabel: string; exemptIssueLabels: string; diff --git a/src/main.ts b/src/main.ts index c930af0b9..1dc766d6d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -33,11 +33,12 @@ function _getAndValidateArgs(): IIssuesProcessorOptions { ), daysBeforeIssueStale: parseInt(core.getInput('days-before-issue-stale')), daysBeforePrStale: parseInt(core.getInput('days-before-pr-stale')), - daysBeforeClose: parseInt( - core.getInput('days-before-close', {required: true}) + daysBeforeIssueClose: parseInt( + core.getInput('days-before-issue-close', {required: true}) + ), + daysBeforePrClose: parseInt( + core.getInput('days-before-pr-close', {required: true}) ), - daysBeforeIssueClose: parseInt(core.getInput('days-before-issue-close')), - daysBeforePrClose: parseInt(core.getInput('days-before-pr-close')), staleIssueLabel: core.getInput('stale-issue-label', {required: true}), closeIssueLabel: core.getInput('close-issue-label'), exemptIssueLabels: core.getInput('exempt-issue-labels'), @@ -87,7 +88,8 @@ function _getAndValidateArgs(): IIssuesProcessorOptions { for (const numberInput of [ 'days-before-stale', - 'days-before-close', + 'days-before-issue-close', + 'days-before-pr-close', 'operations-per-run' ]) { if (isNaN(parseInt(core.getInput(numberInput)))) { From bab816b473f49dee610d609c6ef03ffdba55c00d Mon Sep 17 00:00:00 2001 From: TESTELIN Geoffrey Date: Fri, 8 Oct 2021 21:06:12 +0200 Subject: [PATCH 09/11] feat: remove the days-before-stale option BREAKING CHANGE: The option days-before-stale was removed --- .github/workflows/stale.yml | 3 +- README.md | 65 ++++++++++--------- __tests__/any-of-labels.spec.ts | 3 +- .../constants/default-processor-options.ts | 5 +- __tests__/main.spec.ts | 34 +++++----- __tests__/only-labels.spec.ts | 3 +- action.yml | 10 ++- dist/index.js | 47 ++++---------- src/classes/issue.spec.ts | 1 - src/classes/issues-processor.ts | 51 +++------------ src/enums/option.ts | 1 - src/interfaces/issues-processor-options.ts | 5 +- src/main.ts | 12 ++-- 13 files changed, 92 insertions(+), 148 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 0ba299913..b7fa3923a 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -12,7 +12,8 @@ jobs: id: stale with: stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days' - days-before-stale: 30 + days-before-issue-stale: 30 + days-before-pr-stale: 30 days-before-issue-close: 5 days-before-pr-close: 5 exempt-issue-labels: 'blocked,must,should,keep' diff --git a/README.md b/README.md index 67550cf02..67da8251c 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,8 @@ Every argument is optional. | Input | Description | Default | | ------------------------------------------------------------------- | ----------------------------------------------------------------------- | --------------------- | | [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-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-issue-stale](#days-before-issue-stale) | Idle number of days before marking issues stale | `60` | +| [days-before-pr-stale](#days-before-pr-stale) | Idle number of days before marking PRs stale | `60` | | [days-before-issue-close](#days-before-issue-close) | Idle number of days before closing stale issues | `7` | | [days-before-pr-close](#days-before-pr-close) | Idle number of days before closing stale PRs | `7` | | [stale-issue-message](#stale-issue-message) | Comment on the staled issues | | @@ -89,59 +88,61 @@ Under the hood, it uses the [@actions/github](https://www.npmjs.com/package/@act Default value: `${{ github.token }}` -#### days-before-stale +#### days-before-issue-stale -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. -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-issue-updates](#ignore-issue-updates) and [ignore-pr-updates](#ignore-pr-updates) options. +The idle number of days before marking the issues as stale (by adding a label). +The issues 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 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-issue-updates](#ignore-issue-updates) option. -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 will be marked as stale automatically. In that case, you can still add the stale label manually to mark as stale. -The label used to stale is defined by these two options: - -- [stale-issue-label](#stale-issue-label) -- [stale-pr-label](#stale-pr-label) - -A comment can also be added to notify about the stale and is defined by these two options: +The label used to stale is defined by this option: [stale-pr-label](#stale-pr-label) -- [stale-issue-message](#stale-issue-message) -- [stale-pr-message](#stale-pr-message) +A comment can also be added to notify about the stale and is defined by this option: [stale-pr-message](#stale-pr-message) -You can fine tune which issues or pull requests should be marked as stale based on the milestones, the assignees, the creation date and the missing/present labels from these options: +You can fine tune which issues should be marked as stale based on the milestones, the assignees, the creation date and the missing/present labels from these options: - [exempt-issue-labels](#exempt-issue-labels) -- [exempt-pr-labels](#exempt-pr-labels) - [only-issue-labels](#only-issue-labels) -- [only-pr-labels](#only-pr-labels) - [any-of-issue-labels](#any-of-issue-labels) -- [any-of-pr-labels](#any-of-pr-labels) - [start-date](#start-date) - [exempt-issue-milestones](#exempt-issue-milestones) -- [exempt-pr-milestones](#exempt-pr-milestones) - [exempt-all-issue-milestones](#exempt-all-issue-milestones) -- [exempt-all-pr-milestones](#exempt-all-pr-milestones) - [exempt-issue-assignees](#exempt-issue-assignees) -- [exempt-pr-assignees](#exempt-pr-assignees) - [exempt-all-issue-assignees](#exempt-all-issue-assignees) -- [exempt-all-pr-assignees](#exempt-all-pr-assignees) - [ignore-issue-updates](#ignore-issue-updates) -- [ignore-pr-updates](#ignore-pr-updates) Default value: `60` -#### days-before-issue-stale +#### days-before-pr-stale -Useful to override [days-before-stale](#days-before-stale) but only for the idle number of days before marking the issues as stale. +The idle number of days before marking the pull requests as stale (by adding a label). +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 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-pr-updates](#ignore-pr-updates) option. -Default value: unset +If set to a negative number like `-1`, no pull requests will be marked as stale automatically. +In that case, you can still add the stale label manually to mark as stale. -#### days-before-pr-stale +The label used to stale is defined by this option: [stale-pr-label](#stale-pr-label) -Useful to override [days-before-stale](#days-before-stale) but only for the idle number of days before marking the pull requests as stale. +A comment can also be added to notify about the stale and is defined by this option: [stale-pr-message](#stale-pr-message) -Default value: unset +You can fine tune which pull requests should be marked as stale based on the milestones, the assignees, the creation date and the missing/present labels from these options: + +- [exempt-pr-labels](#exempt-pr-labels) +- [only-pr-labels](#only-pr-labels) +- [any-of-pr-labels](#any-of-pr-labels) +- [start-date](#start-date) +- [exempt-pr-milestones](#exempt-pr-milestones) +- [exempt-all-pr-milestones](#exempt-all-pr-milestones) +- [exempt-pr-assignees](#exempt-pr-assignees) +- [exempt-all-pr-assignees](#exempt-all-pr-assignees) +- [ignore-pr-updates](#ignore-pr-updates) + +Default value: `60` #### days-before-issue-close diff --git a/__tests__/any-of-labels.spec.ts b/__tests__/any-of-labels.spec.ts index a1f2fd7aa..413fba7dc 100644 --- a/__tests__/any-of-labels.spec.ts +++ b/__tests__/any-of-labels.spec.ts @@ -455,7 +455,8 @@ describe('any-of-pr-labels option', (): void => { class IssuesProcessorBuilder { private _options: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeStale: 0 + daysBeforeIssueStale: 0, + daysBeforePrStale: 0 }; private _issues: Issue[] = []; diff --git a/__tests__/constants/default-processor-options.ts b/__tests__/constants/default-processor-options.ts index b09a1c194..8cfc06706 100644 --- a/__tests__/constants/default-processor-options.ts +++ b/__tests__/constants/default-processor-options.ts @@ -6,9 +6,8 @@ export const DefaultProcessorOptions: IIssuesProcessorOptions = Object.freeze({ stalePrMessage: 'This PR is stale', closeIssueMessage: 'This issue is being closed', closePrMessage: 'This PR is being closed', - daysBeforeStale: 1, - daysBeforeIssueStale: NaN, - daysBeforePrStale: NaN, + daysBeforeIssueStale: 1, + daysBeforePrStale: 1, daysBeforeIssueClose: 30, daysBeforePrClose: 30, staleIssueLabel: 'Stale', diff --git a/__tests__/main.spec.ts b/__tests__/main.spec.ts index cd7f7a5f7..59f8418c4 100644 --- a/__tests__/main.spec.ts +++ b/__tests__/main.spec.ts @@ -347,7 +347,7 @@ test('processing an issue with no label will not make it stale if days-before-st const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, staleIssueMessage: '', - daysBeforeStale: -1 + daysBeforeIssueStale: -1 }; const TestIssueList: Issue[] = [ generateIssue(opts, 1, 'An issue with no label', '2020-01-01T17:00:00Z') @@ -370,7 +370,6 @@ test('processing an issue with no label will not make it stale if days-before-st const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, staleIssueMessage: '', - daysBeforeStale: -1, daysBeforeIssueStale: -1 }; const TestIssueList: Issue[] = [ @@ -1304,7 +1303,7 @@ test('stale label containing a space should be removed if a comment was added to test('stale issues should not be closed until after the closed number of days', async () => { const opts = {...DefaultProcessorOptions}; - opts.daysBeforeStale = 5; // stale after 5 days + opts.daysBeforeIssueStale = 5; // stale after 5 days opts.daysBeforeIssueClose = 1; // closes after 6 days const lastUpdate = new Date(); lastUpdate.setDate(lastUpdate.getDate() - 5); @@ -1335,7 +1334,7 @@ test('stale issues should not be closed until after the closed number of days', test('stale issues should be closed if the closed nubmer of days (additive) is also passed', async () => { const opts = {...DefaultProcessorOptions}; - opts.daysBeforeStale = 5; // stale after 5 days + opts.daysBeforeIssueStale = 5; // stale after 5 days opts.daysBeforeIssueClose = 1; // closes after 6 days const lastUpdate = new Date(); lastUpdate.setDate(lastUpdate.getDate() - 7); @@ -1367,7 +1366,7 @@ test('stale issues should be closed if the closed nubmer of days (additive) is a test('stale issues should not be closed until after the closed number of days (long)', async () => { const opts = {...DefaultProcessorOptions}; - opts.daysBeforeStale = 5; // stale after 5 days + opts.daysBeforeIssueStale = 5; // stale after 5 days opts.daysBeforeIssueClose = 20; // closes after 25 days const lastUpdate = new Date(); lastUpdate.setDate(lastUpdate.getDate() - 10); @@ -1398,7 +1397,7 @@ test('stale issues should not be closed until after the closed number of days (l test('skips stale message on issues when stale-issue-message is empty', async () => { const opts = {...DefaultProcessorOptions}; - opts.daysBeforeStale = 5; // stale after 5 days + opts.daysBeforeIssueStale = 5; // stale after 5 days opts.daysBeforeIssueClose = 20; // closes after 25 days opts.staleIssueMessage = ''; const lastUpdate = new Date(); @@ -1442,7 +1441,7 @@ test('skips stale message on issues when stale-issue-message is empty', async () test('send stale message on issues when stale-issue-message is not empty', async () => { const opts = {...DefaultProcessorOptions}; - opts.daysBeforeStale = 5; // stale after 5 days + opts.daysBeforeIssueStale = 5; // stale after 5 days opts.daysBeforeIssueClose = 20; // closes after 25 days opts.staleIssueMessage = 'dummy issue message'; const lastUpdate = new Date(); @@ -1486,7 +1485,7 @@ test('send stale message on issues when stale-issue-message is not empty', async test('skips stale message on prs when stale-pr-message is empty', async () => { const opts = {...DefaultProcessorOptions}; - opts.daysBeforeStale = 5; // stale after 5 days + opts.daysBeforeIssueStale = 5; // stale after 5 days opts.daysBeforeIssueClose = 20; // closes after 25 days opts.stalePrMessage = ''; const lastUpdate = new Date(); @@ -1530,7 +1529,7 @@ test('skips stale message on prs when stale-pr-message is empty', async () => { test('send stale message on prs when stale-pr-message is not empty', async () => { const opts = {...DefaultProcessorOptions}; - opts.daysBeforeStale = 5; // stale after 5 days + opts.daysBeforeIssueStale = 5; // stale after 5 days opts.daysBeforeIssueClose = 20; // closes after 25 days opts.stalePrMessage = 'dummy pr message'; const lastUpdate = new Date(); @@ -1797,7 +1796,6 @@ test('processing an issue opened since 2 days and with the option "daysBeforeIss expect.assertions(2); const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeStale: 10, daysBeforeIssueStale: 3 }; const issueDate = new Date(); @@ -1823,7 +1821,6 @@ test('processing an issue opened since 2 days and with the option "daysBeforeIss expect.assertions(2); const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeStale: 10, daysBeforeIssueStale: 2 }; const issueDate = new Date(); @@ -1849,7 +1846,6 @@ test('processing an issue opened since 2 days and with the option "daysBeforeIss expect.assertions(2); const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeStale: 10, daysBeforeIssueStale: 1 }; const issueDate = new Date(); @@ -1875,7 +1871,7 @@ test('processing a pull request opened since 2 days and with the option "daysBef expect.assertions(2); const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeStale: 10, + daysBeforeIssueStale: 10, daysBeforePrStale: 3 }; const issueDate = new Date(); @@ -1908,7 +1904,7 @@ test('processing a pull request opened since 2 days and with the option "daysBef expect.assertions(2); const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeStale: 10, + daysBeforeIssueStale: 10, daysBeforePrStale: 2 }; const issueDate = new Date(); @@ -1941,7 +1937,7 @@ test('processing a pull request opened since 2 days and with the option "daysBef expect.assertions(2); const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeStale: 10, + daysBeforeIssueStale: 10, daysBeforePrStale: 1 }; const issueDate = new Date(); @@ -2080,7 +2076,7 @@ test('processing an issue stale since less than the daysBeforeStale with a stale const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, staleIssueLabel: 'stale-label', - daysBeforeStale: 30, + daysBeforeIssueStale: 30, daysBeforeIssueClose: 7, closeIssueMessage: 'close message', removeStaleWhenUpdated: false @@ -2121,7 +2117,7 @@ test('processing an issue stale since less than the daysBeforeStale without a st const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, staleIssueLabel: 'stale-label', - daysBeforeStale: 30, + daysBeforeIssueStale: 30, daysBeforeIssueClose: 7, closeIssueMessage: 'close message', removeStaleWhenUpdated: false @@ -2161,7 +2157,7 @@ test('processing a pull request to be stale with the "stalePrMessage" option set const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, stalePrMessage: 'This PR is stale', - daysBeforeStale: 10, + daysBeforeIssueStale: 10, daysBeforePrStale: 1 }; const issueDate = new Date(); @@ -2196,7 +2192,7 @@ test('processing a pull request to be stale with the "stalePrMessage" option set const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, stalePrMessage: '', - daysBeforeStale: 10, + daysBeforeIssueStale: 10, daysBeforePrStale: 1 }; const issueDate = new Date(); diff --git a/__tests__/only-labels.spec.ts b/__tests__/only-labels.spec.ts index 45fef6e7f..fbdc7db61 100644 --- a/__tests__/only-labels.spec.ts +++ b/__tests__/only-labels.spec.ts @@ -455,7 +455,8 @@ describe('only-pr-labels option', (): void => { class IssuesProcessorBuilder { private _options: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeStale: 0 + daysBeforeIssueStale: 0, + daysBeforePrStale: 0 }; private _issues: Issue[] = []; diff --git a/action.yml b/action.yml index 83df724ff..430dcbc21 100644 --- a/action.yml +++ b/action.yml @@ -18,15 +18,13 @@ inputs: close-pr-message: description: 'The message to post on the pull request when closing it. If none provided, will not comment when closing a pull requests.' required: false - days-before-stale: - description: 'The number of days old an issue or a pull request can be before marking it stale. Set to -1 to never mark issues or pull requests as stale automatically.' - required: false - default: '60' days-before-issue-stale: - description: 'The number of days old an issue can be before marking it stale. Set to -1 to never mark issues as stale automatically. Override "days-before-stale" option regarding only the issues.' + description: 'The number of days old an issue can be before marking it stale. Set to -1 to never mark issues or pull requests as stale automatically.' + default: '60' required: false days-before-pr-stale: - description: 'The number of days old a pull request can be before marking it stale. Set to -1 to never mark pull requests as stale automatically. Override "days-before-stale" option regarding only the pull requests.' + description: 'The number of days old a pull request can be before marking it stale. Set to -1 to never mark issues or pull requests as stale automatically.' + default: '60' required: false days-before-issue-close: description: 'The number of days to wait to close an issue after it being marked stale. Set to -1 to never close stale issues or pull requests.' diff --git a/dist/index.js b/dist/index.js index a0a7b5f49..28b9b8f1c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -409,8 +409,8 @@ class IssuesProcessor { ? this.options.stalePrMessage.length === 0 : this.options.staleIssueMessage.length === 0; const daysBeforeStale = issue.isPullRequest - ? this._getDaysBeforePrStale() - : this._getDaysBeforeIssueStale(); + ? this.options.daysBeforePrStale + : this.options.daysBeforeIssueStale; if (issue.state === 'closed') { issueLogger.info(`Skipping this $$type because it is closed`); IssuesProcessor._endIssueProcessing(issue); @@ -542,13 +542,13 @@ class IssuesProcessor { issueLogger.info(`This $$type should be stale based on the last update date the ${get_humanized_date_1.getHumanizedDate(new Date(issue.updated_at))} (${logger_service_1.LoggerService.cyan(issue.updated_at)})`); } if (shouldMarkAsStale) { - issueLogger.info(`This $$type should be marked as stale based on the option ${issueLogger.createOptionLink(this._getDaysBeforeStaleUsedOptionName(issue))} (${logger_service_1.LoggerService.cyan(daysBeforeStale)})`); + issueLogger.info(`This $$type should be marked as stale based on the option ${issueLogger.createOptionLink(IssuesProcessor._getDaysBeforeStaleUsedOptionName(issue))} (${logger_service_1.LoggerService.cyan(daysBeforeStale)})`); yield this._markStale(issue, staleMessage, staleLabel, skipMessage); issue.isStale = true; // This issue is now considered stale issueLogger.info(`This $$type is now stale`); } else { - issueLogger.info(`This $$type should not be marked as stale based on the option ${issueLogger.createOptionLink(this._getDaysBeforeStaleUsedOptionName(issue))} (${logger_service_1.LoggerService.cyan(daysBeforeStale)})`); + issueLogger.info(`This $$type should not be marked as stale based on the option ${issueLogger.createOptionLink(IssuesProcessor._getDaysBeforeStaleUsedOptionName(issue))} (${logger_service_1.LoggerService.cyan(daysBeforeStale)})`); } } else { @@ -890,16 +890,6 @@ class IssuesProcessor { } }); } - _getDaysBeforeIssueStale() { - return isNaN(this.options.daysBeforeIssueStale) - ? this.options.daysBeforeStale - : this.options.daysBeforeIssueStale; - } - _getDaysBeforePrStale() { - return isNaN(this.options.daysBeforePrStale) - ? this.options.daysBeforeStale - : this.options.daysBeforePrStale; - } _getOnlyLabels(issue) { if (issue.isPullRequest) { return this.options.onlyPrLabels; @@ -992,24 +982,14 @@ class IssuesProcessor { } }); } - _consumeIssueOperation(issue) { - this.operations.consumeOperation(); - issue.operations.consumeOperation(); - } - _getDaysBeforeStaleUsedOptionName(issue) { + static _getDaysBeforeStaleUsedOptionName(issue) { return issue.isPullRequest - ? this._getDaysBeforePrStaleUsedOptionName() - : this._getDaysBeforeIssueStaleUsedOptionName(); - } - _getDaysBeforeIssueStaleUsedOptionName() { - return isNaN(this.options.daysBeforeIssueStale) - ? option_1.Option.DaysBeforeStale + ? option_1.Option.DaysBeforePrStale : option_1.Option.DaysBeforeIssueStale; } - _getDaysBeforePrStaleUsedOptionName() { - return isNaN(this.options.daysBeforePrStale) - ? option_1.Option.DaysBeforeStale - : option_1.Option.DaysBeforePrStale; + _consumeIssueOperation(issue) { + this.operations.consumeOperation(); + issue.operations.consumeOperation(); } _getRemoveStaleWhenUpdatedUsedOptionName(issue) { if (issue.isPullRequest) { @@ -1735,7 +1715,6 @@ var Option; Option["StalePrMessage"] = "stale-pr-message"; Option["CloseIssueMessage"] = "close-issue-message"; Option["ClosePrMessage"] = "close-pr-message"; - Option["DaysBeforeStale"] = "days-before-stale"; Option["DaysBeforeIssueStale"] = "days-before-issue-stale"; Option["DaysBeforePrStale"] = "days-before-pr-stale"; Option["DaysBeforeIssueClose"] = "days-before-issue-close"; @@ -2036,9 +2015,8 @@ function _getAndValidateArgs() { stalePrMessage: core.getInput('stale-pr-message'), closeIssueMessage: core.getInput('close-issue-message'), closePrMessage: core.getInput('close-pr-message'), - daysBeforeStale: parseInt(core.getInput('days-before-stale', { required: true })), - daysBeforeIssueStale: parseInt(core.getInput('days-before-issue-stale')), - daysBeforePrStale: parseInt(core.getInput('days-before-pr-stale')), + daysBeforeIssueStale: parseInt(core.getInput('days-before-issue-stale', { required: true })), + daysBeforePrStale: parseInt(core.getInput('days-before-pr-stale', { required: true })), daysBeforeIssueClose: parseInt(core.getInput('days-before-issue-close', { required: true })), daysBeforePrClose: parseInt(core.getInput('days-before-pr-close', { required: true })), staleIssueLabel: core.getInput('stale-issue-label', { required: true }), @@ -2077,7 +2055,8 @@ function _getAndValidateArgs() { exemptDraftPr: core.getInput('exempt-draft-pr') === 'true' }; for (const numberInput of [ - 'days-before-stale', + 'days-before-issue-stale', + 'days-before-pr-stale', 'days-before-issue-close', 'days-before-pr-close', 'operations-per-run' diff --git a/src/classes/issue.spec.ts b/src/classes/issue.spec.ts index 7aa0a6ed4..df833f220 100644 --- a/src/classes/issue.spec.ts +++ b/src/classes/issue.spec.ts @@ -21,7 +21,6 @@ describe('Issue', (): void => { daysBeforeIssueStale: 0, daysBeforePrClose: 0, daysBeforePrStale: 0, - daysBeforeStale: 0, debugOnly: false, deleteBranch: false, exemptIssueLabels: '', diff --git a/src/classes/issues-processor.ts b/src/classes/issues-processor.ts index d27965910..33d3ef56a 100644 --- a/src/classes/issues-processor.ts +++ b/src/classes/issues-processor.ts @@ -207,8 +207,8 @@ export class IssuesProcessor { ? this.options.stalePrMessage.length === 0 : this.options.staleIssueMessage.length === 0; const daysBeforeStale: number = issue.isPullRequest - ? this._getDaysBeforePrStale() - : this._getDaysBeforeIssueStale(); + ? this.options.daysBeforePrStale + : this.options.daysBeforeIssueStale; if (issue.state === 'closed') { issueLogger.info(`Skipping this $$type because it is closed`); @@ -461,7 +461,7 @@ export class IssuesProcessor { if (shouldMarkAsStale) { issueLogger.info( `This $$type should be marked as stale based on the option ${issueLogger.createOptionLink( - this._getDaysBeforeStaleUsedOptionName(issue) + IssuesProcessor._getDaysBeforeStaleUsedOptionName(issue) )} (${LoggerService.cyan(daysBeforeStale)})` ); await this._markStale(issue, staleMessage, staleLabel, skipMessage); @@ -470,7 +470,7 @@ export class IssuesProcessor { } else { issueLogger.info( `This $$type should not be marked as stale based on the option ${issueLogger.createOptionLink( - this._getDaysBeforeStaleUsedOptionName(issue) + IssuesProcessor._getDaysBeforeStaleUsedOptionName(issue) )} (${LoggerService.cyan(daysBeforeStale)})` ); } @@ -957,18 +957,6 @@ export class IssuesProcessor { } } - private _getDaysBeforeIssueStale(): number { - return isNaN(this.options.daysBeforeIssueStale) - ? this.options.daysBeforeStale - : this.options.daysBeforeIssueStale; - } - - private _getDaysBeforePrStale(): number { - return isNaN(this.options.daysBeforePrStale) - ? this.options.daysBeforeStale - : this.options.daysBeforePrStale; - } - private _getOnlyLabels(issue: Issue): string { if (issue.isPullRequest) { return this.options.onlyPrLabels; @@ -1117,36 +1105,17 @@ export class IssuesProcessor { } } - private _consumeIssueOperation(issue: Readonly): void { - this.operations.consumeOperation(); - issue.operations.consumeOperation(); - } - - private _getDaysBeforeStaleUsedOptionName( + private static _getDaysBeforeStaleUsedOptionName( issue: Readonly - ): - | Option.DaysBeforeStale - | Option.DaysBeforeIssueStale - | Option.DaysBeforePrStale { + ): Option.DaysBeforeIssueStale | Option.DaysBeforePrStale { return issue.isPullRequest - ? this._getDaysBeforePrStaleUsedOptionName() - : this._getDaysBeforeIssueStaleUsedOptionName(); - } - - private _getDaysBeforeIssueStaleUsedOptionName(): - | Option.DaysBeforeStale - | Option.DaysBeforeIssueStale { - return isNaN(this.options.daysBeforeIssueStale) - ? Option.DaysBeforeStale + ? Option.DaysBeforePrStale : Option.DaysBeforeIssueStale; } - private _getDaysBeforePrStaleUsedOptionName(): - | Option.DaysBeforeStale - | Option.DaysBeforePrStale { - return isNaN(this.options.daysBeforePrStale) - ? Option.DaysBeforeStale - : Option.DaysBeforePrStale; + private _consumeIssueOperation(issue: Readonly): void { + this.operations.consumeOperation(); + issue.operations.consumeOperation(); } private _getRemoveStaleWhenUpdatedUsedOptionName( diff --git a/src/enums/option.ts b/src/enums/option.ts index 68d76fdff..5d7d61b0a 100644 --- a/src/enums/option.ts +++ b/src/enums/option.ts @@ -4,7 +4,6 @@ export enum Option { StalePrMessage = 'stale-pr-message', CloseIssueMessage = 'close-issue-message', ClosePrMessage = 'close-pr-message', - DaysBeforeStale = 'days-before-stale', DaysBeforeIssueStale = 'days-before-issue-stale', DaysBeforePrStale = 'days-before-pr-stale', DaysBeforeIssueClose = 'days-before-issue-close', diff --git a/src/interfaces/issues-processor-options.ts b/src/interfaces/issues-processor-options.ts index 07087b4e9..21419d0a3 100644 --- a/src/interfaces/issues-processor-options.ts +++ b/src/interfaces/issues-processor-options.ts @@ -6,9 +6,8 @@ export interface IIssuesProcessorOptions { stalePrMessage: string; closeIssueMessage: string; closePrMessage: string; - daysBeforeStale: number; - daysBeforeIssueStale: number; // Could be NaN - daysBeforePrStale: number; // Could be NaN + daysBeforeIssueStale: number; + daysBeforePrStale: number; daysBeforeIssueClose: number; daysBeforePrClose: number; staleIssueLabel: string; diff --git a/src/main.ts b/src/main.ts index 1dc766d6d..46df34cc1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -28,11 +28,12 @@ function _getAndValidateArgs(): IIssuesProcessorOptions { stalePrMessage: core.getInput('stale-pr-message'), closeIssueMessage: core.getInput('close-issue-message'), closePrMessage: core.getInput('close-pr-message'), - daysBeforeStale: parseInt( - core.getInput('days-before-stale', {required: true}) + daysBeforeIssueStale: parseInt( + core.getInput('days-before-issue-stale', {required: true}) + ), + daysBeforePrStale: parseInt( + core.getInput('days-before-pr-stale', {required: true}) ), - daysBeforeIssueStale: parseInt(core.getInput('days-before-issue-stale')), - daysBeforePrStale: parseInt(core.getInput('days-before-pr-stale')), daysBeforeIssueClose: parseInt( core.getInput('days-before-issue-close', {required: true}) ), @@ -87,7 +88,8 @@ function _getAndValidateArgs(): IIssuesProcessorOptions { }; for (const numberInput of [ - 'days-before-stale', + 'days-before-issue-stale', + 'days-before-pr-stale', 'days-before-issue-close', 'days-before-pr-close', 'operations-per-run' From b9a40762bf44d8c6ba4096f570fc282deee2ed34 Mon Sep 17 00:00:00 2001 From: TESTELIN Geoffrey Date: Fri, 8 Oct 2021 21:30:39 +0200 Subject: [PATCH 10/11] feat: remove the remove-stale-when-updated option BREAKING CHANGE: The option remove-stale-when-updated was removed --- README.md | 21 +- .../constants/default-processor-options.ts | 5 +- __tests__/main.spec.ts | 88 +- __tests__/remove-stale-when-updated.spec.ts | 818 ++++++------------ action.yml | 12 +- dist/index.js | 75 +- src/classes/issue.spec.ts | 5 +- src/classes/issues-processor.ts | 48 +- src/enums/option.ts | 1 - src/interfaces/issues-processor-options.ts | 5 +- src/main.ts | 36 +- 11 files changed, 361 insertions(+), 753 deletions(-) diff --git a/README.md b/README.md index 67da8251c..ef500f5d1 100644 --- a/README.md +++ b/README.md @@ -50,9 +50,8 @@ Every argument is optional. | [any-of-issue-labels](#any-of-issue-labels) | Only issues with ANY of these labels are checked | | | [any-of-pr-labels](#any-of-pr-labels) | Only PRs with ANY of these labels are checked | | | [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-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-issue-stale-when-updated](#remove-issue-stale-when-updated) | Remove stale label from issues on updates/comments | `true` | +| [remove-pr-stale-when-updated](#remove-pr-stale-when-updated) | Remove stale label from PRs on updates/comments | `true` | | [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 | | | [debug-only](#debug-only) | Dry-run | `false` | @@ -315,25 +314,19 @@ Only the [actor](#repo-token) and the batch of issues (100 per batch) will consu Default value: `30` -#### remove-stale-when-updated - -Automatically remove the stale label when the issues or the pull requests are updated (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`) or commented. - -Default value: `true` -Required Permission: `issues: write` and `pull-requests: write` - #### remove-issue-stale-when-updated -Override [remove-stale-when-updated](#remove-stale-when-updated) but only to automatically remove the stale label when the issues are updated (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`) or commented. +Automatically remove the stale label when the issues are updated (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`) or commented. -Default value: unset +Default value: `true` Required Permission: `issues: write` #### remove-pr-stale-when-updated -Override [remove-stale-when-updated](#remove-stale-when-updated) but only to automatically remove the stale label when the pull requests are updated (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`) or commented. +Automatically remove the stale label when the pull requests are updated (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`) or commented. -Default value: unset +Default value: `true` +Required Permission: `pull-requests: write` #### labels-to-add-when-unstale diff --git a/__tests__/constants/default-processor-options.ts b/__tests__/constants/default-processor-options.ts index 8cfc06706..3286bd4e3 100644 --- a/__tests__/constants/default-processor-options.ts +++ b/__tests__/constants/default-processor-options.ts @@ -24,9 +24,8 @@ export const DefaultProcessorOptions: IIssuesProcessorOptions = Object.freeze({ anyOfPrLabels: '', operationsPerRun: 100, debugOnly: true, - removeStaleWhenUpdated: false, - removeIssueStaleWhenUpdated: undefined, - removePrStaleWhenUpdated: undefined, + removeIssueStaleWhenUpdated: false, + removePrStaleWhenUpdated: false, ascending: false, deleteBranch: false, startDate: '', diff --git a/__tests__/main.spec.ts b/__tests__/main.spec.ts index 59f8418c4..9cec6b51e 100644 --- a/__tests__/main.spec.ts +++ b/__tests__/main.spec.ts @@ -598,9 +598,10 @@ test('processing a stale PR will close it when days-before-pr-stale override day }); test('processing a stale issue will close it even if configured not to mark as stale', async () => { - const opts = { + const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeStale: -1, + daysBeforeIssueStale: -1, + daysBeforePrStale: -1, staleIssueMessage: '' }; const TestIssueList: Issue[] = [ @@ -629,10 +630,10 @@ test('processing a stale issue will close it even if configured not to mark as s }); test('processing a stale issue will close it even if configured not to mark as stale when days-before-issue-stale override days-before-stale', async () => { - const opts = { + const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeStale: 0, daysBeforeIssueStale: -1, + daysBeforePrStale: 0, staleIssueMessage: '' }; const TestIssueList: Issue[] = [ @@ -661,9 +662,10 @@ test('processing a stale issue will close it even if configured not to mark as s }); test('processing a stale PR will close it even if configured not to mark as stale', async () => { - const opts = { + const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeStale: -1, + daysBeforeIssueStale: -1, + daysBeforePrStale: -1, stalePrMessage: '' }; const TestIssueList: Issue[] = [ @@ -692,9 +694,9 @@ test('processing a stale PR will close it even if configured not to mark as stal }); test('processing a stale PR will close it even if configured not to mark as stale when days-before-pr-stale override days-before-stale', async () => { - const opts = { + const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - daysBeforeStale: 0, + daysBeforeIssueStale: 0, daysBeforePrStale: -1, stalePrMessage: '' }; @@ -938,7 +940,7 @@ test('stale locked prs will not be closed', async () => { test('exempt issue labels will not be marked stale', async () => { expect.assertions(3); - const opts = {...DefaultProcessorOptions}; + const opts: IIssuesProcessorOptions = {...DefaultProcessorOptions}; opts.exemptIssueLabels = 'Exempt'; const TestIssueList: Issue[] = [ generateIssue( @@ -967,7 +969,7 @@ test('exempt issue labels will not be marked stale', async () => { }); test('exempt issue labels will not be marked stale (multi issue label with spaces)', async () => { - const opts = {...DefaultProcessorOptions}; + const opts: IIssuesProcessorOptions = {...DefaultProcessorOptions}; opts.exemptIssueLabels = 'Exempt, Cool, None'; const TestIssueList: Issue[] = [ generateIssue( @@ -995,7 +997,7 @@ test('exempt issue labels will not be marked stale (multi issue label with space }); test('exempt issue labels will not be marked stale (multi issue label)', async () => { - const opts = {...DefaultProcessorOptions}; + const opts: IIssuesProcessorOptions = {...DefaultProcessorOptions}; opts.exemptIssueLabels = 'Exempt,Cool,None'; const TestIssueList: Issue[] = [ generateIssue( @@ -1024,7 +1026,7 @@ test('exempt issue labels will not be marked stale (multi issue label)', async ( }); test('exempt pr labels will not be marked stale', async () => { - const opts = {...DefaultProcessorOptions}; + const opts: IIssuesProcessorOptions = {...DefaultProcessorOptions}; opts.exemptIssueLabels = 'Cool'; const TestIssueList: Issue[] = [ generateIssue( @@ -1069,7 +1071,7 @@ test('exempt pr labels will not be marked stale', async () => { test('exempt issue labels will not be marked stale and will remove the existing stale label', async () => { expect.assertions(3); - const opts = {...DefaultProcessorOptions}; + const opts: IIssuesProcessorOptions = {...DefaultProcessorOptions}; opts.exemptIssueLabels = 'Exempt'; const TestIssueList: Issue[] = [ generateIssue( @@ -1106,7 +1108,7 @@ test('exempt issue labels will not be marked stale and will remove the existing }); test('stale issues should not be closed if days is set to -1', async () => { - const opts = {...DefaultProcessorOptions}; + const opts: IIssuesProcessorOptions = {...DefaultProcessorOptions}; opts.daysBeforeIssueClose = -1; opts.daysBeforePrClose = -1; const TestIssueList: Issue[] = [ @@ -1153,7 +1155,11 @@ test('stale issues should not be closed if days is set to -1', async () => { }); test('stale label should be removed if a comment was added to a stale issue', async () => { - const opts = {...DefaultProcessorOptions, removeStaleWhenUpdated: true}; + const opts: IIssuesProcessorOptions = { + ...DefaultProcessorOptions, + removeIssueStaleWhenUpdated: true, + removePrStaleWhenUpdated: true + }; const TestIssueList: Issue[] = [ generateIssue( opts, @@ -1190,9 +1196,10 @@ test('stale label should be removed if a comment was added to a stale issue', as test('when the option "labelsToAddWhenUnstale" is set, the labels should be added when unstale', async () => { expect.assertions(4); - const opts = { + const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - removeStaleWhenUpdated: true, + removeIssueStaleWhenUpdated: true, + removePrStaleWhenUpdated: true, labelsToAddWhenUnstale: 'test' }; const TestIssueList: Issue[] = [ @@ -1233,7 +1240,11 @@ test('when the option "labelsToAddWhenUnstale" is set, the labels should be adde }); test('stale label should not be removed if a comment was added by the bot (and the issue should be closed)', async () => { - const opts = {...DefaultProcessorOptions, removeStaleWhenUpdated: true}; + const opts: IIssuesProcessorOptions = { + ...DefaultProcessorOptions, + removeIssueStaleWhenUpdated: true, + removePrStaleWhenUpdated: true + }; github.context.actor = 'abot'; const TestIssueList: Issue[] = [ generateIssue( @@ -1272,7 +1283,8 @@ test('stale label should not be removed if a comment was added by the bot (and t test('stale label containing a space should be removed if a comment was added to a stale issue', async () => { const opts: IIssuesProcessorOptions = { ...DefaultProcessorOptions, - removeStaleWhenUpdated: true, + removeIssueStaleWhenUpdated: true, + removePrStaleWhenUpdated: true, staleIssueLabel: 'stat: stale' }; const TestIssueList: Issue[] = [ @@ -1302,7 +1314,7 @@ test('stale label containing a space should be removed if a comment was added to }); test('stale issues should not be closed until after the closed number of days', async () => { - const opts = {...DefaultProcessorOptions}; + const opts: IIssuesProcessorOptions = {...DefaultProcessorOptions}; opts.daysBeforeIssueStale = 5; // stale after 5 days opts.daysBeforeIssueClose = 1; // closes after 6 days const lastUpdate = new Date(); @@ -1333,7 +1345,7 @@ test('stale issues should not be closed until after the closed number of days', }); test('stale issues should be closed if the closed nubmer of days (additive) is also passed', async () => { - const opts = {...DefaultProcessorOptions}; + const opts: IIssuesProcessorOptions = {...DefaultProcessorOptions}; opts.daysBeforeIssueStale = 5; // stale after 5 days opts.daysBeforeIssueClose = 1; // closes after 6 days const lastUpdate = new Date(); @@ -1365,7 +1377,7 @@ test('stale issues should be closed if the closed nubmer of days (additive) is a }); test('stale issues should not be closed until after the closed number of days (long)', async () => { - const opts = {...DefaultProcessorOptions}; + const opts: IIssuesProcessorOptions = {...DefaultProcessorOptions}; opts.daysBeforeIssueStale = 5; // stale after 5 days opts.daysBeforeIssueClose = 20; // closes after 25 days const lastUpdate = new Date(); @@ -1396,7 +1408,7 @@ test('stale issues should not be closed until after the closed number of days (l }); test('skips stale message on issues when stale-issue-message is empty', async () => { - const opts = {...DefaultProcessorOptions}; + const opts: IIssuesProcessorOptions = {...DefaultProcessorOptions}; opts.daysBeforeIssueStale = 5; // stale after 5 days opts.daysBeforeIssueClose = 20; // closes after 25 days opts.staleIssueMessage = ''; @@ -1440,7 +1452,7 @@ test('skips stale message on issues when stale-issue-message is empty', async () }); test('send stale message on issues when stale-issue-message is not empty', async () => { - const opts = {...DefaultProcessorOptions}; + const opts: IIssuesProcessorOptions = {...DefaultProcessorOptions}; opts.daysBeforeIssueStale = 5; // stale after 5 days opts.daysBeforeIssueClose = 20; // closes after 25 days opts.staleIssueMessage = 'dummy issue message'; @@ -1484,7 +1496,7 @@ test('send stale message on issues when stale-issue-message is not empty', async }); test('skips stale message on prs when stale-pr-message is empty', async () => { - const opts = {...DefaultProcessorOptions}; + const opts: IIssuesProcessorOptions = {...DefaultProcessorOptions}; opts.daysBeforeIssueStale = 5; // stale after 5 days opts.daysBeforeIssueClose = 20; // closes after 25 days opts.stalePrMessage = ''; @@ -1528,7 +1540,7 @@ test('skips stale message on prs when stale-pr-message is empty', async () => { }); test('send stale message on prs when stale-pr-message is not empty', async () => { - const opts = {...DefaultProcessorOptions}; + const opts: IIssuesProcessorOptions = {...DefaultProcessorOptions}; opts.daysBeforeIssueStale = 5; // stale after 5 days opts.daysBeforeIssueClose = 20; // closes after 25 days opts.stalePrMessage = 'dummy pr message'; @@ -1572,7 +1584,10 @@ test('send stale message on prs when stale-pr-message is not empty', async () => }); test('git branch is deleted when option is enabled', async () => { - const opts = {...DefaultProcessorOptions, deleteBranch: true}; + const opts: IIssuesProcessorOptions = { + ...DefaultProcessorOptions, + deleteBranch: true + }; const isPullRequest = true; const TestIssueList: Issue[] = [ generateIssue( @@ -1601,7 +1616,10 @@ test('git branch is deleted when option is enabled', async () => { }); test('git branch is not deleted when issue is not pull request', async () => { - const opts = {...DefaultProcessorOptions, deleteBranch: true}; + const opts: IIssuesProcessorOptions = { + ...DefaultProcessorOptions, + deleteBranch: true + }; const isPullRequest = false; const TestIssueList: Issue[] = [ generateIssue( @@ -1662,7 +1680,7 @@ test('an issue without a milestone will be marked as stale', async () => { test('an issue without an exempted milestone will be marked as stale', async () => { expect.assertions(3); - const opts = {...DefaultProcessorOptions}; + const opts: IIssuesProcessorOptions = {...DefaultProcessorOptions}; opts.exemptIssueMilestones = 'Milestone1'; const TestIssueList: Issue[] = [ generateIssue( @@ -1695,7 +1713,7 @@ test('an issue without an exempted milestone will be marked as stale', async () test('an issue with an exempted milestone will not be marked as stale', async () => { expect.assertions(3); - const opts = {...DefaultProcessorOptions}; + const opts: IIssuesProcessorOptions = {...DefaultProcessorOptions}; opts.exemptIssueMilestones = 'Milestone1'; const TestIssueList: Issue[] = [ generateIssue( @@ -1728,7 +1746,7 @@ test('an issue with an exempted milestone will not be marked as stale', async () test('an issue with an exempted milestone will not be marked as stale (multi milestones with spaces)', async () => { expect.assertions(3); - const opts = {...DefaultProcessorOptions}; + const opts: IIssuesProcessorOptions = {...DefaultProcessorOptions}; opts.exemptIssueMilestones = 'Milestone1, Milestone2'; const TestIssueList: Issue[] = [ generateIssue( @@ -1761,7 +1779,7 @@ test('an issue with an exempted milestone will not be marked as stale (multi mil test('an issue with an exempted milestone will not be marked as stale (multi milestones without spaces)', async () => { expect.assertions(3); - const opts = {...DefaultProcessorOptions}; + const opts: IIssuesProcessorOptions = {...DefaultProcessorOptions}; opts.exemptIssueMilestones = 'Milestone1,Milestone2'; const TestIssueList: Issue[] = [ generateIssue( @@ -2079,7 +2097,8 @@ test('processing an issue stale since less than the daysBeforeStale with a stale daysBeforeIssueStale: 30, daysBeforeIssueClose: 7, closeIssueMessage: 'close message', - removeStaleWhenUpdated: false + removeIssueStaleWhenUpdated: false, + removePrStaleWhenUpdated: false }; const now: Date = new Date(); const updatedAt: Date = new Date(now.setDate(now.getDate() - 9)); @@ -2120,7 +2139,8 @@ test('processing an issue stale since less than the daysBeforeStale without a st daysBeforeIssueStale: 30, daysBeforeIssueClose: 7, closeIssueMessage: 'close message', - removeStaleWhenUpdated: false + removeIssueStaleWhenUpdated: false, + removePrStaleWhenUpdated: false }; const now: Date = new Date(); const updatedAt: Date = new Date(now.setDate(now.getDate() - 9)); diff --git a/__tests__/remove-stale-when-updated.spec.ts b/__tests__/remove-stale-when-updated.spec.ts index 79ff5e629..c74992d1a 100644 --- a/__tests__/remove-stale-when-updated.spec.ts +++ b/__tests__/remove-stale-when-updated.spec.ts @@ -1,555 +1,263 @@ -import {Issue} from '../src/classes/issue'; -import {IIssue} from '../src/interfaces/issue'; -import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-options'; -import {ILabel} from '../src/interfaces/label'; -import {IssuesProcessorMock} from './classes/issues-processor-mock'; -import {DefaultProcessorOptions} from './constants/default-processor-options'; -import {generateIssue} from './functions/generate-issue'; - -let issuesProcessorBuilder: IssuesProcessorBuilder; -let issuesProcessor: IssuesProcessorMock; - -/** - * @description - * Assuming there is a comment on the issue - */ -describe('remove-stale-when-updated option', (): void => { - beforeEach((): void => { - issuesProcessorBuilder = new IssuesProcessorBuilder(); - }); - - describe('when the option "remove-stale-when-updated" is disabled', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.keepStaleWhenUpdated(); - }); - - test('should not remove the stale label on the issue', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(0); - }); - - test('should not remove the stale label on the pull request', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(0); - }); - }); - - describe('when the option "remove-stale-when-updated" is enabled', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.removeStaleWhenUpdated(); - }); - - test('should remove the stale label on the issue', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(1); - }); - - test('should remove the stale label on the pull request', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(1); - }); - }); -}); - -describe('remove-issue-stale-when-updated option', (): void => { - beforeEach((): void => { - issuesProcessorBuilder = new IssuesProcessorBuilder(); - }); - - describe('when the option "remove-stale-when-updated" is disabled', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.keepStaleWhenUpdated(); - }); - - describe('when the option "remove-issue-stale-when-updated" is unset', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.unsetIssueStaleWhenUpdated(); - }); - - test('should not remove the stale label on the issue', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(0); - }); - - test('should not remove the stale label on the pull request', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(0); - }); - }); - - describe('when the option "remove-issue-stale-when-updated" is disabled', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.keepIssueStaleWhenUpdated(); - }); - - test('should not remove the stale label on the issue', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(0); - }); - - test('should not remove the stale label on the pull request', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(0); - }); - }); - - describe('when the option "remove-issue-stale-when-updated" is enabled', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.removeIssueStaleWhenUpdated(); - }); - - test('should remove the stale label on the issue', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(1); - }); - - test('should not remove the stale label on the pull request', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(0); - }); - }); - }); - - describe('when the option "remove-stale-when-updated" is enabled', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.removeStaleWhenUpdated(); - }); - - describe('when the option "remove-issue-stale-when-updated" is unset', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.unsetIssueStaleWhenUpdated(); - }); - - test('should remove the stale label on the issue', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(1); - }); - - test('should remove the stale label on the pull request', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(1); - }); - }); - - describe('when the option "remove-issue-stale-when-updated" is disabled', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.keepIssueStaleWhenUpdated(); - }); - - test('should not remove the stale label on the issue', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(0); - }); - - test('should remove the stale label on the pull request', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(1); - }); - }); - - describe('when the option "remove-issue-stale-when-updated" is enabled', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.removeIssueStaleWhenUpdated(); - }); - - test('should remove the stale label on the issue', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(1); - }); - - test('should remove the stale label on the pull request', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(1); - }); - }); - }); -}); - -describe('remove-pr-stale-when-updated option', (): void => { - beforeEach((): void => { - issuesProcessorBuilder = new IssuesProcessorBuilder(); - }); - - describe('when the option "remove-stale-when-updated" is disabled', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.keepStaleWhenUpdated(); - }); - - describe('when the option "remove-pr-stale-when-updated" is unset', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.unsetPrStaleWhenUpdated(); - }); - - test('should not remove the stale label on the issue', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(0); - }); - - test('should not remove the stale label on the pull request', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(0); - }); - }); - - describe('when the option "remove-pr-stale-when-updated" is disabled', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.keepPrStaleWhenUpdated(); - }); - - test('should not remove the stale label on the issue', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(0); - }); - - test('should not remove the stale label on the pull request', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(0); - }); - }); - - describe('when the option "remove-pr-stale-when-updated" is enabled', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.removePrStaleWhenUpdated(); - }); - - test('should not remove the stale label on the issue', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(0); - }); - - test('should remove the stale label on the pull request', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(1); - }); - }); - }); - - describe('when the option "remove-stale-when-updated" is enabled', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.removeStaleWhenUpdated(); - }); - - describe('when the option "remove-pr-stale-when-updated" is unset', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.unsetPrStaleWhenUpdated(); - }); - - test('should remove the stale label on the issue', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(1); - }); - - test('should remove the stale label on the pull request', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(1); - }); - }); - - describe('when the option "remove-pr-stale-when-updated" is disabled', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.keepPrStaleWhenUpdated(); - }); - - test('should remove the stale label on the issue', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(1); - }); - - test('should not remove the stale label on the pull request', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(0); - }); - }); - - describe('when the option "remove-pr-stale-when-updated" is enabled', (): void => { - beforeEach((): void => { - issuesProcessorBuilder.removePrStaleWhenUpdated(); - }); - - test('should remove the stale label on the issue', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(1); - }); - - test('should remove the stale label on the pull request', async (): Promise => { - expect.assertions(1); - issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); - - await issuesProcessor.processIssues(); - - expect(issuesProcessor.removedLabelIssues).toHaveLength(1); - }); - }); - }); -}); - -class IssuesProcessorBuilder { - private _options: IIssuesProcessorOptions = { - ...DefaultProcessorOptions - }; - private _issues: Issue[] = []; - - keepStaleWhenUpdated(): IssuesProcessorBuilder { - this._options.removeStaleWhenUpdated = false; - - return this; - } - - removeStaleWhenUpdated(): IssuesProcessorBuilder { - this._options.removeStaleWhenUpdated = true; - - return this; - } - - unsetIssueStaleWhenUpdated(): IssuesProcessorBuilder { - delete this._options.removeIssueStaleWhenUpdated; - - return this; - } - - keepIssueStaleWhenUpdated(): IssuesProcessorBuilder { - this._options.removeIssueStaleWhenUpdated = false; - - return this; - } - - removeIssueStaleWhenUpdated(): IssuesProcessorBuilder { - this._options.removeIssueStaleWhenUpdated = true; - - return this; - } - - unsetPrStaleWhenUpdated(): IssuesProcessorBuilder { - delete this._options.removePrStaleWhenUpdated; - - return this; - } - - keepPrStaleWhenUpdated(): IssuesProcessorBuilder { - this._options.removePrStaleWhenUpdated = false; - - return this; - } - - removePrStaleWhenUpdated(): IssuesProcessorBuilder { - this._options.removePrStaleWhenUpdated = true; - - return this; - } - - issuesOrPrs(issues: Partial[]): IssuesProcessorBuilder { - this._issues = issues.map( - (issue: Readonly>, index: Readonly): Issue => - generateIssue( - this._options, - index, - issue.title ?? 'dummy-title', - issue.updated_at ?? new Date().toDateString(), - issue.created_at ?? new Date().toDateString(), - !!issue.pull_request, - issue.labels ? issue.labels.map(label => label.name) : [] - ) - ); - - return this; - } - - issues(issues: Partial[]): IssuesProcessorBuilder { - this.issuesOrPrs( - issues.map((issue: Readonly>): Partial => { - return { - ...issue, - pull_request: null - }; - }) - ); - - return this; - } - - staleIssues(issues: Partial[]): IssuesProcessorBuilder { - this.issues( - issues.map((issue: Readonly>): Partial => { - return { - ...issue, - updated_at: '2020-01-01T17:00:00Z', - created_at: '2020-01-01T17:00:00Z', - labels: issue.labels?.map((label: Readonly): ILabel => { - return { - ...label, - name: 'Stale' - }; - }) ?? [ - { - name: 'Stale' - } - ] - }; - }) - ); - - return this; - } - - prs(issues: Partial[]): IssuesProcessorBuilder { - this.issuesOrPrs( - issues.map((issue: Readonly>): Partial => { - return { - ...issue, - pull_request: {key: 'value'} - }; - }) - ); - - return this; - } - - stalePrs(issues: Partial[]): IssuesProcessorBuilder { - this.prs( - issues.map((issue: Readonly>): Partial => { - return { - ...issue, - updated_at: '2020-01-01T17:00:00Z', - created_at: '2020-01-01T17:00:00Z', - labels: issue.labels?.map((label: Readonly): ILabel => { - return { - ...label, - name: 'Stale' - }; - }) ?? [ - { - name: 'Stale' - } - ] - }; - }) - ); - - return this; - } - - build(): IssuesProcessorMock { - return new IssuesProcessorMock( - this._options, - async p => (p === 1 ? this._issues : []), - async () => [ - { - user: { - login: 'notme', - type: 'User' - }, - body: 'body' - } - ], - async () => new Date().toDateString() - ); - } -} +import {Issue} from '../src/classes/issue'; +import {IIssue} from '../src/interfaces/issue'; +import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-options'; +import {ILabel} from '../src/interfaces/label'; +import {IssuesProcessorMock} from './classes/issues-processor-mock'; +import {DefaultProcessorOptions} from './constants/default-processor-options'; +import {generateIssue} from './functions/generate-issue'; + +let issuesProcessorBuilder: IssuesProcessorBuilder; +let issuesProcessor: IssuesProcessorMock; + +/** + * @description + * Assuming there is a comment on the issue + */ +describe('remove-issue-stale-when-updated option', (): void => { + beforeEach((): void => { + issuesProcessorBuilder = new IssuesProcessorBuilder(); + }); + + describe('when the option "remove-issue-stale-when-updated" is disabled', (): void => { + beforeEach((): void => { + issuesProcessorBuilder.keepIssueStaleWhenUpdated(); + }); + + test('should not remove the stale label on the issue', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.removedLabelIssues).toHaveLength(0); + }); + + test('should remove the stale label on the pull request', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.removedLabelIssues).toHaveLength(1); + }); + }); + + describe('when the option "remove-issue-stale-when-updated" is enabled', (): void => { + beforeEach((): void => { + issuesProcessorBuilder.removeIssueStaleWhenUpdated(); + }); + + test('should remove the stale label on the issue', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.removedLabelIssues).toHaveLength(1); + }); + + test('should remove the stale label on the pull request', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.removedLabelIssues).toHaveLength(1); + }); + }); +}); + +describe('remove-pr-stale-when-updated option', (): void => { + beforeEach((): void => { + issuesProcessorBuilder = new IssuesProcessorBuilder(); + }); + + describe('when the option "remove-pr-stale-when-updated" is disabled', (): void => { + beforeEach((): void => { + issuesProcessorBuilder.keepPrStaleWhenUpdated(); + }); + + test('should remove the stale label on the issue', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.removedLabelIssues).toHaveLength(1); + }); + + test('should not remove the stale label on the pull request', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.removedLabelIssues).toHaveLength(0); + }); + }); + + describe('when the option "remove-pr-stale-when-updated" is enabled', (): void => { + beforeEach((): void => { + issuesProcessorBuilder.removePrStaleWhenUpdated(); + }); + + test('should remove the stale label on the issue', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.removedLabelIssues).toHaveLength(1); + }); + + test('should remove the stale label on the pull request', async (): Promise => { + expect.assertions(1); + issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build(); + + await issuesProcessor.processIssues(); + + expect(issuesProcessor.removedLabelIssues).toHaveLength(1); + }); + }); +}); + +class IssuesProcessorBuilder { + private _options: IIssuesProcessorOptions = { + ...DefaultProcessorOptions, + removeIssueStaleWhenUpdated: true, + removePrStaleWhenUpdated: true + }; + private _issues: Issue[] = []; + + keepIssueStaleWhenUpdated(): IssuesProcessorBuilder { + this._options.removeIssueStaleWhenUpdated = false; + + return this; + } + + removeIssueStaleWhenUpdated(): IssuesProcessorBuilder { + this._options.removeIssueStaleWhenUpdated = true; + + return this; + } + + keepPrStaleWhenUpdated(): IssuesProcessorBuilder { + this._options.removePrStaleWhenUpdated = false; + + return this; + } + + removePrStaleWhenUpdated(): IssuesProcessorBuilder { + this._options.removePrStaleWhenUpdated = true; + + return this; + } + + issuesOrPrs(issues: Partial[]): IssuesProcessorBuilder { + this._issues = issues.map( + (issue: Readonly>, index: Readonly): Issue => + generateIssue( + this._options, + index, + issue.title ?? 'dummy-title', + issue.updated_at ?? new Date().toDateString(), + issue.created_at ?? new Date().toDateString(), + !!issue.pull_request, + issue.labels ? issue.labels.map(label => label.name) : [] + ) + ); + + return this; + } + + issues(issues: Partial[]): IssuesProcessorBuilder { + this.issuesOrPrs( + issues.map((issue: Readonly>): Partial => { + return { + ...issue, + pull_request: null + }; + }) + ); + + return this; + } + + staleIssues(issues: Partial[]): IssuesProcessorBuilder { + this.issues( + issues.map((issue: Readonly>): Partial => { + return { + ...issue, + updated_at: '2020-01-01T17:00:00Z', + created_at: '2020-01-01T17:00:00Z', + labels: issue.labels?.map((label: Readonly): ILabel => { + return { + ...label, + name: 'Stale' + }; + }) ?? [ + { + name: 'Stale' + } + ] + }; + }) + ); + + return this; + } + + prs(issues: Partial[]): IssuesProcessorBuilder { + this.issuesOrPrs( + issues.map((issue: Readonly>): Partial => { + return { + ...issue, + pull_request: {key: 'value'} + }; + }) + ); + + return this; + } + + stalePrs(issues: Partial[]): IssuesProcessorBuilder { + this.prs( + issues.map((issue: Readonly>): Partial => { + return { + ...issue, + updated_at: '2020-01-01T17:00:00Z', + created_at: '2020-01-01T17:00:00Z', + labels: issue.labels?.map((label: Readonly): ILabel => { + return { + ...label, + name: 'Stale' + }; + }) ?? [ + { + name: 'Stale' + } + ] + }; + }) + ); + + return this; + } + + build(): IssuesProcessorMock { + return new IssuesProcessorMock( + this._options, + async p => (p === 1 ? this._issues : []), + async () => [ + { + user: { + login: 'notme', + type: 'User' + }, + body: 'body' + } + ], + async () => new Date().toDateString() + ); + } +} diff --git a/action.yml b/action.yml index 430dcbc21..18170ed57 100644 --- a/action.yml +++ b/action.yml @@ -92,17 +92,13 @@ inputs: description: 'The maximum number of operations per run, used to control rate limiting (GitHub API CRUD related).' default: '30' required: false - remove-stale-when-updated: - description: 'Remove stale labels from issues and pull requests when they are updated or commented on.' - default: 'true' - required: false remove-issue-stale-when-updated: - description: 'Remove stale labels from issues when they are updated or commented on. Override "remove-stale-when-updated" option regarding only the issues.' - default: '' + description: 'Remove stale labels from issues when they are updated or commented on.' + default: 'true' required: false remove-pr-stale-when-updated: - description: 'Remove stale labels from pull requests when they are updated or commented on. Override "remove-stale-when-updated" option regarding only the pull requests.' - default: '' + description: 'Remove stale labels from pull requests when they are updated or commented on.' + default: 'true' required: false debug-only: description: 'Run the processor in debug mode without actually performing any operations on live issues.' diff --git a/dist/index.js b/dist/index.js index 28b9b8f1c..3f9271797 100644 --- a/dist/index.js +++ b/dist/index.js @@ -297,7 +297,6 @@ const clean_label_1 = __nccwpck_require__(7752); const get_humanized_date_1 = __nccwpck_require__(965); const is_date_more_recent_than_1 = __nccwpck_require__(1473); const is_valid_date_1 = __nccwpck_require__(891); -const is_boolean_1 = __nccwpck_require__(8236); const is_labeled_1 = __nccwpck_require__(6792); const should_mark_when_stale_1 = __nccwpck_require__(2461); const words_to_list_1 = __nccwpck_require__(1883); @@ -675,7 +674,7 @@ class IssuesProcessor { const issueHasUpdate = IssuesProcessor._updatedSince(issue.updated_at, daysBeforeClose); issueLogger.info(`$$type has been updated: ${logger_service_1.LoggerService.cyan(issueHasUpdate)}`); const shouldRemoveStaleWhenUpdated = this._shouldRemoveStaleWhenUpdated(issue); - issueLogger.info(`The option ${issueLogger.createOptionLink(this._getRemoveStaleWhenUpdatedUsedOptionName(issue))} is: ${logger_service_1.LoggerService.cyan(shouldRemoveStaleWhenUpdated)}`); + issueLogger.info(`The option ${issueLogger.createOptionLink(IssuesProcessor._getRemoveStaleWhenUpdatedUsedOptionName(issue))} is: ${logger_service_1.LoggerService.cyan(shouldRemoveStaleWhenUpdated)}`); if (shouldRemoveStaleWhenUpdated) { issueLogger.info(`The stale label should not be removed`); } @@ -903,16 +902,9 @@ class IssuesProcessor { return this.options.anyOfIssueLabels; } _shouldRemoveStaleWhenUpdated(issue) { - if (issue.isPullRequest) { - if (is_boolean_1.isBoolean(this.options.removePrStaleWhenUpdated)) { - return this.options.removePrStaleWhenUpdated; - } - return this.options.removeStaleWhenUpdated; - } - if (is_boolean_1.isBoolean(this.options.removeIssueStaleWhenUpdated)) { - return this.options.removeIssueStaleWhenUpdated; - } - return this.options.removeStaleWhenUpdated; + return issue.isPullRequest + ? this.options.removePrStaleWhenUpdated + : this.options.removeIssueStaleWhenUpdated; } _removeLabelsWhenUnstale(issue, removeLabels) { return __awaiter(this, void 0, void 0, function* () { @@ -987,22 +979,15 @@ class IssuesProcessor { ? option_1.Option.DaysBeforePrStale : option_1.Option.DaysBeforeIssueStale; } + static _getRemoveStaleWhenUpdatedUsedOptionName(issue) { + return issue.isPullRequest + ? option_1.Option.RemovePrStaleWhenUpdated + : option_1.Option.RemoveIssueStaleWhenUpdated; + } _consumeIssueOperation(issue) { this.operations.consumeOperation(); issue.operations.consumeOperation(); } - _getRemoveStaleWhenUpdatedUsedOptionName(issue) { - if (issue.isPullRequest) { - if (is_boolean_1.isBoolean(this.options.removePrStaleWhenUpdated)) { - return option_1.Option.RemovePrStaleWhenUpdated; - } - return option_1.Option.RemoveStaleWhenUpdated; - } - if (is_boolean_1.isBoolean(this.options.removeIssueStaleWhenUpdated)) { - return option_1.Option.RemoveIssueStaleWhenUpdated; - } - return option_1.Option.RemoveStaleWhenUpdated; - } } exports.IssuesProcessor = IssuesProcessor; @@ -1730,7 +1715,6 @@ var Option; Option["AnyOfIssueLabels"] = "any-of-issue-labels"; Option["AnyOfPrLabels"] = "any-of-pr-labels"; Option["OperationsPerRun"] = "operations-per-run"; - Option["RemoveStaleWhenUpdated"] = "remove-stale-when-updated"; Option["RemoveIssueStaleWhenUpdated"] = "remove-issue-stale-when-updated"; Option["RemovePrStaleWhenUpdated"] = "remove-pr-stale-when-updated"; Option["DebugOnly"] = "debug-only"; @@ -1849,21 +1833,6 @@ function isValidDate(date) { exports.isValidDate = isValidDate; -/***/ }), - -/***/ 8236: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isBoolean = void 0; -function isBoolean(value) { - return value === true || value === false; -} -exports.isBoolean = isBoolean; - - /***/ }), /***/ 6792: @@ -2030,9 +1999,8 @@ function _getAndValidateArgs() { anyOfIssueLabels: core.getInput('any-of-issue-labels'), anyOfPrLabels: core.getInput('any-of-pr-labels'), operationsPerRun: parseInt(core.getInput('operations-per-run', { required: true })), - removeStaleWhenUpdated: !(core.getInput('remove-stale-when-updated') === 'false'), - removeIssueStaleWhenUpdated: _toOptionalBoolean('remove-issue-stale-when-updated'), - removePrStaleWhenUpdated: _toOptionalBoolean('remove-pr-stale-when-updated'), + removeIssueStaleWhenUpdated: !(core.getInput('remove-issue-stale-when-updated') === 'false'), + removePrStaleWhenUpdated: !(core.getInput('remove-pr-stale-when-updated') === 'false'), debugOnly: core.getInput('debug-only') === 'true', ascending: core.getInput('ascending') === 'true', deleteBranch: core.getInput('delete-branch') === 'true', @@ -2085,27 +2053,6 @@ function processOutput(staledIssues, closedIssues) { core.setOutput('closed-issues-prs', JSON.stringify(closedIssues)); }); } -/** - * @description - * From an argument name, get the value as an optional boolean - * This is very useful for all the arguments that override others - * It will allow us to easily use the original one when the return value is `undefined` - * Which is different from `true` or `false` that consider the argument as set - * - * @param {Readonly} argumentName The name of the argument to check - * - * @returns {boolean | undefined} The value matching the given argument name - */ -function _toOptionalBoolean(argumentName) { - const argument = core.getInput(argumentName); - if (argument === 'true') { - return true; - } - else if (argument === 'false') { - return false; - } - return undefined; -} void _run(); diff --git a/src/classes/issue.spec.ts b/src/classes/issue.spec.ts index df833f220..b01b5b703 100644 --- a/src/classes/issue.spec.ts +++ b/src/classes/issue.spec.ts @@ -30,9 +30,8 @@ describe('Issue', (): void => { anyOfIssueLabels: '', anyOfPrLabels: '', operationsPerRun: 0, - removeStaleWhenUpdated: false, - removeIssueStaleWhenUpdated: undefined, - removePrStaleWhenUpdated: undefined, + removeIssueStaleWhenUpdated: false, + removePrStaleWhenUpdated: false, repoToken: '', staleIssueMessage: '', stalePrMessage: '', diff --git a/src/classes/issues-processor.ts b/src/classes/issues-processor.ts index 33d3ef56a..d90dda12b 100644 --- a/src/classes/issues-processor.ts +++ b/src/classes/issues-processor.ts @@ -7,7 +7,6 @@ import {cleanLabel} from '../functions/clean-label'; import {getHumanizedDate} from '../functions/dates/get-humanized-date'; import {isDateMoreRecentThan} from '../functions/dates/is-date-more-recent-than'; import {isValidDate} from '../functions/dates/is-valid-date'; -import {isBoolean} from '../functions/is-boolean'; import {isLabeled} from '../functions/is-labeled'; import {shouldMarkWhenStale} from '../functions/should-mark-when-stale'; import {wordsToList} from '../functions/words-to-list'; @@ -660,7 +659,7 @@ export class IssuesProcessor { issueLogger.info( `The option ${issueLogger.createOptionLink( - this._getRemoveStaleWhenUpdatedUsedOptionName(issue) + IssuesProcessor._getRemoveStaleWhenUpdatedUsedOptionName(issue) )} is: ${LoggerService.cyan(shouldRemoveStaleWhenUpdated)}` ); @@ -974,19 +973,9 @@ export class IssuesProcessor { } private _shouldRemoveStaleWhenUpdated(issue: Issue): boolean { - if (issue.isPullRequest) { - if (isBoolean(this.options.removePrStaleWhenUpdated)) { - return this.options.removePrStaleWhenUpdated; - } - - return this.options.removeStaleWhenUpdated; - } - - if (isBoolean(this.options.removeIssueStaleWhenUpdated)) { - return this.options.removeIssueStaleWhenUpdated; - } - - return this.options.removeStaleWhenUpdated; + return issue.isPullRequest + ? this.options.removePrStaleWhenUpdated + : this.options.removeIssueStaleWhenUpdated; } private async _removeLabelsWhenUnstale( @@ -1113,29 +1102,16 @@ export class IssuesProcessor { : Option.DaysBeforeIssueStale; } + private static _getRemoveStaleWhenUpdatedUsedOptionName( + issue: Readonly + ): Option.RemovePrStaleWhenUpdated | Option.RemoveIssueStaleWhenUpdated { + return issue.isPullRequest + ? Option.RemovePrStaleWhenUpdated + : Option.RemoveIssueStaleWhenUpdated; + } + private _consumeIssueOperation(issue: Readonly): void { this.operations.consumeOperation(); issue.operations.consumeOperation(); } - - private _getRemoveStaleWhenUpdatedUsedOptionName( - issue: Readonly - ): - | Option.RemovePrStaleWhenUpdated - | Option.RemoveStaleWhenUpdated - | Option.RemoveIssueStaleWhenUpdated { - if (issue.isPullRequest) { - if (isBoolean(this.options.removePrStaleWhenUpdated)) { - return Option.RemovePrStaleWhenUpdated; - } - - return Option.RemoveStaleWhenUpdated; - } - - if (isBoolean(this.options.removeIssueStaleWhenUpdated)) { - return Option.RemoveIssueStaleWhenUpdated; - } - - return Option.RemoveStaleWhenUpdated; - } } diff --git a/src/enums/option.ts b/src/enums/option.ts index 5d7d61b0a..99c8cdb17 100644 --- a/src/enums/option.ts +++ b/src/enums/option.ts @@ -19,7 +19,6 @@ export enum Option { AnyOfIssueLabels = 'any-of-issue-labels', AnyOfPrLabels = 'any-of-pr-labels', OperationsPerRun = 'operations-per-run', - RemoveStaleWhenUpdated = 'remove-stale-when-updated', RemoveIssueStaleWhenUpdated = 'remove-issue-stale-when-updated', RemovePrStaleWhenUpdated = 'remove-pr-stale-when-updated', DebugOnly = 'debug-only', diff --git a/src/interfaces/issues-processor-options.ts b/src/interfaces/issues-processor-options.ts index 21419d0a3..0e2930670 100644 --- a/src/interfaces/issues-processor-options.ts +++ b/src/interfaces/issues-processor-options.ts @@ -21,9 +21,8 @@ export interface IIssuesProcessorOptions { anyOfIssueLabels: string; anyOfPrLabels: string; operationsPerRun: number; - removeStaleWhenUpdated: boolean; - removeIssueStaleWhenUpdated: boolean | undefined; - removePrStaleWhenUpdated: boolean | undefined; + removeIssueStaleWhenUpdated: boolean; + removePrStaleWhenUpdated: boolean; debugOnly: boolean; ascending: boolean; deleteBranch: boolean; diff --git a/src/main.ts b/src/main.ts index 46df34cc1..767efcb9f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -53,14 +53,11 @@ function _getAndValidateArgs(): IIssuesProcessorOptions { operationsPerRun: parseInt( core.getInput('operations-per-run', {required: true}) ), - removeStaleWhenUpdated: !( - core.getInput('remove-stale-when-updated') === 'false' + removeIssueStaleWhenUpdated: !( + core.getInput('remove-issue-stale-when-updated') === 'false' ), - removeIssueStaleWhenUpdated: _toOptionalBoolean( - 'remove-issue-stale-when-updated' - ), - removePrStaleWhenUpdated: _toOptionalBoolean( - 'remove-pr-stale-when-updated' + removePrStaleWhenUpdated: !( + core.getInput('remove-pr-stale-when-updated') === 'false' ), debugOnly: core.getInput('debug-only') === 'true', ascending: core.getInput('ascending') === 'true', @@ -123,29 +120,4 @@ async function processOutput( core.setOutput('closed-issues-prs', JSON.stringify(closedIssues)); } -/** - * @description - * From an argument name, get the value as an optional boolean - * This is very useful for all the arguments that override others - * It will allow us to easily use the original one when the return value is `undefined` - * Which is different from `true` or `false` that consider the argument as set - * - * @param {Readonly} argumentName The name of the argument to check - * - * @returns {boolean | undefined} The value matching the given argument name - */ -function _toOptionalBoolean( - argumentName: Readonly -): boolean | undefined { - const argument: string = core.getInput(argumentName); - - if (argument === 'true') { - return true; - } else if (argument === 'false') { - return false; - } - - return undefined; -} - void _run(); From 67004407a6a06b621969a09f818cc9b477f0d733 Mon Sep 17 00:00:00 2001 From: TESTELIN Geoffrey Date: Fri, 8 Oct 2021 22:42:12 +0200 Subject: [PATCH 11/11] docs(readme): split the options between common, issues and prs --- README.md | 418 +++++++++++++++++++++++++++--------------------------- 1 file changed, 211 insertions(+), 207 deletions(-) diff --git a/README.md b/README.md index ef500f5d1..c7889dbcb 100644 --- a/README.md +++ b/README.md @@ -30,45 +30,49 @@ Every argument is optional. | Input | Description | Default | | ------------------------------------------------------------------- | ----------------------------------------------------------------------- | --------------------- | +| Common options | | | | [repo-token](#repo-token) | PAT for GitHub API authentication | `${{ github.token }}` | +| [operations-per-run](#operations-per-run) | Max number of operations per run | `30` | +| [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 | | +| [debug-only](#debug-only) | Dry-run | `false` | +| [ascending](#ascending) | Order to get issues/PRs | `false` | +| [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` | +| [enable-statistics](#enable-statistics) | Display statistics in the logs | `true` | +| Issue options | | | | [days-before-issue-stale](#days-before-issue-stale) | Idle number of days before marking issues stale | `60` | -| [days-before-pr-stale](#days-before-pr-stale) | Idle number of days before marking PRs stale | `60` | | [days-before-issue-close](#days-before-issue-close) | Idle number of days before closing stale issues | `7` | -| [days-before-pr-close](#days-before-pr-close) | Idle number of days before closing stale PRs | `7` | | [stale-issue-message](#stale-issue-message) | Comment on the staled issues | | -| [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-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` | | [close-issue-label](#close-issue-label) | Label to apply on closed issues | | +| [exempt-issue-labels](#exempt-issue-labels) | Labels on issues exempted from stale | | +| [only-issue-labels](#only-issue-labels) | Only issues with ALL these labels are checked | | +| [any-of-issue-labels](#any-of-issue-labels) | Only issues with ANY of these labels are checked | | +| [remove-issue-stale-when-updated](#remove-issue-stale-when-updated) | Remove stale label from issues on updates/comments | `true` | +| [exempt-issue-milestones](#exempt-issue-milestones) | Milestones on issues exempted from stale | | +| [exempt-all-issue-milestones](#exempt-all-issue-milestones) | Exempt all issues with milestones from stale | `false` | +| [exempt-issue-assignees](#exempt-issue-assignees) | Assignees on issues exempted from stale | | +| [exempt-all-issue-assignees](#exempt-all-issue-assignees) | Exempt all issues with assignees from stale | `false` | +| [ignore-issue-updates](#ignore-issue-updates) | Any update (update/comment) can reset the stale idle time on the issues | `false` | +| Pull request options | | | +| [days-before-pr-stale](#days-before-pr-stale) | Idle number of days before marking PRs stale | `60` | +| [days-before-pr-close](#days-before-pr-close) | Idle number of days before closing stale PRs | `7` | +| [stale-pr-message](#stale-pr-message) | Comment on the staled PRs | | +| [close-pr-message](#close-pr-message) | Comment on the staled PRs while closed | | | [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 | | -| [exempt-issue-labels](#exempt-issue-labels) | Labels on issues exempted from stale | | | [exempt-pr-labels](#exempt-pr-labels) | Labels on PRs exempted from stale | | -| [only-issue-labels](#only-issue-labels) | Only issues with ALL these labels are checked | | | [only-pr-labels](#only-pr-labels) | Only PRs with ALL these labels are checked | | -| [any-of-issue-labels](#any-of-issue-labels) | Only issues with ANY of these labels are checked | | | [any-of-pr-labels](#any-of-pr-labels) | Only PRs with ANY of these labels are checked | | -| [operations-per-run](#operations-per-run) | Max number of operations per run | `30` | -| [remove-issue-stale-when-updated](#remove-issue-stale-when-updated) | Remove stale label from issues on updates/comments | `true` | | [remove-pr-stale-when-updated](#remove-pr-stale-when-updated) | Remove stale label from PRs on updates/comments | `true` | -| [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 | | -| [debug-only](#debug-only) | Dry-run | `false` | -| [ascending](#ascending) | Order to get issues/PRs | `false` | -| [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` | -| [exempt-issue-milestones](#exempt-issue-milestones) | Milestones on issues exempted from stale | | | [exempt-pr-milestones](#exempt-pr-milestones) | Milestones on PRs exempted from stale | | -| [exempt-all-issue-milestones](#exempt-all-issue-milestones) | Exempt all issues with milestones from stale | `false` | | [exempt-all-pr-milestones](#exempt-all-pr-milestones) | Exempt all PRs with milestones from stale | `false` | -| [exempt-issue-assignees](#exempt-issue-assignees) | Assignees on issues exempted from stale | | | [exempt-pr-assignees](#exempt-pr-assignees) | Assignees on PRs exempted from stale | | -| [exempt-all-issue-assignees](#exempt-all-issue-assignees) | Exempt all issues with assignees from stale | `false` | | [exempt-all-pr-assignees](#exempt-all-pr-assignees) | Exempt all PRs with assignees from stale | `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` | -| [ignore-issue-updates](#ignore-issue-updates) | Any update (update/comment) can reset the stale idle time on the issues | `false` | | [ignore-pr-updates](#ignore-pr-updates) | Any update (update/comment) can reset the stale idle time on the PRs | `false` | ### List of output options @@ -87,6 +91,85 @@ Under the hood, it uses the [@actions/github](https://www.npmjs.com/package/@act Default value: `${{ github.token }}` +#### operations-per-run + +_Context:_ +This action performs some API calls to GitHub to fetch or close issues and pull requests, set or update labels, add comments, delete branches, etc. +These operations are made in a very short period of time — because the action is very fast to run — and can be numerous based on your project action configuration and the quantity of issues and pull requests within it. +GitHub has a [rate limit](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting) and if reached will block these API calls for one hour (or API calls from other actions using the same user (a.k.a.: the github-token from the [repo-token](#repo-token) option)). +This option helps you to stay within the GitHub rate limits, as you can use this option to limit the number of operations for a single run. + +_Purpose:_ +This option aims to limit the number of operations made with the GitHub API to avoid reaching the [rate limit](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting). + +Based on your project, your GitHub business plan and the date of the cron job you set for this action, you can increase this limit to a higher number. +If you are not sure which is the right value for you or if the default value is good enough, you could enable the logs and look at the end of the stale action. +If you reached the limit, you will see a warning message in the logs, telling you that you should increase the number of operations. +If you choose not to increase the limit, you might end up with unprocessed issues or pull requests after a stale action run. + +When [debugging](#Debugging), you can set it to a much higher number like `1000` since there will be fewer operations made with the GitHub API. +Only the [actor](#repo-token) and the batch of issues (100 per batch) will consume the operations. + +Default value: `30` + +#### labels-to-add-when-unstale + +A comma delimited list of labels to add when a stale issue or pull request receives activity and has the [stale-issue-label](#stale-issue-label) or [stale-pr-label](#stale-pr-label) removed from it. + +Default value: unset + +#### labels-to-remove-when-unstale + +A comma delimited list of labels to remove when a stale issue or pull request receives activity and has the [stale-issue-label](#stale-issue-label) or [stale-pr-label](#stale-pr-label) removed from it. + +Warning: each label results in a unique API call which can drastically consume the limit of [operations-per-run](#operations-per-run). + +Default value: unset +Required Permission: `pull-requests: write` + +#### debug-only + +Run the stale workflow as dry-run. +No GitHub API calls that can alter your issues and pull requests will happen. +Useful to debug or when you want to configure the stale workflow safely. + +Default value: `false` + +#### ascending + +Change the order used to fetch the issues and pull requests from GitHub: + +- `true` is for ascending. +- `false` is for descending. + +It can be useful if your repository is processing so many issues and pull requests that you reach the [operations-per-run](#operations-per-run) limit. +Based on the order, you could prefer to focus on the new content or on the old content of your repository. + +Default value: `false` + +#### start-date + +The start date is used to ignore the issues and pull requests created before the start date. +Particularly useful when you wish to add this stale workflow on an existing repository and only wish to stale the new issues and pull requests. + +If set, the date must be formatted following the `ISO 8601` or `RFC 2822` standard. + +Default value: unset + +#### delete-branch + +If set to `true`, the stale workflow will automatically delete the GitHub branches related to the pull requests automatically closed by the stale workflow. + +Default value: `false` +Required Permission: `pull-requests: write` + +#### enable-statistics + +Collects and display statistics at the end of the stale workflow logs to get a summary of what happened during the run. +This option is only useful if the debug output secret `ACTIONS_STEP_DEBUG` is set to `true` in your repository to display the logs. + +Default value: `true` + #### days-before-issue-stale The idle number of days before marking the issues as stale (by adding a label). @@ -115,34 +198,6 @@ You can fine tune which issues should be marked as stale based on the milestones Default value: `60` -#### days-before-pr-stale - -The idle number of days before marking the pull requests as stale (by adding a label). -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 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-pr-updates](#ignore-pr-updates) option. - -If set to a negative number like `-1`, no pull requests will be marked as stale automatically. -In that case, you can still add the stale label manually to mark as stale. - -The label used to stale is defined by this option: [stale-pr-label](#stale-pr-label) - -A comment can also be added to notify about the stale and is defined by this option: [stale-pr-message](#stale-pr-message) - -You can fine tune which pull requests should be marked as stale based on the milestones, the assignees, the creation date and the missing/present labels from these options: - -- [exempt-pr-labels](#exempt-pr-labels) -- [only-pr-labels](#only-pr-labels) -- [any-of-pr-labels](#any-of-pr-labels) -- [start-date](#start-date) -- [exempt-pr-milestones](#exempt-pr-milestones) -- [exempt-all-pr-milestones](#exempt-all-pr-milestones) -- [exempt-pr-assignees](#exempt-pr-assignees) -- [exempt-all-pr-assignees](#exempt-all-pr-assignees) -- [ignore-pr-updates](#ignore-pr-updates) - -Default value: `60` - #### days-before-issue-close The idle number of days before closing the stale issues (due to the stale label). @@ -155,18 +210,6 @@ The label used to stale is defined by this option: [stale-issue-label](#stale-is Default value: `7` -#### days-before-pr-close - -The idle number of days before closing the stale pull requests (due to the stale label). -The pull requests will be closed 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. -Since adding the stale label will alter the last update date, we can calculate the number of days from this date. - -If set to a negative number like `-1`, the pull requests will never be closed automatically. - -The label used to stale is defined by this option: [stale-pr-label](#stale-pr-label) - -Default value: `7` - #### stale-issue-message The message that will be added as a comment to the issues when the stale workflow marks it automatically as stale with a label. @@ -176,15 +219,6 @@ You can skip the comment sending by passing an empty string. Default value: unset Required Permission: `issues: write` -#### stale-pr-message - -The message that will be added as a comment to the pull requests when the stale workflow marks it automatically as stale with a label. - -You can skip the comment sending by passing an empty string. - -Default value: unset -Required Permission: `pull-requests: write` - #### close-issue-message The message that will be added as a comment to the issues when the stale workflow closes it automatically after being stale for too long. @@ -192,13 +226,6 @@ The message that will be added as a comment to the issues when the stale workflo Default value: unset Required Permission: `issues: write` -#### close-pr-message - -The message that will be added as a comment to the pull requests when the stale workflow closes it automatically after being stale for too long. - -Default value: unset -Required Permission: `pull-requests: write` - #### stale-issue-label The label that will be added to the issues when automatically marked as stale. @@ -215,22 +242,6 @@ It will be automatically removed if the issues are no longer closed nor locked. Default value: unset Required Permission: `issues: write` -#### stale-pr-label - -The label that will be added to the pull requests when automatically marked as stale. -If you wish to speedup the stale workflow for the pull requests, you can add this label manually to mark as stale. - -Default value: `Stale` -Required Permission: `pull-requests: write` - -#### close-pr-label - -The label that will be added to the pull requests when closed automatically. -It will be automatically removed if the pull requests are no longer closed nor locked. - -Default value: unset -Required Permission: `pull-requests: write` - #### exempt-issue-labels The label(s) that can exempt to automatically mark as stale the issues. @@ -240,15 +251,6 @@ If unset (or an empty string), this option will not alter the stale workflow. Default value: unset -#### exempt-pr-labels - -The label(s) that can exempt to automatically mark as stale the pull requests. -It can be a comma separated list of labels (e.g: `need-help,WIP`). - -If unset (or an empty string), this option will not alter the stale workflow. - -Default value: unset - #### only-issue-labels An allow-list of label(s) to only process the issues that contain all these label(s). @@ -260,168 +262,194 @@ If you wish to only check that the issues contain one of these label(s), use ins Default value: unset -#### only-pr-labels +#### any-of-issue-labels -An allow-list of label(s) to only process the pull requests that contain all these label(s). +An allow-list of label(s) to only process the issues that contain one of these label(s). It can be a comma separated list of labels (e.g: `answered,needs-rebase`). If unset (or an empty string), this option will not alter the stale workflow. -If you wish to only check that the pull requests contain one of these label(s), use instead [any-of-pr-labels](#any-of-pr-labels). +If you wish to only check that the issues or the pull requests contain all these label(s), use instead [only-issue-labels](#only-issue-labels). Default value: unset -#### any-of-issue-labels +#### remove-issue-stale-when-updated -An allow-list of label(s) to only process the issues that contain one of these label(s). -It can be a comma separated list of labels (e.g: `answered,needs-rebase`). +Automatically remove the stale label when the issues are updated (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`) or commented. -If unset (or an empty string), this option will not alter the stale workflow. +Default value: `true` +Required Permission: `issues: write` -If you wish to only check that the issues or the pull requests contain all these label(s), use instead [only-issue-labels](#only-issue-labels). +#### exempt-issue-milestones + +A white-list of milestone(s) to only process the issues that does not contain one of these milestone(s). +It can be a comma separated list of milestones (e.g: `V1,next`). + +If unset (or an empty string), this option will not alter the stale workflow. Default value: unset -#### any-of-pr-labels +#### exempt-all-issue-milestones -An allow-list of label(s) to only process the pull requests that contain one of these label(s). -It can be a comma separated list of labels (e.g: `answered,needs-rebase`). +If set to `true`, the issues with a milestone will not be marked as stale automatically. -If unset (or an empty string), this option will not alter the stale workflow. +Priority over [exempt-issue-milestones](#exempt-issue-milestones). -If you wish to only check that the issues or the pull requests contain all these label(s), use instead [only-pr-labels](#only-pr-labels). +Default value: `false` -Default value: unset +#### exempt-issue-assignees -#### operations-per-run +An allow-list of assignee(s) to only process the issues that does not contain one of these assignee(s). +It can be a comma separated list of assignees (e.g: `marco,polo`). -_Context:_ -This action performs some API calls to GitHub to fetch or close issues and pull requests, set or update labels, add comments, delete branches, etc. -These operations are made in a very short period of time — because the action is very fast to run — and can be numerous based on your project action configuration and the quantity of issues and pull requests within it. -GitHub has a [rate limit](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting) and if reached will block these API calls for one hour (or API calls from other actions using the same user (a.k.a.: the github-token from the [repo-token](#repo-token) option)). -This option helps you to stay within the GitHub rate limits, as you can use this option to limit the number of operations for a single run. +If unset (or an empty string), this option will not alter the stale workflow. -_Purpose:_ -This option aims to limit the number of operations made with the GitHub API to avoid reaching the [rate limit](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting). +Default value: unset -Based on your project, your GitHub business plan and the date of the cron job you set for this action, you can increase this limit to a higher number. -If you are not sure which is the right value for you or if the default value is good enough, you could enable the logs and look at the end of the stale action. -If you reached the limit, you will see a warning message in the logs, telling you that you should increase the number of operations. -If you choose not to increase the limit, you might end up with unprocessed issues or pull requests after a stale action run. +#### exempt-all-issue-assignees -When [debugging](#Debugging), you can set it to a much higher number like `1000` since there will be fewer operations made with the GitHub API. -Only the [actor](#repo-token) and the batch of issues (100 per batch) will consume the operations. +If set to `true`, the issues with an assignee will not be marked as stale automatically. -Default value: `30` +Priority over [exempt-issue-assignees](#exempt-issue-assignees). -#### remove-issue-stale-when-updated +Default value: `false` -Automatically remove the stale label when the issues are updated (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`) or commented. +#### ignore-issue-updates -Default value: `true` -Required Permission: `issues: write` +The option [days-before-issue-stale](#days-before-issue-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. +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`. -#### remove-pr-stale-when-updated +Default value: `false` -Automatically remove the stale label when the pull requests are updated (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`) or commented. +#### days-before-pr-stale -Default value: `true` -Required Permission: `pull-requests: write` +The idle number of days before marking the pull requests as stale (by adding a label). +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 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-pr-updates](#ignore-pr-updates) option. -#### labels-to-add-when-unstale +If set to a negative number like `-1`, no pull requests will be marked as stale automatically. +In that case, you can still add the stale label manually to mark as stale. -A comma delimited list of labels to add when a stale issue or pull request receives activity and has the [stale-issue-label](#stale-issue-label) or [stale-pr-label](#stale-pr-label) removed from it. +The label used to stale is defined by this option: [stale-pr-label](#stale-pr-label) -Default value: unset +A comment can also be added to notify about the stale and is defined by this option: [stale-pr-message](#stale-pr-message) -#### labels-to-remove-when-unstale +You can fine tune which pull requests should be marked as stale based on the milestones, the assignees, the creation date and the missing/present labels from these options: -A comma delimited list of labels to remove when a stale issue or pull request receives activity and has the [stale-issue-label](#stale-issue-label) or [stale-pr-label](#stale-pr-label) removed from it. +- [exempt-pr-labels](#exempt-pr-labels) +- [only-pr-labels](#only-pr-labels) +- [any-of-pr-labels](#any-of-pr-labels) +- [start-date](#start-date) +- [exempt-pr-milestones](#exempt-pr-milestones) +- [exempt-all-pr-milestones](#exempt-all-pr-milestones) +- [exempt-pr-assignees](#exempt-pr-assignees) +- [exempt-all-pr-assignees](#exempt-all-pr-assignees) +- [ignore-pr-updates](#ignore-pr-updates) -Warning: each label results in a unique API call which can drastically consume the limit of [operations-per-run](#operations-per-run). +Default value: `60` -Default value: unset -Required Permission: `pull-requests: write` +#### days-before-pr-close -#### debug-only +The idle number of days before closing the stale pull requests (due to the stale label). +The pull requests will be closed 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. +Since adding the stale label will alter the last update date, we can calculate the number of days from this date. -Run the stale workflow as dry-run. -No GitHub API calls that can alter your issues and pull requests will happen. -Useful to debug or when you want to configure the stale workflow safely. +If set to a negative number like `-1`, the pull requests will never be closed automatically. -Default value: `false` +The label used to stale is defined by this option: [stale-pr-label](#stale-pr-label) -#### ascending +Default value: `7` -Change the order used to fetch the issues and pull requests from GitHub: +#### stale-pr-message -- `true` is for ascending. -- `false` is for descending. +The message that will be added as a comment to the pull requests when the stale workflow marks it automatically as stale with a label. -It can be useful if your repository is processing so many issues and pull requests that you reach the [operations-per-run](#operations-per-run) limit. -Based on the order, you could prefer to focus on the new content or on the old content of your repository. +You can skip the comment sending by passing an empty string. -Default value: `false` +Default value: unset +Required Permission: `pull-requests: write` -#### start-date +#### close-pr-message -The start date is used to ignore the issues and pull requests created before the start date. -Particularly useful when you wish to add this stale workflow on an existing repository and only wish to stale the new issues and pull requests. +The message that will be added as a comment to the pull requests when the stale workflow closes it automatically after being stale for too long. -If set, the date must be formatted following the `ISO 8601` or `RFC 2822` standard. +Default value: unset +Required Permission: `pull-requests: write` -Default value: unset +#### stale-pr-label -#### delete-branch +The label that will be added to the pull requests when automatically marked as stale. +If you wish to speedup the stale workflow for the pull requests, you can add this label manually to mark as stale. -If set to `true`, the stale workflow will automatically delete the GitHub branches related to the pull requests automatically closed by the stale workflow. +Default value: `Stale` +Required Permission: `pull-requests: write` -Default value: `false` +#### close-pr-label + +The label that will be added to the pull requests when closed automatically. +It will be automatically removed if the pull requests are no longer closed nor locked. + +Default value: unset Required Permission: `pull-requests: write` -#### exempt-issue-milestones +#### exempt-pr-labels -A white-list of milestone(s) to only process the issues that does not contain one of these milestone(s). -It can be a comma separated list of milestones (e.g: `V1,next`). +The label(s) that can exempt to automatically mark as stale the pull requests. +It can be a comma separated list of labels (e.g: `need-help,WIP`). If unset (or an empty string), this option will not alter the stale workflow. Default value: unset -#### exempt-pr-milestones +#### only-pr-labels -A white-list of milestone(s) to only process the pull requests that does not contain one of these milestone(s). -It can be a comma separated list of milestones (e.g: `V1,next`). +An allow-list of label(s) to only process the pull requests that contain all these label(s). +It can be a comma separated list of labels (e.g: `answered,needs-rebase`). If unset (or an empty string), this option will not alter the stale workflow. +If you wish to only check that the pull requests contain one of these label(s), use instead [any-of-pr-labels](#any-of-pr-labels). + Default value: unset -#### exempt-all-issue-milestones +#### any-of-pr-labels -If set to `true`, the issues with a milestone will not be marked as stale automatically. +An allow-list of label(s) to only process the pull requests that contain one of these label(s). +It can be a comma separated list of labels (e.g: `answered,needs-rebase`). -Priority over [exempt-issue-milestones](#exempt-issue-milestones). +If unset (or an empty string), this option will not alter the stale workflow. -Default value: `false` +If you wish to only check that the issues or the pull requests contain all these label(s), use instead [only-pr-labels](#only-pr-labels). -#### exempt-all-pr-milestones +Default value: unset -If set to `true`, the pull requests with a milestone will not be marked as stale automatically. +#### remove-pr-stale-when-updated -Priority over [exempt-pr-milestones](#exempt-pr-milestones). +Automatically remove the stale label when the pull requests are updated (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`) or commented. -Default value: `false` +Default value: `true` +Required Permission: `pull-requests: write` -#### exempt-issue-assignees +#### exempt-pr-milestones -An allow-list of assignee(s) to only process the issues that does not contain one of these assignee(s). -It can be a comma separated list of assignees (e.g: `marco,polo`). +A white-list of milestone(s) to only process the pull requests that does not contain one of these milestone(s). +It can be a comma separated list of milestones (e.g: `V1,next`). If unset (or an empty string), this option will not alter the stale workflow. Default value: unset +#### exempt-all-pr-milestones + +If set to `true`, the pull requests with a milestone will not be marked as stale automatically. + +Priority over [exempt-pr-milestones](#exempt-pr-milestones). + +Default value: `false` + #### exempt-pr-assignees An allow-list of assignee(s) to only process the pull requests that does not contain one of these assignee(s). @@ -431,14 +459,6 @@ If unset (or an empty string), this option will not alter the stale workflow. Default value: unset -#### exempt-all-issue-assignees - -If set to `true`, the issues with an assignee will not be marked as stale automatically. - -Priority over [exempt-issue-assignees](#exempt-issue-assignees). - -Default value: `false` - #### exempt-all-pr-assignees If set to `true`, the pull requests with an assignee will not be marked as stale automatically. @@ -455,22 +475,6 @@ If set to `true`, the pull requests currently in draft will not be marked as sta Default value: `false` Required Permission: `pull-requests: read` -#### enable-statistics - -Collects and display statistics at the end of the stale workflow logs to get a summary of what happened during the run. -This option is only useful if the debug output secret `ACTIONS_STEP_DEBUG` is set to `true` in your repository to display the logs. - -Default value: `true` - -#### 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. -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: `false` - #### ignore-pr-updates 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.