feat: tech review global trace database (#6648)

* global detail verdicts system

* global traces frontend

* split global routes into own mod

* tweak migration to only do no-key check at app level

* prepr
This commit is contained in:
aecsocket
2026-07-08 16:06:45 +00:00
committed by GitHub
parent 9006dce2b0
commit c84b658e41
29 changed files with 1763 additions and 134 deletions
@@ -100,9 +100,15 @@ export class LabrinthTechReviewInternalModule extends AbstractModule {
*/
public async updateIssueDetail(
detailId: string,
data: Labrinth.TechReview.Internal.UpdateIssueRequest,
data: Labrinth.TechReview.Internal.UpdateIssueDetailRequest,
): Promise<void> {
return this.client.request<void>(`/moderation/tech-review/issue-detail/${detailId}`, {
return this.updateIssueDetails([{ detail_id: detailId, verdict: data.verdict }])
}
public async updateIssueDetails(
data: Labrinth.TechReview.Internal.UpdateIssueRequest[],
): Promise<void> {
return this.client.request<void>('/moderation/tech-review/issue-detail', {
api: 'labrinth',
version: 'internal',
method: 'PATCH',
@@ -110,6 +116,45 @@ export class LabrinthTechReviewInternalModule extends AbstractModule {
})
}
public async updateGlobalIssueDetails(
data: Labrinth.TechReview.Internal.UpdateGlobalIssueRequest[],
): Promise<void> {
return this.client.request<void>('/moderation/tech-review/global-issue-detail', {
api: 'labrinth',
version: 'internal',
method: 'POST',
body: data,
})
}
public async searchGlobalIssueDetails(
params: Labrinth.TechReview.Internal.SearchGlobalIssueDetailsRequest,
): Promise<Labrinth.TechReview.Internal.SearchGlobalIssueDetailsResponse> {
return this.client.request<Labrinth.TechReview.Internal.SearchGlobalIssueDetailsResponse>(
'/moderation/tech-review/global-issue-detail/search',
{
api: 'labrinth',
version: 'internal',
method: 'POST',
body: params,
},
)
}
public async getGlobalIssueDetail(
params: Labrinth.TechReview.Internal.GetGlobalIssueDetailRequest,
): Promise<Labrinth.TechReview.Internal.GetGlobalIssueDetailResponse> {
return this.client.request<Labrinth.TechReview.Internal.GetGlobalIssueDetailResponse>(
'/moderation/tech-review/global-issue-detail/local-traces',
{
api: 'labrinth',
version: 'internal',
method: 'POST',
body: params,
},
)
}
public async submitProject(
projectId: string,
data: Labrinth.TechReview.Internal.SubmitProjectRequest,
@@ -2224,9 +2224,66 @@ export namespace Labrinth {
| 'severity_desc'
export type UpdateIssueRequest = {
detail_id: string
verdict: DelphiReportIssueStatus
}
export type UpdateIssueDetailRequest = {
verdict: DelphiReportIssueStatus
}
export type UpdateGlobalIssueRequest = {
detail_key: string
verdict: 'safe' | 'unsafe'
}
export type SearchGlobalIssueDetailsRequest = {
limit?: number
page?: number
query?: string | null
}
export type SearchGlobalIssueDetailsResponse = {
total: number
traces: GlobalIssueDetail[]
}
export type GetGlobalIssueDetailRequest = {
detail_key: string
limit?: number
after_detail_id?: string | null
}
export type GetGlobalIssueDetailResponse = {
trace: GlobalIssueDetail
next_after_detail_id: string | null
}
export type GlobalIssueDetail = {
detail_key: string
verdict: DelphiReportIssueStatus
local_trace_count: number
local_traces: GlobalIssueDetailTrace[]
}
export type GlobalIssueDetailTrace = {
detail_id: string
issue_id: string
issue_type: string
project_id: string
project_slug: string | null
project_name: string
version_id: string
version_number: string
file_id: string
file_name: string
jar: string | null
file_path: string
severity: DelphiSeverity
local_status: DelphiReportIssueStatus
effective_status: DelphiReportIssueStatus
}
export type SubmitProjectRequest = {
verdict: 'safe' | 'unsafe'
message?: string