github.com/zppinho/prow@v0.0.0-20240510014325-1738badeb017/cmd/deck/static/api/prow.ts (about) 1 export type ProwJobType = "presubmit" | "postsubmit" | "batch" | "periodic"; 2 export type ProwJobState = "triggered" | "pending" | "success" | "failure" | "aborted" | "error" | "unknown" | ""; 3 export type ProwJobAgent = "kubernetes" | "jenkins" | "tekton-pipeline"; 4 5 // Pull describes a pull request at a particular point in time. 6 // Pull mirrors the Pull struct defined in prow/apis/prowjobs/v1/types.go. 7 export interface Pull { 8 number: number; 9 author: string; 10 sha: string; 11 title?: string; 12 ref?: string; 13 link?: string; 14 commit_link?: string; 15 author_link?: string; 16 } 17 18 // Refs describes how the repo was constructed. 19 // Refs mirrors the Refs struct defined in prow/apis/prowjobs/v1/types.go. 20 export interface Refs { 21 org: string; 22 repo: string; 23 repo_link?: string; 24 base_ref?: string; 25 base_sha?: string; 26 base_link?: string; 27 pulls?: Pull[]; 28 path_alias?: string; 29 clone_uri?: string; 30 skip_submodules?: boolean; 31 } 32 33 // ProwJobList is a list of ProwJob resources. 34 // ProwJobList mirrors the ProwJobList struct defined in prow/apis/prowjobs/v1/types.go. 35 export interface ProwJobList { 36 kind?: string; 37 apiVersion?: string; 38 metadata: ListMeta; 39 items: ProwJob[]; 40 } 41 42 // ProwJob contains the spec as well as runtime metadata. 43 // ProwJob mirrors the ProwJob struct defined in prow/apis/prowjobs/v1/types.go. 44 export interface ProwJob { 45 kind?: string; 46 apiVersion?: string; 47 metadata: ObjectMeta; 48 spec: ProwJobSpec; 49 status: ProwJobStatus; 50 } 51 52 // ListMeta describes metadata that synthetic resources must have, including lists and 53 // various status objects. A resource may have only one of {ObjectMeta, ListMeta}. 54 // ListMeta mirrors the ListMeta struct defined in k8s.io/apimachinery/pkg/apis/meta/v1/types.go. 55 export interface ListMeta { 56 selfLink?: string; 57 resourceVersion?: string; 58 continue?: string; 59 } 60 61 // ObjectMeta is metadata that all persisted resources must have, which includes all objects 62 // users must create. 63 // ObjectMeta mirrors the ObjectMeta struct defined in k8s.io/apimachinery/pkg/apis/meta/v1/types.go. 64 export interface ObjectMeta { 65 name?: string; 66 generateName?: string; 67 namespace?: string; 68 selfLink?: string; 69 uid?: string; 70 resourceVersion?: string; 71 generation?: number; 72 creationTimestamp: string; 73 deletionTimestamp?: string; 74 deletionGracePeriodSeconds?: number; 75 labels?: { [key: string]: string }; 76 annotations?: { [key: string]: string }; 77 ownerReferences?: object[]; 78 initializers?: object; 79 finalizers?: string[]; 80 clusterName?: string; 81 managedFields?: object[]; 82 } 83 84 // ProwJobSpec configures the details of the prow job. 85 // 86 // Details include the podspec, code to clone, the cluster it runs 87 // any child jobs, concurrency limitations, etc. 88 // ProwJobSpec mirrors the ProwJobSpec struct defined in prow/apis/prowjobs/v1/types.go. 89 export interface ProwJobSpec { 90 type?: ProwJobType; 91 agent?: ProwJobAgent; 92 cluster?: string; 93 namespace?: string; 94 job?: string; 95 refs?: Refs; 96 extra_refs?: Refs[]; 97 report?: boolean; 98 context?: string; 99 rerun_command?: string; 100 max_concurrency?: number; 101 error_on_eviction?: boolean; 102 pod_spec?: PodSpec; 103 build_spec?: object; 104 jenkins_spec?: object; 105 pipeline_run_spec?: object; 106 decoration_config?: object; 107 reporter_config?: object; 108 rerun_auth_config?: object; 109 hidden?: boolean; 110 prowjob_default?: object; 111 } 112 113 // ProwJobStatus provides runtime metadata, such as when it finished, whether it is running, etc. 114 // ProwJobStatus mirrors the ProwJobStatus struct defined in prow/apis/prowjobs/v1/types.go. 115 export interface ProwJobStatus { 116 startTime: string; 117 completionTime?: string; 118 state?: ProwJobState; 119 description?: string; 120 url?: string; 121 pod_name?: string; 122 build_id?: string; 123 jenkins_build_id?: string; 124 prev_report_states?: { [key: string]: ProwJobState }; 125 } 126 127 // PodSpec is a description of a pod. 128 // PodSpec mirrors the PodSpec struct defined in k8s.io/api/core/v1 129 // Podspec interface only holds containers right now since no other values are used 130 export interface PodSpec { 131 containers: object[]; 132 }