blob: 030b78fa933b905fe620f9ca4fc33eb4eb4304a6 [file] [log] [blame]
// bug is a package for handling bug reporting URLs.
package bug
import (
perfgit ""
// Expand the uriTemplate given a link to the regressing cluster, the commit, and the user's message about the regression.
func Expand(uriTemplate string, clusterLink string, c perfgit.Commit, message string) string {
expansion := map[string]string{
"cluster_url": clusterLink,
"commit_url": c.URL,
"message": message,
url, err := uritemplates.Expand(uriTemplate, expansion)
if err != nil {
sklog.Errorf("Failed to create bug reporting URL: %s", err)
return url
// ExampleExpand expands the given uriTemplate with example data.
func ExampleExpand(uriTemplate string) string {
c := perfgit.Commit{
URL: "",
clusterLink := ""
message := "Looks like a regression."
return Expand(uriTemplate, clusterLink, c, message)