blob: f487451fc139e13b36b04855e8679d764330a641 [file] [log] [blame]
// bug is a package for handling bug reporting URLs.
package bug
import (
// 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 provider.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 := provider.Commit{
URL: "",
clusterLink := ""
message := "Looks like a regression."
return Expand(uriTemplate, clusterLink, c, message)