-
Notifications
You must be signed in to change notification settings - Fork 251
/
types.go
578 lines (488 loc) · 17.8 KB
/
types.go
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
576
577
578
// This source code file is AUTO-GENERATED by github.com/taskcluster/jsonschema2go
package tcqueueevents
import (
tcclient "github.com/taskcluster/taskcluster/v50/clients/client-go"
)
type (
// Information about the artifact that was created
Artifact struct {
// Expected content-type of the artifact. This is informational only:
// it is suitable for use to choose an icon for the artifact, for example.
// The accurate content-type of the artifact can only be determined by
// downloading it.
//
// Max length: 255
ContentType string `json:"contentType"`
// Date and time after which the artifact created will be automatically
// deleted by the queue.
Expires tcclient.Time `json:"expires"`
// Name of the artifact that was created, this is useful if you want to
// attempt to fetch the artifact. But keep in mind that just because an
// artifact is created doesn't mean that it's immediately available.
//
// Max length: 1024
Name string `json:"name"`
// This is the `storageType` for the request that was used to create the
// artifact. Note that artifacts with the `s3` storage type do not produce
// this message.
//
// Possible values:
// * "reference"
// * "link"
// * "error"
// * "object"
StorageType string `json:"storageType"`
}
// Message reporting a new artifact has been created for a given task.
ArtifactCreatedMessage struct {
// Information about the artifact that was created
Artifact Artifact `json:"artifact"`
// Id of the run on which artifact was created.
//
// Mininum: 0
// Maximum: 1000
RunID int64 `json:"runId"`
// A representation of **task status** as known by the queue
Status TaskStatusStructure `json:"status"`
// Message version
//
// Possible values:
// * 1
Version int64 `json:"version"`
// Identifier for the worker-group within which the run with the created
// artifacted is running.
//
// Syntax: ^([a-zA-Z0-9-_]*)$
// Min length: 1
// Max length: 38
WorkerGroup string `json:"workerGroup"`
// Identifier for the worker within which the run with the created artifact
// is running.
//
// Syntax: ^([a-zA-Z0-9-_]*)$
// Min length: 1
// Max length: 38
WorkerID string `json:"workerId"`
}
// JSON object with information about a run
RunInformation struct {
// Reason for the creation of this run,
// **more reasons may be added in the future**.
//
// Possible values:
// * "scheduled"
// * "retry"
// * "task-retry"
// * "rerun"
// * "exception"
ReasonCreated string `json:"reasonCreated"`
// Reason that run was resolved, this is mainly
// useful for runs resolved as `exception`.
// Note, **more reasons may be added in the future**, also this
// property is only available after the run is resolved. Some of these
// reasons, notably `intermittent-task`, `worker-shutdown`, and
// `claim-expired`, will trigger an automatic retry of the task.
// Note that 'superseded' is here only for compatibility, as that
// functionality has been removed.
//
// Possible values:
// * "completed"
// * "failed"
// * "deadline-exceeded"
// * "canceled"
// * "claim-expired"
// * "worker-shutdown"
// * "malformed-payload"
// * "resource-unavailable"
// * "internal-error"
// * "intermittent-task"
// * "superseded"
ReasonResolved string `json:"reasonResolved,omitempty"`
// Date-time at which this run was resolved, ie. when the run changed
// state from `running` to either `completed`, `failed` or `exception`.
// This property is only present after the run as been resolved.
Resolved tcclient.Time `json:"resolved,omitempty"`
// Id of this task run, `run-id`s always starts from `0`
//
// Mininum: 0
// Maximum: 1000
RunID int64 `json:"runId"`
// Date-time at which this run was scheduled, ie. when the run was
// created in state `pending`.
Scheduled tcclient.Time `json:"scheduled"`
// Date-time at which this run was claimed, ie. when the run changed
// state from `pending` to `running`. This property is only present
// after the run has been claimed.
Started tcclient.Time `json:"started,omitempty"`
// State of this run
//
// Possible values:
// * "pending"
// * "running"
// * "completed"
// * "failed"
// * "exception"
State string `json:"state"`
// Time at which the run expires and is resolved as `failed`, if the
// run isn't reclaimed. Note, only present after the run has been
// claimed.
TakenUntil tcclient.Time `json:"takenUntil,omitempty"`
// Identifier for group that worker who executes this run is a part of,
// this identifier is mainly used for efficient routing.
// Note, this property is only present after the run is claimed.
//
// Syntax: ^([a-zA-Z0-9-_]*)$
// Min length: 1
// Max length: 38
WorkerGroup string `json:"workerGroup,omitempty"`
// Identifier for worker evaluating this run within given
// `workerGroup`. Note, this property is only available after the run
// has been claimed.
//
// Syntax: ^([a-zA-Z0-9-_]*)$
// Min length: 1
// Max length: 38
WorkerID string `json:"workerId,omitempty"`
}
// Subset of a task definition
Task struct {
// Arbitrary key-value tags (only strings limited to 4k). These can be used
// to attach informal metadata to a task. Use this for informal tags that
// tasks can be classified by. You can also think of strings here as
// candidates for formal metadata. Something like
// `purpose: 'build' || 'test'` is a good example.
//
// Default: {}
//
// Map entries:
// Max length: 4096
Tags map[string]string `json:"tags"`
}
// Message reporting that a task has complete successfully.
TaskCompletedMessage struct {
// Id of the run that completed the task
//
// Mininum: 0
// Maximum: 1000
RunID int64 `json:"runId"`
// A representation of **task status** as known by the queue
Status TaskStatusStructure `json:"status"`
// Subset of a task definition containing values that are useful for determining
// whether a message is interesting to the receiver. Where the full task
// definition is required, the receiver should call queue.task to download that
// definition.
Task Var `json:"task,omitempty"`
// Message version
//
// Possible values:
// * 1
Version int64 `json:"version"`
// Identifier for the worker-group within which this run ran.
//
// Syntax: ^([a-zA-Z0-9-_]*)$
// Min length: 1
// Max length: 38
WorkerGroup string `json:"workerGroup"`
// Identifier for the worker that executed this run.
//
// Syntax: ^([a-zA-Z0-9-_]*)$
// Min length: 1
// Max length: 38
WorkerID string `json:"workerId"`
}
// Message reporting that a task has been defined. The task may or may not be
// _scheduled_ too.
TaskDefinedMessage struct {
// A representation of **task status** as known by the queue
Status TaskStatusStructure `json:"status"`
// Subset of a task definition containing values that are useful for determining
// whether a message is interesting to the receiver. Where the full task
// definition is required, the receiver should call queue.task to download that
// definition.
Task Var `json:"task,omitempty"`
// Message version
//
// Possible values:
// * 1
Version int64 `json:"version"`
}
// Message reporting that Taskcluster have failed to run a task.
TaskExceptionMessage struct {
// Id of the last run for the task, not provided if `deadline`
// was exceeded before a run was started.
//
// Mininum: 0
// Maximum: 1000
RunID int64 `json:"runId,omitempty"`
// A representation of **task status** as known by the queue
Status TaskStatusStructure `json:"status"`
// Subset of a task definition containing values that are useful for determining
// whether a message is interesting to the receiver. Where the full task
// definition is required, the receiver should call queue.task to download that
// definition.
Task Var `json:"task,omitempty"`
// Message version
//
// Possible values:
// * 1
Version int64 `json:"version"`
// Identifier for the worker-group within which the last attempt of the task
// ran. Not provided, if `deadline` was exceeded before a run was started.
//
// Syntax: ^([a-zA-Z0-9-_]*)$
// Min length: 1
// Max length: 38
WorkerGroup string `json:"workerGroup,omitempty"`
// Identifier for the last worker that failed to report, causing the task
// to fail. Not provided, if `deadline` was exceeded before a run
// was started.
//
// Syntax: ^([a-zA-Z0-9-_]*)$
// Min length: 1
// Max length: 38
WorkerID string `json:"workerId,omitempty"`
}
// Message reporting that a task failed to complete successfully.
TaskFailedMessage struct {
// Id of the run that failed.
//
// Mininum: 0
// Maximum: 1000
RunID int64 `json:"runId"`
// A representation of **task status** as known by the queue
Status TaskStatusStructure `json:"status"`
// Subset of a task definition containing values that are useful for determining
// whether a message is interesting to the receiver. Where the full task
// definition is required, the receiver should call queue.task to download that
// definition.
Task Var `json:"task,omitempty"`
// Message version
//
// Possible values:
// * 1
Version int64 `json:"version"`
// Identifier for the worker-group within which this run ran.
//
// Syntax: ^([a-zA-Z0-9-_]*)$
// Min length: 1
// Max length: 38
WorkerGroup string `json:"workerGroup"`
// Identifier for the worker that executed this run.
//
// Syntax: ^([a-zA-Z0-9-_]*)$
// Min length: 1
// Max length: 38
WorkerID string `json:"workerId"`
}
// Message written once a task group has been sealed or resolved.
TaskGroupChangedMessage struct {
// Date and time after the last expiration of any task in the task group.
// For the unsealed task group this could change to a later date.
Expires tcclient.Time `json:"expires"`
// All tasks in a task group must have the same `schedulerId`. This is used for several purposes:
//
// * it can represent the entity that created the task;
// * it can limit addition of new tasks to a task group: the caller of
// `createTask` must have a scope related to the `schedulerId` of the task
// group;
// * it controls who can manipulate tasks, again by requiring
// `schedulerId`-related scopes; and
// * it appears in the routing key for Pulse messages about the task.
//
// Default: "-"
// Syntax: ^([a-zA-Z0-9-_]*)$
// Min length: 1
// Max length: 38
SchedulerID string `json:"schedulerId"`
// Empty or date and time when task group was sealed.
Sealed tcclient.Time `json:"sealed,omitempty"`
// Identifier for the task-group.
//
// Syntax: ^[A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw]$
TaskGroupID string `json:"taskGroupId"`
// Message version
//
// Possible values:
// * 1
Version int64 `json:"version"`
}
// Required task metadata
TaskMetadata struct {
// Human readable description of the task, please **explain** what the
// task does. A few lines of documentation is not going to hurt you.
//
// Max length: 32768
Description string `json:"description"`
// Human readable name of task, used to very briefly given an idea about
// what the task does.
//
// Max length: 255
Name string `json:"name"`
// Entity who caused this task, not necessarily a person with email who did
// `hg push` as it could be automation bots as well. The entity we should
// contact to ask why this task is here.
//
// Max length: 255
Owner string `json:"owner"`
// Link to source of this task, should specify a file, revision and
// repository. This should be place someone can go an do a git/hg blame
// to who came up with recipe for this task.
//
// Syntax: ^(https?|ssh)://
// Max length: 4096
Source string `json:"source"`
}
// Message reporting that a task is now pending
TaskPendingMessage struct {
// Id of run that became pending, `run-id`s always starts from 0
//
// Mininum: 0
// Maximum: 1000
RunID int64 `json:"runId"`
// A representation of **task status** as known by the queue
Status TaskStatusStructure `json:"status"`
// Subset of a task definition
Task Task `json:"task,omitempty"`
// Message version
//
// Possible values:
// * 1
Version int64 `json:"version"`
}
// Message reporting that a given run of a task have started
TaskRunningMessage struct {
// Id of the run that just started, always starts from 0
//
// Mininum: 0
// Maximum: 1000
RunID int64 `json:"runId"`
// A representation of **task status** as known by the queue
Status TaskStatusStructure `json:"status"`
// Time at which the run expires and is resolved as `failed`, if the run
// isn't reclaimed.
TakenUntil tcclient.Time `json:"takenUntil"`
// Message version
//
// Possible values:
// * 1
Version int64 `json:"version"`
// Identifier for the worker-group within which this run started.
//
// Syntax: ^([a-zA-Z0-9-_]*)$
// Min length: 1
// Max length: 38
WorkerGroup string `json:"workerGroup"`
// Identifier for the worker executing this run.
//
// Syntax: ^([a-zA-Z0-9-_]*)$
// Min length: 1
// Max length: 38
WorkerID string `json:"workerId"`
}
// A representation of **task status** as known by the queue
TaskStatusStructure struct {
// Deadline of the task, by which this task must be complete. `pending` and
// `running` runs are resolved as **exception** if not resolved by other means
// before the deadline. After the deadline, a task is immutable. Note,
// deadline cannot be more than 5 days into the future
Deadline tcclient.Time `json:"deadline"`
// Task expiration, time at which task definition and
// status is deleted. Notice that all artifacts for the task
// must have an expiration that is no later than this.
Expires tcclient.Time `json:"expires"`
// The name for the "project" with which this task is associated. This
// value can be used to control permission to manipulate tasks as well as
// for usage reporting. Project ids are typically simple identifiers,
// optionally in a hierarchical namespace separated by `/` characters.
// This value defaults to `none`.
//
// Default: "none"
// Syntax: ^([a-zA-Z0-9._/-]*)$
// Min length: 1
// Max length: 500
ProjectID string `json:"projectId"`
// Unique identifier for a provisioner, that can supply specified
// `workerType`. Deprecation is planned for this property as it
// will be replaced, together with `workerType`, by the new
// identifier `taskQueueId`.
//
// Syntax: ^[a-zA-Z0-9-_]{1,38}$
ProvisionerID string `json:"provisionerId"`
// Number of retries left for the task in case of infrastructure issues
//
// Mininum: 0
// Maximum: 999
RetriesLeft int64 `json:"retriesLeft"`
// List of runs, ordered so that index `i` has `runId == i`
Runs []RunInformation `json:"runs"`
// All tasks in a task group must have the same `schedulerId`. This is used for several purposes:
//
// * it can represent the entity that created the task;
// * it can limit addition of new tasks to a task group: the caller of
// `createTask` must have a scope related to the `schedulerId` of the task
// group;
// * it controls who can manipulate tasks, again by requiring
// `schedulerId`-related scopes; and
// * it appears in the routing key for Pulse messages about the task.
//
// Default: "-"
// Syntax: ^([a-zA-Z0-9-_]*)$
// Min length: 1
// Max length: 38
SchedulerID string `json:"schedulerId"`
// State of this task. This is just an auxiliary property derived from state
// of latests run, or `unscheduled` if none.
//
// Possible values:
// * "unscheduled"
// * "pending"
// * "running"
// * "completed"
// * "failed"
// * "exception"
State string `json:"state"`
// Identifier for a group of tasks scheduled together with this task.
// Generally, all tasks related to a single event such as a version-control
// push or a nightly build have the same `taskGroupId`. This property
// defaults to `taskId` if it isn't specified. Tasks with `taskId` equal to
// the `taskGroupId` are, [by convention](/docs/manual/using/task-graph),
// decision tasks.
//
// Syntax: ^[A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw]$
TaskGroupID string `json:"taskGroupId"`
// Unique task identifier, this is UUID encoded as
// [URL-safe base64](http://tools.ietf.org/html/rfc4648#section-5) and
// stripped of `=` padding.
//
// Syntax: ^[A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw]$
TaskID string `json:"taskId"`
// Unique identifier for a task queue
//
// Syntax: ^[a-zA-Z0-9-_]{1,38}/[a-z]([-a-z0-9]{0,36}[a-z0-9])?$
TaskQueueID string `json:"taskQueueId"`
// Unique identifier for a worker-type within a specific
// provisioner. Deprecation is planned for this property as it will
// be replaced, together with `provisionerId`, by the new
// identifier `taskQueueId`.
//
// Syntax: ^[a-z]([-a-z0-9]{0,36}[a-z0-9])?$
WorkerType string `json:"workerType"`
}
// Subset of a task definition containing values that are useful for determining
// whether a message is interesting to the receiver. Where the full task
// definition is required, the receiver should call queue.task to download that
// definition.
Var struct {
// Arbitrary key-value tags (only strings limited to 4k). These can be used
// to attach informal metadata to a task. Use this for informal tags that
// tasks can be classified by. You can also think of strings here as
// candidates for formal metadata. Something like
// `purpose: 'build' || 'test'` is a good example.
//
// Default: {}
//
// Map entries:
// Max length: 4096
Tags map[string]string `json:"tags"`
}
)