mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-19 17:59:05 -05:00
Make the "Top-Ranking Issues" issue a little more concise
The main motivation here is that we now use PRs rather than issues to represent RFCs that have not yet been approved, and so the ranking of issues labeled "rfc" was misleading to include. All of the issues that were labeled "rfc" that were not "RFC Tracker" issues under our newer process are also labeled as "enhancement" so they will be included under the "Top Enhancements" ranking. While I was tweaking this anyway I also added a short note to the top explaining how these rankings are generated and removed some of the visual clutter from the suffixes of the individual list items, which tended to get wrapped oddly for issues with longer titles. Finally, the "script" is tweaked a little to do its API requests anonymously when GITHUB_TOKEN isn't set, which makes it easier to test locally without accidentally clobbering any real issues (since anonymous requests cannot modify anything). To _actually_ test this locally I temporarily made it print its output to stdout, but that particular part is removed for the final submission. Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
This commit is contained in:
@@ -32,7 +32,10 @@ func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
// Initialize client.
|
||||
client := github.NewClient(nil).WithAuthToken(os.Getenv("GITHUB_TOKEN"))
|
||||
client := github.NewClient(nil)
|
||||
if token := os.Getenv("GITHUB_TOKEN"); token != "" {
|
||||
client = client.WithAuthToken(token)
|
||||
}
|
||||
|
||||
// List all open issues.
|
||||
listOpts := &github.IssueListByRepoOptions{
|
||||
@@ -72,11 +75,9 @@ func main() {
|
||||
templateParams := struct {
|
||||
EnhancementIssues []*github.Issue
|
||||
BugIssues []*github.Issue
|
||||
RFCIssues []*github.Issue
|
||||
}{
|
||||
getTopIssuesByLabel("enhancement", issues),
|
||||
getTopIssuesByLabel("bug", issues),
|
||||
getTopIssuesByLabel("rfc", issues),
|
||||
}
|
||||
|
||||
// Render template for issue body.
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
The following rankings are based on the number of :+1: reactions on each issue.
|
||||
|
||||
## Top Enhancements
|
||||
{{range .EnhancementIssues}}1. {{.HTMLURL}} - {{.Reactions.PlusOne}} :+1:
|
||||
{{range .EnhancementIssues}}1. {{.HTMLURL}} ({{.Reactions.PlusOne}})
|
||||
{{end}}
|
||||
|
||||
## Top Bugs
|
||||
|
||||
{{range .BugIssues}}1. {{.HTMLURL}} - {{.Reactions.PlusOne}} :+1:
|
||||
{{end}}
|
||||
|
||||
## Top RFCs
|
||||
|
||||
{{range .RFCIssues}}1. {{.HTMLURL}} - {{.Reactions.PlusOne}} :+1:
|
||||
{{range .BugIssues}}1. {{.HTMLURL}} ({{.Reactions.PlusOne}})
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user