Set maximum open simulator-created issues

This commit is contained in:
Jussi Saurio
2025-06-03 15:34:32 +03:00
parent a8106a0bbd
commit 3caf10d42f

View File

@@ -25,6 +25,8 @@ type FaultTimeout = {
type Fault = FaultPanic | FaultTimeout | FaultAssertion;
const MAX_OPEN_SIMULATOR_ISSUES = parseInt(process.env.MAX_OPEN_SIMULATOR_ISSUES || "10", 10);
export class GithubClient {
/* This is the git hash of the commit that the simulator was built from. */
GIT_HASH: string;
@@ -106,6 +108,12 @@ export class GithubClient {
return;
}
if (this.openIssueTitles.length >= MAX_OPEN_SIMULATOR_ISSUES) {
console.log(`Max open simulator issues reached: ${MAX_OPEN_SIMULATOR_ISSUES}`);
console.log(`Would create issue in ${this.GITHUB_REPO} with title: ${title} and body: ${body}`);
return;
}
const [owner, repo] = this.GITHUB_REPO.split('/');
const octokit = await this.app!.getInstallationOctokit(this.GITHUB_APP_INSTALLATION_ID);