go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/analysis/internal/bugs/urls.go (about)

     1  // Copyright 2023 The LUCI Authors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package bugs
    16  
    17  import "fmt"
    18  
    19  func RuleURL(uiBaseURL, project, ruleID string) string {
    20  	return fmt.Sprintf("%s/p/%s/rules/%s", uiBaseURL, project, ruleID)
    21  }
    22  
    23  func BugFiledHelpURL(uiBaseURL string) string {
    24  	return fmt.Sprintf("%s/help#new-bug-filed", uiBaseURL)
    25  }
    26  
    27  func FeedbackURL(uiBaseURL string) string {
    28  	return fmt.Sprintf("%s/help#feedback", uiBaseURL)
    29  }
    30  
    31  func ComponentSelectionHelpURL(uiBaseURL string) string {
    32  	return fmt.Sprintf("%s/help#component-selection", uiBaseURL)
    33  }
    34  
    35  func BugVerifiedHelpURL(uiBaseURL string) string {
    36  	return fmt.Sprintf("%s/help#bug-verified", uiBaseURL)
    37  }
    38  
    39  func BugReopenedHelpURL(uiBaseURL string) string {
    40  	return fmt.Sprintf("%s/help#bug-reopened", uiBaseURL)
    41  }
    42  
    43  func PriorityUpdatedHelpURL(uiBaseURL string) string {
    44  	return fmt.Sprintf("%s/help#priority-updated", uiBaseURL)
    45  }
    46  
    47  // RuleForBuganizerBugURL returns the link to the rule for
    48  // the given buganizer bug.
    49  // uiBaseURL is the base URL of the LUCI Analysis UI, excluding trailing slash.
    50  func RuleForBuganizerBugURL(uiBaseURL string, issueID int64) string {
    51  	return fmt.Sprintf("%s/b/%d", uiBaseURL, issueID)
    52  }
    53  
    54  // RuleForMonorailBugURL returns the link to the rule for
    55  // the given monorail bug.
    56  // issueID is of the form "<monorail-project>/<id>", e.g. "chromium/100".
    57  // uiBaseURL is the base URL of the LUCI Analysis UI, excluding trailing slash.
    58  func RuleForMonorailBugURL(uiBaseURL string, issueID string) string {
    59  	return fmt.Sprintf("%s/b/%s", uiBaseURL, issueID)
    60  }
    61  
    62  func PolicyActivatedHelpURL(uiBaseURL string) string {
    63  	return fmt.Sprintf("%s/help#policy-activated", uiBaseURL)
    64  }