diff --git a/src/shared/gitlab-pipeline-checks.test.ts b/src/shared/gitlab-pipeline-checks.test.ts index a12b235cf29..673fcf3cd16 100644 --- a/src/shared/gitlab-pipeline-checks.test.ts +++ b/src/shared/gitlab-pipeline-checks.test.ts @@ -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' } ]) }) diff --git a/src/shared/gitlab-pipeline-checks.ts b/src/shared/gitlab-pipeline-checks.ts index 64c76ad9368..efcea5ee4bf 100644 --- a/src/shared/gitlab-pipeline-checks.ts +++ b/src/shared/gitlab-pipeline-checks.ts @@ -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'