aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/dashapi/dashapi.go
diff options
context:
space:
mode:
Diffstat (limited to 'dashboard/dashapi/dashapi.go')
-rw-r--r--dashboard/dashapi/dashapi.go49
1 files changed, 49 insertions, 0 deletions
diff --git a/dashboard/dashapi/dashapi.go b/dashboard/dashapi/dashapi.go
index 028448b33..cdefb8080 100644
--- a/dashboard/dashapi/dashapi.go
+++ b/dashboard/dashapi/dashapi.go
@@ -102,6 +102,7 @@ type Build struct {
KernelConfig []byte
Commits []string // see BuilderPoll
FixCommits []Commit
+ Assets []NewAsset
}
type Commit struct {
@@ -396,8 +397,27 @@ type BugReport struct {
PatchLink string
BisectCause *BisectResult
BisectFix *BisectResult
+ Assets []Asset
}
+type Asset struct {
+ Title string
+ DownloadURL string
+ Type AssetType
+}
+
+type AssetType string
+
+// Asset types used throughout the system.
+// DO NOT change them, this will break compatibility with DB content.
+const (
+ BootableDisk AssetType = "bootable_disk"
+ NonBootableDisk AssetType = "non_bootable_disk"
+ KernelObject AssetType = "kernel_object"
+ KernelImage AssetType = "kernel_image"
+ HTMLCoverageReport AssetType = "html_coverage_report"
+)
+
type BisectResult struct {
Commit *Commit // for conclusive bisection
Commits []*Commit // for inconclusive bisection
@@ -537,6 +557,35 @@ func (dash *Dashboard) UploadManagerStats(req *ManagerStatsReq) error {
return dash.Query("manager_stats", req, nil)
}
+// Asset lifetime:
+// 1. syz-ci uploads it to GCS and reports to the dashboard via add_build_asset.
+// 2. dashboard periodically checks if the asset is still needed.
+// 3. syz-ci queries needed_assets to figure out which assets are still needed.
+// 4. Once an asset is not needed, syz-ci removes the corresponding file.
+type NewAsset struct {
+ DownloadURL string
+ Type AssetType
+}
+
+type AddBuildAssetsReq struct {
+ BuildID string
+ Assets []NewAsset
+}
+
+func (dash *Dashboard) AddBuildAssets(req *AddBuildAssetsReq) error {
+ return dash.Query("add_build_assets", req, nil)
+}
+
+type NeededAssetsResp struct {
+ DownloadURLs []string
+}
+
+func (dash *Dashboard) NeededAssetsList() (*NeededAssetsResp, error) {
+ resp := new(NeededAssetsResp)
+ err := dash.Query("needed_assets", nil, resp)
+ return resp, err
+}
+
type BugListResp struct {
List []string
}