Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Close unfixed pull requests at 72 hours with a reminder 24 hours before

Nguyen Xuan An9952652eba8b
diff --git a/.github/workflows/pr-metadata.yml b/.github/workflows/pr-metadata.yml
index 05057f71..be96692e 100644
--- a/.github/workflows/pr-metadata.yml
+++ b/.github/workflows/pr-metadata.yml
@@ -3,8 +3,8 @@ name: PR metadata
# A friendly check of the pull request description, files and labels against CONTRIBUTING.md. It is not a required check.
# It runs on pull_request_target so that it can comment on pull requests from forks. For that reason it NEVER checks out,
# builds or runs the pull request's code: the checkout is the base branch (the default for this event), and the pull request
-# is read through the API only. Keep it that way. The hourly schedule sends the 5 day reminder and closes pull requests
-# that stayed unfixed for 7 days. How it works and how to test it: CONTRIBUTING.md#the-pull-request-check.
+# is read through the API only. Keep it that way. The hourly schedule sends the reminder 24 hours before the close and closes pull requests
+# that stayed unfixed for 72 hours. How it works and how to test it: CONTRIBUTING.md#the-pull-request-check.
on:
pull_request_target:
types: [opened, edited, synchronize, reopened, labeled, unlabeled, milestoned, demilestoned, ready_for_review]
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ec6297db..476837db 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -127,8 +127,8 @@ The `PR metadata` workflow checks each pull request against this guide. It posts
Docs-only, CI-only and test-only pull requests skip everything except the local path check.
-- The comment updates itself when you fix an item. One reminder follows after 5 days.
-- A maintainer gives a first answer within about 7 days. That reply time is separate from the bot clock, which counts only items on your side. If an item is still open 7 days after the first comment (the end of that UTC day, weekends included), the bot closes the pull request. It invites you to reopen it once the item is fixed, and reopening starts the time again.
+- The comment updates itself when you fix an item. One reminder follows when 24 hours are left.
+- A maintainer gives a first answer within about 7 days. That reply time is separate from the bot clock, which counts only items on your side. If an item is still open 72 hours after the first comment (the end of that UTC day, weekends included), the bot closes the pull request. It invites you to reopen it once the item is fixed, and reopening starts the time again.
- Pull requests from the owner, members, collaborators and bots never close by themselves. Drafts and pull requests labelled `needs-owner-decision` do not close either.
- Labels and the milestone never count against you. The bot adds `needs-triage` when they are missing and `status:needs-author` while something of yours is missing.
diff --git a/scripts/pr-metadata-flow.mjs b/scripts/pr-metadata-flow.mjs
index ce855ce2..9da90751 100644
--- a/scripts/pr-metadata-flow.mjs
+++ b/scripts/pr-metadata-flow.mjs
@@ -1,14 +1,14 @@
// The time rules and the wording of the `PR metadata` bot. Pure, so tests call it without GitHub.
// The bot keeps one status comment per pull request and finds it by a hidden marker. The marker also holds the time of the
-// first failing comment, which starts the 7 day clock, and the time of the one reminder.
+// first failing comment, which starts the 72 hour clock, and the time of the one reminder.
import { NEEDS_OWNER_DECISION_LABEL } from './pr-metadata-check.mjs';
export const STATUS_MARKER = 'pr-metadata-status';
export const REMINDER_MARKER = 'pr-metadata-reminder';
export const CLOSE_MARKER = 'pr-metadata-closed';
export const HOUR_MS = 60 * 60 * 1000;
-export const REMINDER_AFTER_HOURS = 120;
-export const CLOSE_AFTER_HOURS = 168;
+export const REMINDER_AFTER_HOURS = 48;
+export const CLOSE_AFTER_HOURS = 72;
const guideUrl = 'https://github.com/codepawl/67.js/blob/main/CONTRIBUTING.md';
@@ -76,7 +76,7 @@ export function renderReminderComment({ contributorFixes, closeDate }) {
export function renderCloseComment() {
return [
buildMarker(CLOSE_MARKER),
- 'Thank you for the work on this. We are closing the pull request because the items above stayed open for 7 days. Nothing is lost and there is no rush: reopen it whenever you are ready.',
+ 'Thank you for the work on this. We are closing the pull request because the items above stayed open for 72 hours. Nothing is lost and there is no rush: reopen it whenever you are ready.',
'',
`Once they are fixed, reopen it and the check runs again. Details are in the [contributing guide](${guideUrl}).`,
].join('\n');
diff --git a/tests/pr-metadata-check.test.js b/tests/pr-metadata-check.test.js
index 1aa543f8..964b2d17 100644
--- a/tests/pr-metadata-check.test.js
+++ b/tests/pr-metadata-check.test.js
@@ -203,7 +203,7 @@ test('sectionOf reads a section up to the next heading', () => {
const someFix = [{ id: 'x', message: 'Fix x.', docsAnchor: 'link-the-issue' }];
-test('the clock starts at the first failure, reminds once at 5 days and closes at 7', () => {
+test('the clock starts at the first failure, reminds once 24 hours before the close and closes at 72 hours', () => {
const start = Date.parse('2026-11-01T00:00:00.000Z');
const base = { contributorFixes: someFix, exempt: false, draft: false, labels: [] };
const first = decideActions({ ...base, now: start, previousState: null });
@@ -214,7 +214,7 @@ test('the clock starts at the first failure, reminds once at 5 days and closes a
assert.ok(!early.remind);
const reminder = decideActions({ ...base, now: start + REMINDER_AFTER_HOURS * HOUR_MS, previousState: state });
assert.ok(reminder.remind && !reminder.close);
- assert.equal(reminder.closeDate, '2026-11-08');
+ assert.equal(reminder.closeDate, '2026-11-04');
const again = decideActions({ ...base, now: start + (REMINDER_AFTER_HOURS + 2) * HOUR_MS, previousState: reminder.statusState });
assert.ok(!again.remind);
const closing = decideActions({ ...base, now: start + CLOSE_AFTER_HOURS * HOUR_MS, previousState: reminder.statusState });
@@ -251,7 +251,7 @@ test('the marker round trips and the comment stays warm and short', () => {
assert.match(comment, /^<!-- pr-metadata-status firstFailedAt=2026-11-01T00:00:00.000Z -->/);
assert.match(comment, /Thank you/);
assert.match(comment, /CONTRIBUTING\.md#link-the-issue/);
- assert.match(comment, /2026-11-08/);
+ assert.match(comment, /2026-11-04/);
assert.match(comment, /first answer within about 7 days/);
});
@@ -303,7 +303,7 @@ test('the runner posts one friendly comment for a new pull request and labels it
assert.ok(!names.includes('closePullRequest'));
});
-test('the runner closes a pull request that stayed unfixed for 7 days, and never an owner one', async () => {
+test('the runner closes a pull request that stayed unfixed for 72 hours, and never an owner one', async () => {
const marker = buildMarker('pr-metadata-status', { firstFailedAt: '2026-11-01T00:00:00.000Z' });
const comments = [{ id: 9, user: { login: 'github-actions[bot]' }, body: `${marker}\nold` }];
const now = Date.parse('2026-11-09T00:00:00Z');