cold-start: split regression execution into executor module#42
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR refactors regression execution by extracting
Confidence Score: 5/5Safe to merge — the change is a clean mechanical extraction with no logic modifications. The extraction faithfully mirrors the old logic from runs.ts into executor.ts without altering any business rules. The dynamic imports for createAgentRun and maybeStartAgentRun are the only behavioural change and they improve, not regress, the situation. The concerns previously raised (in-memory dedup across serverless instances, remaining static imports of evaluateRun/findRun) were flagged in earlier review rounds and are not introduced by this PR. No files require special attention; executor.ts is the only new file and its logic is a direct lift from the prior runs.ts. Important Files Changed
Sequence DiagramsequenceDiagram
participant WH as webhooks.ts
participant API as +server.ts (POST)
participant Runs as regression/runs.ts
participant Exec as regression/executor.ts
participant DB as Database
participant Agent as agent-runner/service (dynamic)
participant GH as github/checks (dynamic)
WH->>Runs: createRegressionRunForRepository()
Runs->>DB: insert regressionRun + caseRuns
Runs-->>WH: "{ regressionRun, suite }"
WH->>Exec: scheduleRegressionRun(id)
API->>Runs: createRegressionRun()
Runs->>DB: insert regressionRun + caseRuns
Runs-->>API: regressionRun
API->>Exec: scheduleRegressionRun(id)
API-->>API: return 201 (fire-and-forget)
Note over Exec: void executeRegressionRun() async
Exec->>DB: fetch regressionRun + caseRuns
Exec->>DB: "set status = 'running'"
loop For each pending caseRun
Exec->>DB: "set caseRun status = 'running'"
Exec->>Agent: await import() createAgentRun + maybeStartAgentRun
Exec->>Exec: waitForRunCompletion (poll 2s, max 10min)
Exec->>Exec: evaluateRun() [static import]
Exec->>DB: update caseRun (success/failed)
Exec->>GH: await import() updateRegressionCheckRun
end
Exec->>DB: aggregateSuiteResult update regressionRun
Exec->>GH: updateRegressionCheckRun (final)
Reviews (2): Last reviewed commit: "Move regression run execution into a ded..." | Re-trigger Greptile |
Agent runner imports are deferred until a regression case actually runs, keeping Playwright out of webhook and regression CRUD bundles.
555a83c to
2a72555
Compare

Stack Context
This stack reduces Vercel cold-start time by shrinking the shared SvelteKit server boot path and isolating heavy agent/GitHub dependencies.
Why?
regression/runs.tsstatically imported the agent runner, so webhook and regression CRUD routes bundled Playwright even when no agent work ran. Execution moves toexecutor.tswith dynamic agent-runner imports when a case actually starts.Test plan