diff options
| author | Taras Madan <tarasmadan@google.com> | 2023-06-19 11:33:36 +0200 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2023-06-19 14:00:42 +0200 |
| commit | d521bc5692c2ea3fa25a1a2ae3190b18c0dfc181 (patch) | |
| tree | 4216d4389b231d818bc653589ad151bd98a8c08c | |
| parent | f3921d4d63f97d1f1fb49a69ea85744bb7ef184b (diff) | |
dashboard/app: export discussion link, jsonAPI
| -rw-r--r-- | dashboard/app/public_json_api.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/dashboard/app/public_json_api.go b/dashboard/app/public_json_api.go index f2220eee6..0832b7721 100644 --- a/dashboard/app/public_json_api.go +++ b/dashboard/app/public_json_api.go @@ -6,9 +6,11 @@ package main // publicApiBugDescription is used to serve the /bug HTTP requests // and provide JSON description of the BUG. Backward compatible. type PublicAPIBugDescription struct { - Version int `json:"version"` - Title string `json:"title,omitempty"` - Crashes []PublicAPICrashDescription `json:"crashes,omitempty"` + Version int `json:"version"` + Title string `json:"title,omitempty"` + // links to the discussions + Discussions []string `json:"discussions,omitempty"` + Crashes []PublicAPICrashDescription `json:"crashes,omitempty"` } type PublicAPICrashDescription struct { @@ -28,6 +30,12 @@ func GetExtAPIDescrForBugPage(bugPage *uiBugPage) *PublicAPIBugDescription { return &PublicAPIBugDescription{ Version: 1, Title: bugPage.Bug.Title, + Discussions: func() []string { + if bugPage.Bug.ExternalLink == "" { + return nil + } + return []string{bugPage.Bug.ExternalLink} + }(), Crashes: []PublicAPICrashDescription{{ SyzReproducer: crash.ReproSyzLink, CReproducer: crash.ReproCLink, |
