aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/api/api.go
blob: cafdd170eb65f7afb9605760794a3ef466e71598 (plain)
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
// Copyright 2024 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

// Package api provides data structures and helper methods to work with the dashboard JSON API.
// All structures in this package are backwards compatible.
package api

import "time"

const Version = 1

type BugGroup struct {
	Version int `json:"version"`
	Bugs    []BugSummary
}

type BugSummary struct {
	Title       string   `json:"title,omitempty"`
	Link        string   `json:"link"`
	LastUpdated string   `json:"last-updated,omitempty"`
	FixCommits  []Commit `json:"fix-commits,omitempty"`
}

type Bug struct {
	Version     int        `json:"version"`
	Title       string     `json:"title,omitempty"`
	ID          string     `json:"id"`
	Status      string     `json:"status"`
	FirstCrash  time.Time  `json:"first-crash"`
	LastCrash   time.Time  `json:"last-crash"`
	FixTime     *time.Time `json:"fix-time,omitempty"`
	CloseTime   *time.Time `json:"close-time,omitempty"`
	FixCommits  []Commit   `json:"fix-commits,omitempty"`
	CauseCommit *Commit    `json:"cause-commit,omitempty"`
	// Links to the discussions.
	Discussions []string `json:"discussions,omitempty"`
	Crashes     []Crash  `json:"crashes,omitempty"`
}

type Crash struct {
	Title               string `json:"title"`
	SyzReproducerLink   string `json:"syz-reproducer,omitempty"`
	CReproducerLink     string `json:"c-reproducer,omitempty"`
	KernelConfigLink    string `json:"kernel-config,omitempty"`
	KernelSourceGit     string `json:"kernel-source-git,omitempty"`
	KernelSourceCommit  string `json:"kernel-source-commit,omitempty"`
	SyzkallerGit        string `json:"syzkaller-git,omitempty"`
	SyzkallerCommit     string `json:"syzkaller-commit,omitempty"`
	CompilerDescription string `json:"compiler-description,omitempty"`
	Architecture        string `json:"architecture,omitempty"`
	CrashReportLink     string `json:"crash-report-link,omitempty"`
}

type Commit struct {
	Title  string     `json:"title"`
	Link   string     `json:"link,omitempty"`
	Hash   string     `json:"hash,omitempty"`
	Repo   string     `json:"repo,omitempty"`
	Branch string     `json:"branch,omitempty"`
	Date   *time.Time `json:"date,omitempty"`
}