treeherder/schemas/pulse-job.yml

283 строки
6.3 KiB
YAML

$schema: "http://json-schema.org/draft-04/schema#"
title: "Job Definition"
description: |
Definition of a single job that can be added to Treeherder
Project is determined by the routing key, so we don't need to specify it here.
id: "jobDefinition"
type: "object"
properties:
jobGuid:
title: "jobGuid"
type: "string"
pattern: "^[A-Za-z0-9_/+-]+$"
minLength: 1
maxLength: 50
origin:
anyOf:
- type: "object"
properties:
kind:
type: "string"
enum: ['hg.mozilla.org']
project:
type: "string"
pattern: "^[A-Za-z0-9_-]+$"
minLength: 1
maxLength: 50
revision:
type: "string"
pattern: "^[0-9a-f]+$"
minLength: 40
maxLength: 40
pushLogID:
type: "integer"
required: [kind, project, revision]
- type: "object"
properties:
kind:
type: "string"
enum: ['github.com']
project:
type: "string"
pattern: "^[0-9a-f]+$"
minLength: 1
maxLength: 50
revision:
type: "string"
minLength: 40
maxLength: 40
pullRequestID:
type: "integer"
required: [kind, project, revision]
display:
type: "object"
properties:
jobSymbol:
title: "jobSymbol"
type: "string"
# spaces and "?" are not valid for job symbols
pattern: "^[A-Za-z0-9._-]+$"
minLength: 1
maxLength: 25
groupSymbol:
title: "group symbol"
type: "string"
# spaces not valid for group symbols
pattern: "^[A-Za-z0-9/?_-]+$"
minLength: 1
maxLength: 25
# could do without these if we require job type and group to exist prior
jobName:
title: "job name"
type: "string"
minLength: 1
maxLength: 100
groupName:
title: "group name"
type: "string"
pattern: "^[A-Za-z0-9_-]+$"
minLength: 1
maxLength: 100
required:
- jobSymbol
- groupSymbol
state:
title: "state"
description: |
unscheduled: not yet scheduled
pending: not yet started
running: currently in progress
completed: Job ran through to completion
type: "string"
enum:
- unscheduled
- pending
- running
- completed
result:
title: "result"
description: |
fail: A failure
exception: An infrastructure error/exception
success: Build/Test executed without error or failure
canceled: The job was cancelled by a user
unknown: When the job is not yet completed
type: "string"
enum:
- success
- fail
- exception
- canceled
- unknown
jobKind:
type: "string"
enum:
- build
- test
tier:
type: "integer"
minimum: 1
maximum: 3
isRetried:
description: True indicates this job has been retried.
type: "boolean"
coalesced:
title: "coalesced"
type: "array"
items:
title: "job guid"
type: "string"
pattern: "^[A-Za-z0-9_/+-]+$"
minLength: 1
maxLength: 50
# time data
timeScheduled:
type: "string"
format: "date-time"
timeStarted:
type: "string"
format: "date-time"
timeCompleted:
type: "string"
format: "date-time"
optionCollection:
title: "option collection"
description: |
Options are a dimension of a platform. The values here can vary wildly,
so most strings are valid for this. The list of options that are used
is maleable going forward.
Some examples of options that have been used:
opt Optimize Compiler GCC optimize flags
debug Debug flags passed in
pgo Profile Guided Optimization - Like opt, but runs with profiling, then builds again using that profiling
asan Address Sanitizer
tsan Thread Sanitizer Build
type: "array"
items:
type: "string"
minLength: 1
maxLength: 50
pattern: "^[A-Za-z0-9_-]+$"
who:
title: "who"
format: "email"
type: "string"
minLength: 1
maxLength: 50
reason:
description: |
Examples include:
- scheduled
- scheduler
- Self-serve: Rebuilt by foo@example.com
- Self-serve: Requested by foo@example.com
- The Nightly scheduler named 'b2g_mozilla-inbound periodic' triggered this build
- unknown
type: "string"
minLength: 1
maxLength: 125
productName:
description: |
Examples include:
- 'b2g'
- 'firefox'
- 'taskcluster'
- 'xulrunner'
type: "string"
minLength: 1
maxLength: 125
buildMachine:
$ref: "#/definitions/machine"
runMachine:
$ref: "#/definitions/machine"
artifacts:
type: "array"
items:
type: "object"
properties:
type:
type: "string"
enum: ["json", "text"]
name:
description: |
The artifact name can be anything. But when the name ``text_log_summary`` is used
then treeherder uses that as the summary file for the Log Viewer in the UI.
type: "string"
minLength: 1
maxLength: 50
blob:
type: "string"
minLength: 1
required:
- type
- name
- blob
logs:
type: "array"
items:
type: "object"
properties:
url:
type: "string"
format: "uri"
minLength: 1
maxLength: 255
name:
type: "string"
minLength: 1
maxLength: 50
required: [url, name]
additionalProperties: false
required:
- jobGuid
- origin
- display
- state
- jobKind
definitions:
machine:
type: "object"
properties:
name:
type: "string"
pattern: "^[A-Za-z0-9_-]+$"
minLength: 1
maxLength: 50
platform:
type: "string"
pattern: "^[A-Za-z0-9_-]+$"
minLength: 1
maxLength: 25
os:
type: "string"
pattern: "^[A-Za-z0-9_-]+$"
minLength: 1
maxLength: 25
architecture:
type: "string"
pattern: "^[A-Za-z0-9_-]+$"
minLength: 1
maxLength: 25
required:
- name
- platform
- os
- architecture