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

fix: allow more than 99 PRs/branches per repository #24705

Merged
merged 1 commit into from
Sep 30, 2023
Merged
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
10 changes: 5 additions & 5 deletions lib/workers/repository/process/limits.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ describe('workers/repository/process/limits', () => {
expect(res).toBe(5);
});

it('returns 99 if no hourly limit', async () => {
it('returns MAX_SAFE_INTEGER if no hourly limit', async () => {
config.prHourlyLimit = 0;
const res = await limits.getPrHourlyRemaining(config);
expect(res).toBe(99);
expect(res).toBe(Number.MAX_SAFE_INTEGER);
});
});

Expand All @@ -74,10 +74,10 @@ describe('workers/repository/process/limits', () => {
expect(res).toBe(19);
});

it('returns 99 if no concurrent limit', async () => {
it('returns MAX_SAFE_INTEGER if no concurrent limit', async () => {
config.prConcurrentLimit = 0;
const res = await limits.getConcurrentPrsRemaining(config, []);
expect(res).toBe(99);
expect(res).toBe(Number.MAX_SAFE_INTEGER);
});
});

Expand Down Expand Up @@ -120,7 +120,7 @@ describe('workers/repository/process/limits', () => {
config.branchConcurrentLimit = 0;
config.prConcurrentLimit = 20;
const res = await limits.getConcurrentBranchesRemaining(config, []);
expect(res).toBe(99);
expect(res).toBe(Number.MAX_SAFE_INTEGER);
});

it('returns 10 if no limits are set', async () => {
Expand Down
6 changes: 3 additions & 3 deletions lib/workers/repository/process/limits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function getPrHourlyRemaining(
return config.prHourlyLimit;
}
}
return 99;
return Number.MAX_SAFE_INTEGER;
}

export async function getConcurrentPrsRemaining(
Expand Down Expand Up @@ -78,7 +78,7 @@ export async function getConcurrentPrsRemaining(
return config.prConcurrentLimit;
}
}
return 99;
return Number.MAX_SAFE_INTEGER;
}

export async function getPrsRemaining(
Expand Down Expand Up @@ -124,7 +124,7 @@ export async function getConcurrentBranchesRemaining(
return limit;
}
}
return 99;
return Number.MAX_SAFE_INTEGER;
}

export async function getBranchesRemaining(
Expand Down