mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:16:44 +00:00
fix(ci): make pr-ci-sweeper clock injectable so lookback fixtures cannot rot
This commit is contained in:
@@ -131,13 +131,21 @@ async function reopenWithRetry({ github, core, owner, repo, pullNumber }) {
|
||||
return false;
|
||||
}
|
||||
|
||||
export async function runPrCiSweeper({ github, context, core, dryRun = false, appSlug = "" }) {
|
||||
export async function runPrCiSweeper({
|
||||
github,
|
||||
context,
|
||||
core,
|
||||
dryRun = false,
|
||||
appSlug = "",
|
||||
// Injectable clock: fixture-based tests pin a fixed instant so lookback
|
||||
// classification cannot rot as wall-clock time passes the fixture dates.
|
||||
now = Date.now(),
|
||||
}) {
|
||||
const sweeperLogins = new Set(KNOWN_SWEEPER_LOGINS);
|
||||
if (appSlug) {
|
||||
sweeperLogins.add(`${appSlug}[bot]`);
|
||||
}
|
||||
const { owner, repo } = context.repo;
|
||||
const now = Date.now();
|
||||
const results = [];
|
||||
let refires = 0;
|
||||
const openPrs = await github.paginate(github.rest.pulls.list, {
|
||||
|
||||
Reference in New Issue
Block a user