Skip to content

Commit

Permalink
use stalebot on issues that are waiting for community (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
hubertdeng123 authored Jul 6, 2023
1 parent 5e0afa6 commit 6c1342f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const IN_PROGRESS_LABEL = 'Status: In Progress';
export const UNTRIAGED_LABEL = 'Status: Untriaged';
export const UNROUTED_LABEL = 'Status: Unrouted';
export const UNKNOWN_LABEL = 'Status: Unknown';
export const STALE_LABEL = 'Status: Stale';
export const STALE_LABEL = 'Stale';
export const WAITING_FOR_LABEL_PREFIX = 'Waiting for: ';
export const WAITING_FOR_SUPPORT_LABEL = 'Waiting for: Support';
export const WAITING_FOR_COMMUNITY_LABEL = 'Waiting for: Community';
Expand Down
4 changes: 2 additions & 2 deletions src/webhooks/pubsub/stalebot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('Stalebot Tests', function () {
expect(octokit.issues._comments).toEqual([
`This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it \`Status: Backlog\` or \`Status: In Progress\`, I will leave it alone ... forever!
But! If you comment or otherwise update it, I will reset the clock, and if you remove the label \`Waiting for: Community\`, I will leave it alone ... forever!
----
Expand Down Expand Up @@ -82,7 +82,7 @@ But! If you comment or otherwise update it, I will reset the clock, and if you l
expect(octokit.issues._comments).toEqual([
`This pull request has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it \`Status: Backlog\` or \`Status: In Progress\`, I will leave it alone ... forever!
But! If you comment or otherwise update it, I will reset the clock, and if you remove the label \`Waiting for: Community\`, I will leave it alone ... forever!
----
Expand Down
8 changes: 4 additions & 4 deletions src/webhooks/pubsub/stalebot.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Octokit } from '@octokit/rest';
import moment from 'moment-timezone';

import { OWNER, STALE_LABEL } from '@/config';
import { OWNER, STALE_LABEL, WAITING_FOR_COMMUNITY_LABEL } from '@/config';

const GH_API_PER_PAGE = 100;
const DAYS_BEFORE_STALE = 21;
Expand Down Expand Up @@ -54,7 +54,7 @@ const staleStatusUpdater = async (
isPullRequest ? 'pull request' : 'issue'
} has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it \`Status: Backlog\` or \`Status: In Progress\`, I will leave it alone ... forever!
But! If you comment or otherwise update it, I will reset the clock, and if you remove the label \`Waiting for: Community\`, I will leave it alone ... forever!
----
Expand All @@ -73,13 +73,13 @@ export const triggerStaleBot = async (
octokit: Octokit,
now: moment.Moment
) => {
// Get all open issues and pull requests
// Get all open issues and pull requests that are Waiting for Community
repos.forEach(async (repo: string) => {
const issues = await octokit.paginate(octokit.issues.listForRepo, {
owner: OWNER,
repo,
state: 'open',
// labels: WAITING_FOR_COMMUNITY_LABEL,
labels: WAITING_FOR_COMMUNITY_LABEL,
per_page: GH_API_PER_PAGE,
});
await staleStatusUpdater(repo, issues, octokit, now);
Expand Down

0 comments on commit 6c1342f

Please sign in to comment.