From a3694b4458a3b1b751822bcad7f4035a493596ef Mon Sep 17 00:00:00 2001 From: "jacob-local-kevin[bot]" <164088400+jacob-local-kevin[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 13:09:44 -0700 Subject: [PATCH 1/5] Add skipBuild flag to RunBuildCheckParams --- src/server/build/node/check.ts | 5 +++++ 1 file changed, 5 insertions(+) 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, From 80e25ee3b0a55e81c734ac86bd085ad0e93d8954 Mon Sep 17 00:00:00 2001 From: "jacob-local-kevin[bot]" <164088400+jacob-local-kevin[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 13:10:24 -0700 Subject: [PATCH 2/5] Extract skipBuild flag from GitHub issue text --- src/server/messaging/queue.ts | 2 ++ 1 file changed, 2 insertions(+) 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, From 1fb7730836e71c18d633ffbf77d951406ac5210c Mon Sep 17 00:00:00 2001 From: "jacob-local-kevin[bot]" <164088400+jacob-local-kevin[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 13:10:48 -0700 Subject: [PATCH 3/5] Pass skipBuild flag in createTodo function --- src/server/utils/todos.ts | 2 ++ 1 file changed, 2 insertions(+) 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, ); } From 390a0a2e7060d88f3df3501bf891444cd72e43b3 Mon Sep 17 00:00:00 2001 From: "jacob-local-kevin[bot]" <164088400+jacob-local-kevin[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 13:11:08 -0700 Subject: [PATCH 4/5] Include skipBuild flag in extracted issue information --- src/server/api/issues.ts | 2 ++ 1 file changed, 2 insertions(+) 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, }; }), ); From f5c2432441c8ebdcbc9a25eed65913b313cee4c8 Mon Sep 17 00:00:00 2001 From: "jacob-local-kevin[bot]" <164088400+jacob-local-kevin[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 13:11:29 -0700 Subject: [PATCH 5/5] Add skipBuild field to ExtractedIssueInfoSchema --- src/server/code/extractedIssue.ts | 1 + 1 file changed, 1 insertion(+) 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.