From 661d39e12bb45db706464777d0fd48ae97d596c8 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sun, 31 May 2026 03:20:19 -0700 Subject: [PATCH] fix: queue scheduled gitlab checks (#4072) Queue scheduled GitLab check status work. --- src/shared/gitlab-pipeline-checks.test.ts | 28 +++++++++++++++++++++++ src/shared/gitlab-pipeline-checks.ts | 10 +++++++- 2 files changed, 37 insertions(+), 1 deletion(-) 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'