fix: queue scheduled gitlab checks (#4072)

Queue scheduled GitLab check status work.
This commit is contained in:
Neil
2026-05-31 03:20:19 -07:00
committed by GitHub
parent 1d4616b67d
commit 661d39e12b
2 changed files with 37 additions and 1 deletions
+28
View File
@@ -20,6 +20,22 @@ describe('gitLabPipelineJobsToPRChecks', () => {
status: 'manual',
webUrl: '',
duration: null
},
{
id: 3,
name: 'delayed deploy',
stage: 'deploy',
status: 'scheduled',
webUrl: 'https://gitlab.com/acme/orca/-/jobs/3',
duration: null
},
{
id: 4,
name: 'external callback',
stage: 'integration',
status: 'waiting_for_callback',
webUrl: 'https://gitlab.com/acme/orca/-/jobs/4',
duration: null
}
]
@@ -35,6 +51,18 @@ describe('gitLabPipelineJobsToPRChecks', () => {
status: 'completed',
conclusion: 'neutral',
url: null
},
{
name: 'deploy: delayed deploy',
status: 'queued',
conclusion: 'pending',
url: 'https://gitlab.com/acme/orca/-/jobs/3'
},
{
name: 'integration: external callback',
status: 'queued',
conclusion: 'pending',
url: 'https://gitlab.com/acme/orca/-/jobs/4'
}
])
})
+9 -1
View File
@@ -3,7 +3,14 @@ import type { PRCheckDetail } from './types'
export function mapGitLabPipelineJobStatusToCheckStatus(status: string): PRCheckDetail['status'] {
const s = status.toLowerCase()
if (s === 'created' || s === 'pending' || s === 'waiting_for_resource' || s === 'preparing') {
if (
s === 'created' ||
s === 'pending' ||
s === 'scheduled' ||
s === 'waiting_for_callback' ||
s === 'waiting_for_resource' ||
s === 'preparing'
) {
return 'queued'
}
if (s === 'running') {
@@ -37,6 +44,7 @@ export function mapGitLabPipelineJobStatusToConclusion(
s === 'created' ||
s === 'pending' ||
s === 'running' ||
s === 'waiting_for_callback' ||
s === 'waiting_for_resource' ||
s === 'preparing' ||
s === 'scheduled'