diff --git a/src/server/api/issues.ts b/src/server/api/issues.ts index 41592dc..e25ebbf 100644 --- a/src/server/api/issues.ts +++ b/src/server/api/issues.ts @@ -61,6 +61,7 @@ export async function getExtractedIssues(req: Request, res: Response) { issueData.map(async ({ data: issue }) => { const issueBody = issue.body ? `\n${issue.body}` : ""; const issueText = `${issue.title}${issueBody}`; + const skipBuild = issueText.includes("--skip-build"); const extractedIssueTemplateParams = { sourceMap, @@ -89,6 +90,7 @@ export async function getExtractedIssues(req: Request, res: Response) { return { issueNumber: issue.number, ...extractedIssue, + skipBuild, }; }), ); diff --git a/src/server/build/node/check.ts b/src/server/build/node/check.ts index 8701d34..aed22dd 100644 --- a/src/server/build/node/check.ts +++ b/src/server/build/node/check.ts @@ -48,6 +48,7 @@ export function getEnv(repoSettings?: RepoSettings) { export interface RunBuildCheckParams extends BaseEventData { path: string; afterModifications: boolean; + skipBuild?: boolean; repoSettings?: RepoSettings; } @@ -55,6 +56,7 @@ export async function runBuildCheck({ path, afterModifications, repoSettings, + skipBuild = false, ...baseEventData }: RunBuildCheckParams): ExecPromise { const env = getEnv(repoSettings); @@ -107,6 +109,9 @@ export async function runBuildCheck({ ); } } + if (skipBuild) { + return { stdout: "Build skipped", stderr: "" }; + } const buildResult = await executeWithLogRequiringSuccess({ ...baseEventData, directory: path, diff --git a/src/server/code/extractedIssue.ts b/src/server/code/extractedIssue.ts index 1b1a583..6586373 100644 --- a/src/server/code/extractedIssue.ts +++ b/src/server/code/extractedIssue.ts @@ -3,6 +3,7 @@ import { z } from "zod"; export const ExtractedIssueInfoSchema = z.object({ stepsToAddressIssue: z.string().nullable().optional(), // a step-by-step plan of how a developer would address the given issue issueQualityScore: z.number().nullable().optional(), // a score from 0 to 5 indicating the quality of the GitHub issue and the confidence that a large language model can generate the correct code to address this issue on its first attempt. Use the evaluation criteria to determine the score. + skipBuild: z.boolean().optional(), // a flag indicating whether to skip the build process commitTitle: z.string().nullable().optional(), // a brief git commit title no longer than 50 characters explaining the changes that need to be made filesToCreate: z.array(z.string()).nullable().optional(), // an array of file paths that will be created by the developer. The paths CANNOT be in the source map's list of valid file names. filesToUpdate: z.array(z.string()).nullable().optional(), // an array of file paths that will be updated by the developer. The paths MUST be in the source map's list of valid file names. diff --git a/src/server/messaging/queue.ts b/src/server/messaging/queue.ts index e32241c..5e3548e 100644 --- a/src/server/messaging/queue.ts +++ b/src/server/messaging/queue.ts @@ -195,6 +195,7 @@ async function onReposAdded( isNodeRepo = await isNodeProject(repository, installationAuthentication); const project = await addProjectToDB(repo, event.id, event.name); const baseEventData = { + skipBuild: false, projectId: project.id, repoFullName: repo.full_name, userId: distinctId, @@ -345,6 +346,7 @@ export async function onGitHubEvent(event: WebhookQueuedEvent) { : ""; const baseEventData = { + skipBuild: body?.includes("--skip-build") ?? false, projectId: project.id, repoFullName: repository.full_name, userId: distinctId, diff --git a/src/server/utils/todos.ts b/src/server/utils/todos.ts index 80794ea..f46cc6a 100644 --- a/src/server/utils/todos.ts +++ b/src/server/utils/todos.ts @@ -45,6 +45,7 @@ export const createTodo = async ( const issueBody = issue.body ? `\n${issue.body}` : ""; const issueText = `${issue.title}${issueBody}`; + const skipBuild = issueText.includes("--skip-build"); let cleanupClone: (() => Promise) | undefined; try { @@ -75,6 +76,7 @@ export const createTodo = async ( newTodo?.id, issueNumber, rootPath, + skipBuild, ); }