-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathapiDefinitions.ts
More file actions
575 lines (542 loc) · 14.6 KB
/
Copy pathapiDefinitions.ts
File metadata and controls
575 lines (542 loc) · 14.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
// Copyright Contributors to the Packit project.
// SPDX-License-Identifier: MIT
/**
* This is a list of items from the Packit API
*/
// /api/projects/$forge/$namespace/$repo
export interface Project {
namespace: string;
repo_name: string;
project_url: string;
prs_handled: number;
branches_handled: number;
releases_handled: number;
issues_handled: number;
}
// /api/projects/$forge/$namespace/$repo/issues
export type ProjectIssue = number;
// /api/projects/$forge/$namespace/$repo/releases
export interface ProjectRelease {
commit_hash: string;
tag_name: string;
}
export interface CoprBuildShort {
build_id: string;
chroot: string;
status: string;
web_url: string;
}
export interface KojiBuildShort {
build_id: string;
status: string;
chroot: string;
web_url: string;
}
export interface SRPMBuildShort {
srpm_build_id: number;
status: string;
log_url: string;
}
export interface TestingFarmRunShort {
pipeline_id: string;
chroot: string;
status: string;
web_url: string;
}
// /api/project/$forge/$namespace/$repo/branches
export interface ProjectBranch {
branch: string;
builds: CoprBuildShort[];
koji_builds: KojiBuildShort[];
srpm_builds: SRPMBuildShort[];
tests: TestingFarmRunShort[];
}
// /api/project/$forge/$namespace/$repo/prs
export interface ProjectPRs {
pr_id: number;
builds: CoprBuildShort[];
koji_builds: KojiBuildShort[];
srpm_builds: SRPMBuildShort[];
tests: TestingFarmRunShort[];
}
// /api/copr-builds
export interface CoprBuildGroup {
branch_name: string | null;
build_id: number;
submitted_time: number;
packit_id: number;
packit_id_per_chroot: {
[key: string]: number;
};
// TODO - @Venefilyn - change interface depending on status of pr_id or branch_item.
// They seem to be mutually exclusive so can be sure one is null and other is string
pr_id: number | null;
project: string;
project_url: string;
ref: string;
repo_namespace: string;
repo_name: string;
status_per_chroot: {
[key: string]: string; // TODO - @Venefilyn - Probably an enum right? Change to be one if so
};
web_url: string;
}
// Used within CoprBuild interface below
export interface CoprBuildPackage {
arch: string;
epoch: number;
name: string;
release: string;
version: string;
}
// /api/copr-builds/$id
export interface CoprBuild {
anitya_package: string | null;
anitya_project_id: number | null;
anitya_project_name: string | null;
anitya_version: string | null;
branch_name: string | null;
build_finished_time: number;
build_id: string;
build_logs_url: string;
build_start_time: number;
submitted_time: number;
built_packages: CoprBuildPackage[] | null;
chroot: string;
commit_sha: string;
copr_owner: string;
copr_project: string;
issue_id: number | null;
non_git_upstream: boolean;
pr_id: number | null;
project_url: string;
release: string | null;
repo_name: string;
repo_namespace: string;
run_ids: number[];
srpm_build_id: number;
status: string; // TODO - @Venefilyn - Probably an enum right? Change to be one if so
web_url: string;
}
// /api/koji-builds
export interface KojiBuildGroup {
branch_name: string | null;
build_logs_urls: string;
submitted_time: number;
chroot: string;
packit_id: number;
// TODO: @Venefilyn - change interface depending on status of pr_id or branch_item.
// They seem to be mutually exclusive so can be sure one is null and other is string
pr_id: number | null;
project_url: string;
release: string | null;
repo_name: string;
repo_namespace: string;
scratch: boolean;
status: string; // TODO - @Venefilyn - Probably an enum right? Change to be one if so
task_id: string | null;
web_url: string;
}
// /api/koji-builds/$id
export interface KojiBuild {
anitya_package: string | null;
anitya_project_id: number | null;
anitya_project_name: string | null;
anitya_version: string | null;
branch_name: string | null;
build_finished_time: number;
build_logs_urls: [string: string];
build_start_time: number;
submitted_time: number;
chroot: string;
commit_sha: string;
issue_id: number | null;
non_git_upstream: boolean;
// TODO: @Venefilyn - change interface depending on status of pr_id or branch_item.
// They seem to be mutually exclusive so can be sure one is null and other is string
pr_id: number | null;
project_url: string;
release: string | null;
repo_name: string;
repo_namespace: string;
run_ids: number[];
scratch: boolean;
srpm_build_id: number;
status: string; // TODO: @Venefilyn - Probably an enum right? Change to be one if so
task_id: string;
web_url: string;
build_submission_stdout: string | null;
error_message: string | null;
}
// /api/koji-tag-requests
export interface KojiTagRequestGroup {
branch_name: string | null;
tag_request_submitted_time: number;
chroot: string;
sidetag: string;
nvr: string;
packit_id: number;
// TODO: @Venefilyn - change interface depending on status of pr_id or branch_item.
// They seem to be mutually exclusive so can be sure one is null and other is string
pr_id: number | null;
project_url: string;
release: string | null;
repo_name: string;
repo_namespace: string;
task_id: string | null;
web_url: string;
}
// /api/koji-tag-requests/$id
export interface KojiTagRequest {
anitya_package: string | null;
anitya_project_id: number | null;
anitya_project_name: string | null;
anitya_version: string | null;
branch_name: string | null;
tag_request_submitted_time: number;
chroot: string;
sidetag: string;
nvr: string;
commit_sha: string;
issue_id: number | null;
non_git_upstream: boolean;
// TODO: @Venefilyn - change interface depending on status of pr_id or branch_item.
// They seem to be mutually exclusive so can be sure one is null and other is string
pr_id: number | null;
project_url: string;
release: string | null;
repo_name: string;
repo_namespace: string;
run_ids: number[];
task_id: string;
web_url: string;
}
// /api/srpm-builds
export interface SRPMBuildGroup {
branch_name: string | null;
submitted_time: number;
log_url: string;
// TODO: @Venefilyn - change interface depending on status of pr_id or branch_item.
// They seem to be mutually exclusive so can be sure one is null and other is string
pr_id: number | null;
project_url: string;
repo_name: string;
repo_namespace: string;
srpm_build_id: number;
status: string; // TODO: @Venefilyn - Probably an enum right? Change to be one if so
}
// /api/srpm-builds/$id
export interface SRPMBuild {
anitya_package: string | null;
anitya_project_id: number | null;
anitya_project_name: string | null;
anitya_version: string | null;
branch_name: string | null;
build_finished_time: number;
build_start_time: number;
submitted_time: number;
copr_build_id: string;
copr_web_url: string;
issue_id: number | null;
logs: string | null;
logs_url: string;
non_git_upstream: boolean;
pr_id: number | null;
project_url: string;
release: string | null;
repo_name: string;
repo_namespace: string;
run_ids: number[];
status: string;
url: string;
}
// /api/bodhi-updates
export interface BodhiUpdateGroup {
alias: string | null;
branch: string;
branch_name: string | null;
koji_nvrs: string;
packit_id: number;
pr_id: number | null;
project_url?: string;
release: string | null;
repo_name: string;
repo_namespace: string;
status: string;
submitted_time: number;
update_creation_time: number | null;
web_url: string | null;
}
// /api/bodhi-updates/$id
export interface BodhiUpdate {
alias: string | null;
anitya_package: string | null;
anitya_project_id: number | null;
anitya_project_name: string | null;
anitya_version: string | null;
branch: string;
branch_name: string | null;
issue_id: number | null;
koji_nvrs: string;
non_git_upstream: boolean;
pr_id: number | null;
project_url: string;
release: string | null;
repo_name: string;
repo_namespace: string;
run_ids: number[];
status: string;
submitted_time: number;
update_creation_time: number | null;
web_url: string | null;
error_message: string | null;
}
// /api/testing-farm/results
export interface TestingFarmRunGroup {
packit_id: number;
pipeline_id: string;
pr_id: number;
project_url: string;
ref: string;
repo_name: string;
repo_namespace: string;
status: string;
submitted_time: number;
target: string;
web_url: string;
}
// /api/testing-farm/$id
export interface TestingFarmRun {
anitya_package: string | null;
anitya_project_id: number | null;
anitya_project_name: string | null;
anitya_version: string | null;
branch_name: string | null;
chroot: string;
commit_sha: string;
copr_build_ids: number[];
koji_build_ids: number[];
issue_id: number | null;
non_git_upstream: boolean;
pipeline_id: string; // UUID
pr_id: number | null;
project_url: string;
release: string | null;
repo_name: string;
repo_namespace: string;
run_ids: number[];
status: string;
submitted_time: number;
web_url: string;
}
// /api/propose-downstream
// /api/pull-from-upstream
export interface SyncReleaseJobGroup {
anitya_package: string | null;
anitya_project_id: number | null;
anitya_project_name: string | null;
anitya_version: string | null;
issue_id: number | null;
non_git_upstream: boolean;
packit_id: number;
packit_id_per_downstream_pr: { [key: string]: number };
pr_id: number | null;
project_url: string;
release: string | null;
repo_name: string;
repo_namespace: string;
status: string;
status_per_downstream_pr: { [key: string]: string }; //TODO - @Venefilyn Can probably be an enum
submitted_time: number;
}
export interface DownstreamPR {
pr_id: number;
branch: string;
is_fast_forward: boolean;
url: string;
}
// /api/propose-downstream/$id
// /api/pull-from-upstream/$id
export interface SyncReleaseJob {
anitya_package: string | null;
anitya_project_id: number | null;
anitya_project_name: string | null;
anitya_version: string | null;
branch: string;
branch_name: string | null;
downstream_prs: DownstreamPR[];
downstream_pr_project: string | null;
finished_time: number;
issue_id: number | null;
logs: string;
non_git_upstream: boolean;
pr_id: number | null;
project_url: string;
release: string | null;
repo_name: string;
repo_namespace: string;
start_time: number;
status: string; //TODO - @Venefilyn Can probably be an enum
submitted_time: number;
}
export interface PipelineItem {
packit_id: number;
status: string;
target: string;
}
// /api/runs
// /api/runs/merged/$id
export interface PipelineRun {
bodhi_update: PipelineItem[];
copr: PipelineItem[];
koji: PipelineItem[];
merged_run_id: number;
propose_downstream: PipelineItem[];
pull_from_upstream: PipelineItem[];
srpm: {
packit_id: number;
status: string;
};
test_run: PipelineItem[];
time_submitted: number;
trigger:
| {
anitya_package: string | null;
anitya_project_id: number | null;
anitya_project_name: string | null;
anitya_version: string | null;
branch_name: string | null;
issue_id: number | null;
non_git_upstream: boolean;
pr_id: number | null;
project_url: string;
release: string | null;
repo_name: string;
repo_namespace: string;
}
| Record<never, never>
| null;
vm_image_build: unknown[]; //TODO - @Venefilyn - No clue what it should be
}
// /api/openscanhub-scans
export interface OSHScanGroup {
anitya_package: string | null;
anitya_project_id: number | null;
anitya_project_name: string | null;
anitya_version: string | null;
branch_name: string | null;
commit_sha: string;
copr_build_target_id: number;
issues_added_count: number | null;
issues_added_url: string;
issues_fixed_url: string;
non_git_upstream: boolean;
packit_id: number;
pr_id: number | null;
project_url: string;
release: string | null;
repo_name: string;
repo_namespace: string;
scan_results_url: string;
status: string;
submitted_time: number | null;
task_id: number;
url: string;
}
// /api/openscanhub-scans/$id
export interface OSHScan {
anitya_package: string | null;
anitya_project_id: number | null;
anitya_project_name: string | null;
anitya_version: string | null;
branch_name: string | null;
commit_sha: string;
copr_build_target_id: number;
issues_added_count: number | null;
issues_added_url: string;
issues_fixed_url: string;
non_git_upstream: boolean;
pr_id: number | null;
project_url: string;
release: string | null;
repo_name: string;
repo_namespace: string;
scan_results_url: string | null;
status: string | null;
submitted_time: number | null;
task_id: number | null;
url: string | null;
}
// /api/log-detective
export interface LogDetectiveResultGroup {
packit_id: number;
analysis_id: string;
status: string;
chroot: string;
commit_sha: string;
log_detective_response: LogDetectiveResponse | null;
target_build: string | null;
run_ids: number[];
submitted_time: number | null;
branch_name: string | null;
pr_id: number | null;
issue_id: number | null;
release: string | null;
project_url: string;
repo_name: string;
repo_namespace: string;
anitya_version: string | null;
anitya_project_name: string | null;
anitya_package: string | null;
}
// /api/log-detective/groups/$id
export interface LogDetectiveGroup {
packit_id: number;
submitted_time: number | null;
run_ids: number[];
log_detective_target_ids: number[];
pr_id: number | null;
issue_id: number | null;
branch_name: string | null;
release: string | null;
anitya_version: string | null;
anitya_project_id: number | null;
anitya_project_name: string | null;
anitya_package: string | null;
non_git_upstream: boolean;
project_url: string;
repo_name: string;
repo_namespace: string;
}
// /api/log-detective/$id
export interface LogDetectiveExplanation {
logprobs: unknown | null;
text: string;
}
export interface LogDetectiveResponse {
explanation: LogDetectiveExplanation;
response_certainty: number;
}
export interface LogDetectiveResult {
packit_id: number;
analysis_id: string;
branch_name: string | null;
chroot: string;
commit_sha: string;
run_ids: number[];
status: string;
log_detective_response: LogDetectiveResponse | null;
target_build: string | null;
submitted_time: number | null;
project_url: string;
pr_id: number | null;
issue_id: number | null;
release: string | null;
anitya_version: string | null;
anitya_project_id: number | null;
anitya_project_name: string | null;
anitya_package: string | null;
non_git_upstream: boolean;
repo_name: string;
repo_namespace: string;
}