11/* eslint-disable @typescript-eslint/no-namespace */
22import type { RepeatOptions } from 'bullmq' ;
3+ import type { BuildForPrefix , ReleaseForPrefix } from '../models/artifacts' ;
34
45/** Retry a job for 72 hours every 10 minutes. Useful for build engine tasks */
56export const Retry0f600 = {
@@ -28,13 +29,15 @@ export enum QueueName {
2829export enum JobType {
2930 // Build Jobs
3031 Build_Product = 'Build Product' ,
32+ Build_Cancel = 'Cancel Build' ,
3133 // Polling Jobs
3234 Poll_Build = 'Check Product Build' ,
3335 Poll_Release = 'Check Product Release' ,
3436 // Project Jobs
3537 Project_Create = 'Create Project' ,
3638 // Publishing Jobs
3739 Release_Product = 'Release Product' ,
40+ Release_Cancel = 'Cancel Release' ,
3841 // S3 Jobs
3942 S3_CopyArtifacts = 'Copy Artifacts to S3' ,
4043 S3_CopyError = 'Copy Errors to S3' ,
@@ -52,6 +55,12 @@ export namespace Build {
5255 type : JobType . Build_Product ;
5356 buildId : number ;
5457 }
58+
59+ export interface Cancel {
60+ type : JobType . Build_Cancel ;
61+ guid : string ;
62+ build : BuildForPrefix ;
63+ }
5564}
5665
5766export namespace Polling {
@@ -78,6 +87,12 @@ export namespace Release {
7887 type : JobType . Release_Product ;
7988 releaseId : number ;
8089 }
90+
91+ export interface Cancel {
92+ type : JobType . Release_Cancel ;
93+ guid : string ;
94+ release : ReleaseForPrefix ;
95+ }
8196}
8297
8398export namespace S3 {
@@ -104,9 +119,9 @@ export namespace System {
104119
105120export type Job = JobTypeMap [ keyof JobTypeMap ] ;
106121
107- export type BuildJob = JobTypeMap [ JobType . Build_Product ] ;
122+ export type BuildJob = JobTypeMap [ JobType . Build_Product | JobType . Build_Cancel ] ;
108123export type S3Job = JobTypeMap [ JobType . S3_CopyArtifacts | JobType . S3_CopyError ] ;
109- export type PublishJob = JobTypeMap [ JobType . Release_Product ] ;
124+ export type PublishJob = JobTypeMap [ JobType . Release_Product | JobType . Release_Cancel ] ;
110125export type PollJob = JobTypeMap [ JobType . Poll_Build | JobType . Poll_Release ] ;
111126export type ProjectJob = JobTypeMap [ JobType . Project_Create ] ;
112127export type StartupJob = JobTypeMap [
@@ -116,10 +131,12 @@ export type RecurringJob = JobTypeMap[JobType.System_RefreshAppVersions];
116131
117132export type JobTypeMap = {
118133 [ JobType . Build_Product ] : Build . Product ;
134+ [ JobType . Build_Cancel ] : Build . Cancel ;
119135 [ JobType . Poll_Build ] : Polling . Build ;
120136 [ JobType . Poll_Release ] : Polling . Release ;
121137 [ JobType . Project_Create ] : Project . Create ;
122138 [ JobType . Release_Product ] : Release . Product ;
139+ [ JobType . Release_Cancel ] : Release . Cancel ;
123140 [ JobType . S3_CopyArtifacts ] : S3 . CopyArtifacts ;
124141 [ JobType . S3_CopyError ] : S3 . CopyErrors ;
125142 [ JobType . System_CreateCodeBuildProject ] : System . CreateCodeBuildProject ;
0 commit comments