Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to consider reactions #1086

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Every argument is optional.
| [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 | |
| [ignore-reactions](#ignore-reactions) | Any reaction can reset the stale idle time on the issues/PRs | |
| [include-only-assigned](#include-only-assigned) | Process only assigned issues | `false` |

### List of output options
Expand Down Expand Up @@ -541,6 +542,12 @@ Useful to override [ignore-updates](#ignore-updates) but only to ignore the upda

Default value: unset

#### ignore-reactions

If set to `false`, any reaction to an issue will be considered an update.

Default value: unset

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally would have this set by default


#### include-only-assigned

If set to `true`, only the issues or the pull requests with an assignee will be marked as stale automatically.
Expand Down
1 change: 1 addition & 0 deletions __tests__/any-of-labels.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,7 @@ class IssuesProcessorBuilder {
new StateMock(),
async p => (p === 1 ? this._issues : []),
async () => [],
async () => [],
async () => new Date().toDateString()
);
}
Expand Down
1 change: 1 addition & 0 deletions __tests__/assignees.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ describe('assignees options', (): void => {
alwaysFalseStateMock,
async p => (p === 1 ? testIssueList : []),
async () => [],
async () => [],
async () => new Date().toDateString()
);
};
Expand Down
9 changes: 9 additions & 0 deletions __tests__/classes/issues-processor-mock.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Issue} from '../../src/classes/issue';
import {IssuesProcessor} from '../../src/classes/issues-processor';
import {IComment} from '../../src/interfaces/comment';
import {IReaction} from '../../src/interfaces/reaction';
import {IIssuesProcessorOptions} from '../../src/interfaces/issues-processor-options';
import {IPullRequest} from '../../src/interfaces/pull-request';
import {IState} from '../../src/interfaces/state/state';
Expand All @@ -14,6 +15,10 @@ export class IssuesProcessorMock extends IssuesProcessor {
issue: Issue,
sinceDate: string
) => Promise<IComment[]>,
listIssueReactions?: (
issue: Issue,
sinceDate: string
) => Promise<IReaction[]>,
getLabelCreationDate?: (
issue: Issue,
label: string
Expand All @@ -30,6 +35,10 @@ export class IssuesProcessorMock extends IssuesProcessor {
this.listIssueComments = listIssueComments;
}

if (listIssueReactions) {
this.listIssueReactions = listIssueReactions;
}

if (getLabelCreationDate) {
this.getLabelCreationDate = getLabelCreationDate;
}
Expand Down
1 change: 1 addition & 0 deletions __tests__/constants/default-processor-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const DefaultProcessorOptions: IIssuesProcessorOptions = Object.freeze({
ignoreUpdates: false,
ignoreIssueUpdates: undefined,
ignorePrUpdates: undefined,
ignoreReactions: undefined,
exemptDraftPr: false,
closeIssueReason: 'not_planned',
includeOnlyAssigned: false
Expand Down
1 change: 1 addition & 0 deletions __tests__/exempt-draft-pr.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ class IssuesProcessorBuilder {
alwaysFalseStateMock,
async p => (p === 1 ? this._issues : []),
async () => [],
async () => [],
async () => new Date().toDateString(),
async (): Promise<IPullRequest> => {
return Promise.resolve({
Expand Down
Loading
Loading