diff --git a/apps/service/src/consts/schemas.ts b/apps/service/src/consts/schemas.ts index 9d2aea5..c712378 100644 --- a/apps/service/src/consts/schemas.ts +++ b/apps/service/src/consts/schemas.ts @@ -21,60 +21,6 @@ export const BaseGetRequestSchema = { additionalProperties: false, }; -export const ProjectAuthHeaders = { - $id: '#/definitions/ProjectAuthHeaders', - type: 'object', - properties: { - 'x-api-key': { - type: 'string', - minLength: 1, - }, - }, - required: ['x-api-key'], - additionalProperties: false, -}; - -export const GithubActionsAuthHeaders = { - $id: '#/definitions/GithubActionsAuthHeaders', - type: 'object', - properties: { - 'bundlemon-auth-type': { - type: 'string', - const: 'GITHUB_ACTION', - }, - 'github-owner': { - type: 'string', - minLength: 1, - }, - 'github-repo': { - type: 'string', - minLength: 1, - }, - 'github-run-id': { - type: 'string', - minLength: 1, - pattern: '^\\d+$', - }, - }, - required: ['bundlemon-auth-type', 'github-owner', 'github-repo', 'github-run-id'], - additionalProperties: false, -}; - -export const AuthHeaders = { - $id: '#/definitions/AuthHeaders', - anyOf: [ - { - type: 'object', - }, - { - $ref: '#/definitions/ProjectAuthHeaders', - }, - { - $ref: '#/definitions/GithubActionsAuthHeaders', - }, - ], -}; - export const ProjectIdParams = { $id: '#/definitions/ProjectIdParams', type: 'object', @@ -177,11 +123,9 @@ export const CreateCommitRecordRequestSchema = { params: { $ref: '#/definitions/ProjectIdParams', }, - headers: { - $ref: '#/definitions/AuthHeaders', - }, + headers: {}, }, - required: ['body', 'params', 'query', 'headers'], + required: ['body', 'params', 'query'], additionalProperties: false, }; @@ -941,74 +885,6 @@ export const PostGithubPRCommentRequestSchema = { additionalProperties: false, }; -export const LegacyGithubOutputRequestSchema = { - $id: '#/definitions/LegacyGithubOutputRequestSchema', - type: 'object', - properties: { - body: { - type: 'object', - properties: { - report: { - $ref: '#/definitions/Report', - }, - git: { - type: 'object', - properties: { - owner: { - type: 'string', - }, - repo: { - type: 'string', - }, - commitSha: { - type: 'string', - }, - prNumber: { - type: 'string', - }, - }, - required: ['owner', 'repo', 'commitSha'], - additionalProperties: false, - }, - output: { - type: 'object', - properties: { - checkRun: { - type: 'boolean', - }, - commitStatus: { - type: 'boolean', - }, - prComment: { - type: 'boolean', - }, - }, - additionalProperties: false, - }, - }, - required: ['report', 'git', 'output'], - additionalProperties: false, - }, - query: {}, - params: { - type: 'object', - properties: { - projectId: { - type: 'string', - pattern: '^[0-9a-fA-F]{24}$', - }, - }, - required: ['projectId'], - additionalProperties: false, - }, - headers: { - $ref: '#/definitions/AuthHeaders', - }, - }, - required: ['body', 'params', 'headers'], - additionalProperties: false, -}; - export const GithubOutputRequestSchema = { $id: '#/definitions/GithubOutputRequestSchema', type: 'object', diff --git a/apps/service/src/controllers/commitRecordsController.ts b/apps/service/src/controllers/commitRecordsController.ts index fae9b6e..dd1e2a9 100644 --- a/apps/service/src/controllers/commitRecordsController.ts +++ b/apps/service/src/controllers/commitRecordsController.ts @@ -41,9 +41,8 @@ export const createCommitRecordController: FastifyValidatedRoute v2.0.0 export const githubOutputController: FastifyValidatedRoute = async (req, res) => { try { const { diff --git a/apps/service/src/controllers/legacyGithubController.ts b/apps/service/src/controllers/legacyGithubController.ts deleted file mode 100644 index 00df470..0000000 --- a/apps/service/src/controllers/legacyGithubController.ts +++ /dev/null @@ -1,227 +0,0 @@ -// This file is deprecated - -import { Status, getReportConclusionText } from 'bundlemon-utils'; -import { - getInstallationId, - createCheck, - createCommitStatus, - createOrUpdatePRComment, - genCommentIdentifier, - createOctokitClientByInstallationId, -} from '../framework/github'; -import { generateReportMarkdownWithLinks } from './utils/markdownReportGenerator'; -import { checkAuth } from './utils/auth'; -import { createGithubOutputs } from './utils/githubOutputs'; - -import type { - FastifyValidatedRoute, - CreateGithubCheckRequestSchema, - CreateGithubCommitStatusRequestSchema, - PostGithubPRCommentRequestSchema, - LegacyGithubOutputRequestSchema, - AuthHeaders, -} from '../types/schemas'; -import type { FastifyReply } from 'fastify'; -import type { Octokit } from '@octokit/rest'; - -export interface GetGithubAppTokenParams { - projectId: string; - headers: AuthHeaders; - owner: string; - repo: string; -} - -async function getInstallationOctokit({ projectId, headers, owner, repo }: GetGithubAppTokenParams, res: FastifyReply) { - const authResult = await checkAuth(projectId, headers, {}, undefined, res.log); - - if (!authResult.authenticated) { - res.status(403).send({ message: authResult.error }); - return; - } - - if (authResult.installationOctokit) { - return authResult.installationOctokit; - } - - let installationOctokit: Octokit | undefined = authResult.installationOctokit; - - if (!installationOctokit) { - const installationId = await getInstallationId(owner, repo); - - if (!installationId) { - res.log.info({ projectId, owner, repo }, 'BundleMon GitHub app is not installed on this repo'); - res.status(400).send({ - error: `BundleMon GitHub app is not installed on this repo (${owner}/${repo})`, - }); - return; - } - - installationOctokit = createOctokitClientByInstallationId(installationId); - } - - return installationOctokit; -} - -// bundlemon <= v0.4.0 -export const createGithubCheckController: FastifyValidatedRoute = async (req, res) => { - try { - const { - params: { projectId }, - headers, - body: { - git: { owner, repo, commitSha }, - report, - }, - } = req; - - const installationOctokit = await getInstallationOctokit({ projectId, headers, owner, repo }, res); - - if (!installationOctokit) { - return; - } - - const summary = generateReportMarkdownWithLinks(report); - - req.log.info(`summary length: ${summary.length}`); - - const checkRes = await createCheck({ - owner, - repo, - commitSha, - installationOctokit, - detailsUrl: report.metadata.linkToReport || undefined, - title: getReportConclusionText(report), - summary, - conclusion: report.status === Status.Pass ? 'success' : 'failure', - log: req.log, - }); - - res.send(checkRes); - } catch (err) { - req.log.error(err); - - res.status(500).send({ - message: 'failed to create check', - error: (err as Error).message, - }); - } -}; - -// bundlemon <= v0.4.0 -export const createGithubCommitStatusController: FastifyValidatedRoute = async ( - req, - res -) => { - try { - const { - params: { projectId }, - headers, - body: { - git: { owner, repo, commitSha }, - report, - }, - } = req; - - const installationOctokit = await getInstallationOctokit({ projectId, headers, owner, repo }, res); - - if (!installationOctokit) { - return; - } - - const checkRes = await createCommitStatus({ - owner, - repo, - commitSha, - installationOctokit, - state: report.status === Status.Pass ? 'success' : 'error', - description: getReportConclusionText(report), - targetUrl: report.metadata.linkToReport || undefined, - log: req.log, - }); - - res.send(checkRes); - } catch (err) { - req.log.error(err); - - res.status(500).send({ - message: 'failed to create commit status', - error: (err as Error).message, - }); - } -}; - -// bundlemon <= v0.4.0 -export const postGithubPRCommentController: FastifyValidatedRoute = async ( - req, - res -) => { - try { - const { - params: { projectId }, - headers, - body: { - git: { owner, repo, prNumber }, - report, - }, - } = req; - - const installationOctokit = await getInstallationOctokit({ projectId, headers, owner, repo }, res); - - if (!installationOctokit) { - return; - } - - const body = `${genCommentIdentifier()}\n## BundleMon\n${generateReportMarkdownWithLinks(report)}`; - - const checkRes = await createOrUpdatePRComment({ - owner, - repo, - prNumber, - installationOctokit, - body, - log: req.log, - }); - - res.send(checkRes); - } catch (err) { - req.log.error(err); - - res.status(500).send({ - message: 'failed to post PR comment', - error: (err as Error).message, - }); - } -}; - -// bundlemon > v0.4 -export const legacyGithubOutputController: FastifyValidatedRoute = async ( - req, - res -) => { - try { - const { - params: { projectId }, - headers, - body: { git, report, output }, - } = req; - const { owner, repo } = git; - const { subProject } = report.metadata; - - const installationOctokit = await getInstallationOctokit({ projectId, headers, owner, repo }, res); - - if (!installationOctokit) { - return; - } - - const response = await createGithubOutputs({ git, output, report, subProject, installationOctokit, log: req.log }); - - res.send(response); - } catch (err) { - req.log.error(err); - - res.status(500).send({ - message: 'failed to post GitHub output', - error: (err as Error).message, - }); - } -}; diff --git a/apps/service/src/controllers/utils/auth.ts b/apps/service/src/controllers/utils/auth.ts index 385f7d3..34eb28e 100644 --- a/apps/service/src/controllers/utils/auth.ts +++ b/apps/service/src/controllers/utils/auth.ts @@ -6,7 +6,7 @@ import { CreateCommitRecordAuthType } from '../../consts/commitRecords'; import { isGitHubProject } from '../../utils/projectUtils'; import type { FastifyBaseLogger } from 'fastify'; -import type { AuthHeaders, CreateCommitRecordRequestQuery, GithubActionsAuthHeaders } from '../../types/schemas'; +import type { CreateCommitRecordRequestQuery } from '../../types/schemas'; type CheckAuthResponse = | { @@ -24,7 +24,6 @@ type CheckAuthResponse = */ export async function checkAuth( projectId: string, - headers: AuthHeaders, query: CreateCommitRecordRequestQuery, commitSha: string | undefined, log: FastifyBaseLogger @@ -36,16 +35,6 @@ export async function checkAuth( return { authenticated: false, error: 'forbidden' }; } - // deprecated cli v1 - if ('x-api-key' in headers) { - return handleApiKeyAuth(project, headers['x-api-key'], log); - } - - // deprecated cli v1 - if (headers['bundlemon-auth-type'] === 'GITHUB_ACTION') { - return handleLegacyGithubActionAuth(project, headers as GithubActionsAuthHeaders, log); - } - if ('authType' in query) { switch (query.authType) { case CreateCommitRecordAuthType.ProjectApiKey: { @@ -78,27 +67,6 @@ async function handleApiKeyAuth(project: Project, apiKey: string, log: FastifyBa return { authenticated: isAuthenticated, error: 'forbidden' }; } -async function handleLegacyGithubActionAuth( - project: Project, - headers: GithubActionsAuthHeaders, - log: FastifyBaseLogger -): Promise { - const { 'github-owner': owner, 'github-repo': repo, 'github-run-id': runId } = headers; - - if (!owner || !repo || !runId) { - log.warn({ projectId: project.id }, 'legacy github auth: empty params'); - return { authenticated: false, error: 'forbidden' }; - } - - // TODO: uncomment - // if ('provider' in project) { - // log.warn({ projectId: project.id }, 'legacy github auth works only with old projects'); - // return { authenticated: false, error: 'legacy github auth works only with old projects' }; - // } - - return createOctokitClientByAction({ owner, repo, runId }, log); -} - async function handleGithubActionAuth( project: Project, { runId, commitSha }: { runId: string; commitSha?: string }, diff --git a/apps/service/src/routes/api/__tests__/commitRecordsRoutes/createCommitRecord.spec.ts b/apps/service/src/routes/api/__tests__/commitRecordsRoutes/createCommitRecord.spec.ts index 38a513d..c8eed0c 100644 --- a/apps/service/src/routes/api/__tests__/commitRecordsRoutes/createCommitRecord.spec.ts +++ b/apps/service/src/routes/api/__tests__/commitRecordsRoutes/createCommitRecord.spec.ts @@ -36,11 +36,11 @@ describe('create commit record', () => { const response = await app.inject({ method: 'POST', url: `/v1/projects/${projectId}/commit-records`, - payload, - headers: { - 'bundlemon-auth-type': 'API_KEY', - 'x-api-key': 'api-key', + query: { + authType: CreateCommitRecordAuthType.ProjectApiKey, + token: 'bad-api-key', }, + payload, }); expect(response.statusCode).toEqual(403); @@ -59,10 +59,11 @@ describe('create commit record', () => { const response = await app.inject({ method: 'POST', url: `/v1/projects/${projectId}/commit-records`, - payload, - headers: { - 'x-api-key': 'api-key', + query: { + authType: CreateCommitRecordAuthType.ProjectApiKey, + token: 'api-key', }, + payload, }); const responseJson = response.json(); @@ -93,11 +94,11 @@ describe('create commit record', () => { const response = await app.inject({ method: 'POST', url: `/v1/projects/${projectId}/commit-records`, - payload, - headers: { - 'bundlemon-auth-type': 'API_KEY', - 'x-api-key': apiKey, + query: { + authType: CreateCommitRecordAuthType.ProjectApiKey, + token: apiKey, }, + payload, }); expect(response.statusCode).toEqual(413); @@ -138,10 +139,11 @@ describe('create commit record', () => { const response = await app.inject({ method: 'POST', url: `/v1/projects/${project.id}/commit-records`, - payload, - headers: { - 'x-api-key': 'api-key', + query: { + authType: CreateCommitRecordAuthType.ProjectApiKey, + token: 'api-key', }, + payload, }); expect(response.statusCode).toEqual(403); @@ -288,128 +290,6 @@ describe('create commit record', () => { expect(responseJson.message).toEqual('forbidden'); expect(mockedCreateOctokitClientByAction).toHaveBeenCalledTimes(0); }); - describe('legacy auth', () => { - test('success', async () => { - const mockedCreateOctokitClientByAction = jest.mocked(createOctokitClientByAction).mockResolvedValue({ - authenticated: true, - installationOctokit: {} as any, - }); - const project = await createTestProjectWithApiKey(); - const owner = generateRandomString(); - const repo = generateRandomString(); - const runId = String(generateRandomInt(1000000, 99999999)); - const payload: CommitRecordPayload = { - branch: 'test', - commitSha: generateRandomString(8), - files: [{ path: 'file.js', pattern: '*.js', size: 100, compression: Compression.None }], - groups: [], - }; - - const response = await app.inject({ - method: 'POST', - url: `/v1/projects/${project.projectId}/commit-records`, - payload, - headers: { - 'bundlemon-auth-type': 'GITHUB_ACTION', - 'github-owner': owner, - 'github-repo': repo, - 'github-run-id': runId, - }, - }); - - const responseJson = response.json(); - const { record } = responseJson; - - expect(response.statusCode).toEqual(200); - expect(mockedCreateOctokitClientByAction).toHaveBeenCalledWith( - { - owner, - repo, - runId, - }, - expect.any(Object) - ); - - // Validate the record exist in the DB - const commitRecordsCollection = await getCommitRecordsCollection(); - const recordInDb = await commitRecordsCollection.findOne({ _id: new ObjectId(record.id) }); - - expect(recordInDb).toBeDefined(); - }); - - test('not authenticated', async () => { - const mockedCreateOctokitClientByAction = jest.mocked(createOctokitClientByAction).mockResolvedValue({ - authenticated: false, - error: 'message from github', - }); - const project = await createTestProjectWithApiKey(); - const owner = generateRandomString(); - const repo = generateRandomString(); - const runId = String(generateRandomInt(1000000, 99999999)); - const payload: CommitRecordPayload = { - branch: 'test', - commitSha: generateRandomString(8), - files: [{ path: 'file.js', pattern: '*.js', size: 100, compression: Compression.None }], - groups: [], - }; - - const response = await app.inject({ - method: 'POST', - url: `/v1/projects/${project.projectId}/commit-records`, - payload, - headers: { - 'bundlemon-auth-type': 'GITHUB_ACTION', - 'github-owner': owner, - 'github-repo': repo, - 'github-run-id': runId, - }, - }); - - const responseJson = response.json(); - - expect(response.statusCode).toEqual(403); - expect(responseJson.message).toEqual('message from github'); - expect(mockedCreateOctokitClientByAction).toHaveBeenCalledWith( - { - owner, - repo, - runId, - }, - expect.any(Object) - ); - }); - - // TODO: legacy github auth currently enabled - test.skip('not authenticated - git project', async () => { - const mockedCreateOctokitClientByAction = jest.mocked(createOctokitClientByAction); - const project = await createTestGithubProject(); - const runId = String(generateRandomInt(1000000, 99999999)); - const payload: CommitRecordPayload = { - branch: 'test', - commitSha: generateRandomString(8), - files: [{ path: 'file.js', pattern: '*.js', size: 100, compression: Compression.None }], - groups: [], - }; - - const response = await app.inject({ - method: 'POST', - url: `/v1/projects/${project.id}/commit-records`, - payload, - headers: { - 'bundlemon-auth-type': 'GITHUB_ACTION', - 'github-owner': project.owner, - 'github-repo': project.repo, - 'github-run-id': runId, - }, - }); - - const responseJson = response.json(); - - expect(response.statusCode).toEqual(403); - expect(responseJson.message).toEqual('legacy github auth works only with old projects'); - expect(mockedCreateOctokitClientByAction).toHaveBeenCalledTimes(0); - }); - }); }); describe('without base branch', () => { @@ -426,11 +306,11 @@ describe('create commit record', () => { const response = await app.inject({ method: 'POST', url: `/v1/projects/${projectId}/commit-records`, - payload, - headers: { - 'bundlemon-auth-type': 'API_KEY', - 'x-api-key': apiKey, + query: { + authType: CreateCommitRecordAuthType.ProjectApiKey, + token: apiKey, }, + payload, }); expect(response.statusCode).toEqual(200); @@ -494,11 +374,11 @@ describe('create commit record', () => { const response = await app.inject({ method: 'POST', url: `/v1/projects/${projectId}/commit-records`, - payload, - headers: { - 'bundlemon-auth-type': 'API_KEY', - 'x-api-key': apiKey, + query: { + authType: CreateCommitRecordAuthType.ProjectApiKey, + token: apiKey, }, + payload, }); expect(response.statusCode).toEqual(200); @@ -575,11 +455,11 @@ describe('create commit record', () => { const response = await app.inject({ method: 'POST', url: `/v1/projects/${projectId}/commit-records`, - payload, - headers: { - 'bundlemon-auth-type': 'API_KEY', - 'x-api-key': apiKey, + query: { + authType: CreateCommitRecordAuthType.ProjectApiKey, + token: apiKey, }, + payload, }); expect(response.statusCode).toEqual(200); @@ -632,11 +512,11 @@ describe('create commit record', () => { const response = await app.inject({ method: 'POST', url: `/v1/projects/${projectId}/commit-records`, - payload, - headers: { - 'bundlemon-auth-type': 'API_KEY', - 'x-api-key': apiKey, + query: { + authType: CreateCommitRecordAuthType.ProjectApiKey, + token: apiKey, }, + payload, }); expect(response.statusCode).toEqual(200); @@ -690,11 +570,11 @@ describe('create commit record', () => { const response = await app.inject({ method: 'POST', url: `/v1/projects/${projectId}/commit-records`, - payload, - headers: { - 'bundlemon-auth-type': 'API_KEY', - 'x-api-key': apiKey, + query: { + authType: CreateCommitRecordAuthType.ProjectApiKey, + token: apiKey, }, + payload, }); expect(response.statusCode).toEqual(200); diff --git a/apps/service/src/routes/api/v1.ts b/apps/service/src/routes/api/v1.ts index 67664ad..9b2bd35 100644 --- a/apps/service/src/routes/api/v1.ts +++ b/apps/service/src/routes/api/v1.ts @@ -9,22 +9,12 @@ import { CreateCommitRecordRequestSchema, GetCommitRecordsRequestSchema, GetCommitRecordRequestSchema, - CreateGithubCheckRequestSchema, - CreateGithubCommitStatusRequestSchema, - PostGithubPRCommentRequestSchema, - LegacyGithubOutputRequestSchema, GetSubprojectsRequestSchema, GetOrCreateProjectIdRequestSchema, GithubOutputRequestSchema, LoginRequestSchema, ReviewCommitRecordRequestSchema, } from '../../consts/schemas'; -import { - createGithubCheckController, - createGithubCommitStatusController, - postGithubPRCommentController, - legacyGithubOutputController, -} from '../../controllers/legacyGithubController'; import { getSubprojectsController } from '../../controllers/subprojectsController'; import { githubOutputController } from '../../controllers/githubController'; import { loginController, logoutController } from '../../controllers/authController'; @@ -54,27 +44,6 @@ const commitRecordsRoutes: FastifyPluginCallback = (app, _opts, done) => { done(); }; -// @deprecated -const outputsRoutes: FastifyPluginCallback = (app, _opts, done) => { - // bundlemon > v0.4.0 - app.post('/github', { schema: LegacyGithubOutputRequestSchema.properties }, legacyGithubOutputController); - - // bundlemon <= v0.4.0 - app.post('/github/check-run', { schema: CreateGithubCheckRequestSchema.properties }, createGithubCheckController); - app.post( - '/github/commit-status', - { schema: CreateGithubCommitStatusRequestSchema.properties }, - createGithubCommitStatusController - ); - app.post( - '/github/pr-comment', - { schema: PostGithubPRCommentRequestSchema.properties }, - postGithubPRCommentController - ); - - done(); -}; - const subprojectsRoutes: FastifyPluginCallback = (app, _opts, done) => { app.get('/', { schema: GetSubprojectsRequestSchema.properties }, getSubprojectsController); @@ -83,7 +52,6 @@ const subprojectsRoutes: FastifyPluginCallback = (app, _opts, done) => { const projectRoutes: FastifyPluginCallback = (app, _opts, done) => { app.register(commitRecordsRoutes, { prefix: '/commit-records' }); - app.register(outputsRoutes, { prefix: '/outputs' }); app.register(subprojectsRoutes, { prefix: '/subprojects' }); done(); diff --git a/apps/service/src/types/schemas/commitRecords.ts b/apps/service/src/types/schemas/commitRecords.ts index 466658b..470d0e7 100644 --- a/apps/service/src/types/schemas/commitRecords.ts +++ b/apps/service/src/types/schemas/commitRecords.ts @@ -6,7 +6,7 @@ import type { BaseRecordCompareTo, CreateCommitRecordAuthType, } from '../../consts/commitRecords'; -import type { BaseRequestSchema, BaseGetRequestSchema, AuthHeaders, ProjectIdParams } from './common'; +import type { BaseRequestSchema, BaseGetRequestSchema, ProjectIdParams } from './common'; export type CreateCommitRecordProjectApiKeyAuthQuery = { authType: CreateCommitRecordAuthType.ProjectApiKey; @@ -27,8 +27,6 @@ export interface CreateCommitRecordRequestSchema extends BaseRequestSchema { body: CommitRecordPayload; params: ProjectIdParams; query: CreateCommitRecordRequestQuery; - // @deprecated - headers: AuthHeaders; } export interface GetCommitRecordRequestParams extends ProjectIdParams { diff --git a/apps/service/src/types/schemas/common.ts b/apps/service/src/types/schemas/common.ts index 8e1a770..dae7d3b 100644 --- a/apps/service/src/types/schemas/common.ts +++ b/apps/service/src/types/schemas/common.ts @@ -32,33 +32,6 @@ export type FastifyValidatedRoute = Rout } >; -export interface ProjectAuthHeaders { - /** - * @minLength 1 - */ - 'x-api-key': string; -} - -// @deprecated -export interface GithubActionsAuthHeaders { - 'bundlemon-auth-type': 'GITHUB_ACTION'; - /** - * @minLength 1 - */ - 'github-owner': string; - /** - * @minLength 1 - */ - 'github-repo': string; - /** - * @minLength 1 - * @pattern ^\d+$ - */ - 'github-run-id': string; -} - -export type AuthHeaders = Record | ProjectAuthHeaders | GithubActionsAuthHeaders; - export interface ProjectIdParams { /** * @pattern ^[0-9a-fA-F]{24}$ diff --git a/apps/service/src/types/schemas/githubOutput.ts b/apps/service/src/types/schemas/githubOutput.ts index 6e9bb73..048f4cc 100644 --- a/apps/service/src/types/schemas/githubOutput.ts +++ b/apps/service/src/types/schemas/githubOutput.ts @@ -2,7 +2,7 @@ import type { GithubOutputTypes, Report } from 'bundlemon-utils'; import type { GetCommitRecordRequestParams } from './commitRecords'; -import type { AuthHeaders, BaseRequestSchema } from './common'; +import type { BaseRequestSchema } from './common'; interface ProjectIdParams { /** @@ -63,23 +63,6 @@ export interface PostGithubPRCommentRequestSchema extends BaseRequestSchema { headers: ProjectApiKeyHeaders; } -interface LegacyGithubOutputBody { - report: Report; - git: { - owner: string; - repo: string; - commitSha: string; - prNumber?: string; - }; - output: Partial>; -} - -export interface LegacyGithubOutputRequestSchema extends BaseRequestSchema { - body: LegacyGithubOutputBody; - params: ProjectIdParams; - headers: AuthHeaders; -} - interface GithubOutputBody { git: { owner: string;