Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions cmd/check/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package main

import (
"flag"
"fmt"
"log"
"os"
Expand All @@ -23,9 +24,33 @@ func main() {
fmt.Printf("Found %d people\n", len(people))
}

var helpFlag bool

func init() {
log.SetFlags(log.Ldate | log.Ltime | log.LUTC)

flag.BoolVar(&helpFlag, "help", false, "Show this help message")
flag.BoolVar(&helpFlag, "h", false, "Show this help message")
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), `check - validate ShiftStack team member configuration

Parses the PEOPLE environment variable and reports the number of team members
found, exiting with an error if the data is syntactically incorrect.

Environment variables:
PEOPLE JSON-formatted team member information

Flags:
`)
flag.PrintDefaults()
}
flag.Parse()

if helpFlag {
flag.Usage()
os.Exit(0)
}

ex_usage := false
if PEOPLE == "" {
ex_usage = true
Expand Down
30 changes: 30 additions & 0 deletions cmd/doctext/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package main

import (
"context"
"flag"
"fmt"
"log"
"os"
"strings"
Expand Down Expand Up @@ -106,7 +108,35 @@ func main() {
}
}

var helpFlag bool

func init() {
flag.BoolVar(&helpFlag, "help", false, "Show this help message")
flag.BoolVar(&helpFlag, "h", false, "Show this help message")
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), `doctext - notify assignees about missing release note text

Finds ShiftStack Jira bugs in late-stage statuses (Release Pending, Verified,
ON_QA) that are missing release note text and sends Slack notifications to
their assignees.

Environment variables:
SLACK_HOOK Slack webhook URL for notifications
JIRA_EMAIL Jira account email address
JIRA_TOKEN Jira API token
PEOPLE JSON-formatted team member information

Flags:
`)
flag.PrintDefaults()
}
flag.Parse()

if helpFlag {
flag.Usage()
os.Exit(0)
}

ex_usage := false
if SLACK_HOOK == "" {
ex_usage = true
Expand Down
27 changes: 27 additions & 0 deletions cmd/posttriage/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package main

import (
"context"
"flag"
"fmt"
"log"
"os"
"strings"
Expand Down Expand Up @@ -80,7 +82,32 @@ func main() {
}
}

var helpFlag bool

func init() {
flag.BoolVar(&helpFlag, "help", false, "Show this help message")
flag.BoolVar(&helpFlag, "h", false, "Show this help message")
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), `posttriage - audit triaged ShiftStack Jira bugs

Checks all bugs labelled "Triaged" and removes the label from any that no
longer meet triage criteria (e.g. missing priority or release blocker status).

Environment variables:
JIRA_EMAIL Jira account email address
JIRA_TOKEN Jira API token

Flags:
`)
flag.PrintDefaults()
}
flag.Parse()

if helpFlag {
flag.Usage()
os.Exit(0)
}

if JIRA_EMAIL == "" {
log.Print("FATAL: Required environment variable not found: JIRA_EMAIL")
os.Exit(64)
Expand Down
30 changes: 30 additions & 0 deletions cmd/pretriage/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package main

import (
"context"
"flag"
"fmt"
"log"
"math/rand"
"os"
Expand Down Expand Up @@ -200,9 +202,37 @@ func main() {
}
}

var helpFlag bool

func init() {
log.SetFlags(log.Ldate | log.Ltime | log.LUTC)

flag.BoolVar(&helpFlag, "help", false, "Show this help message")
flag.BoolVar(&helpFlag, "h", false, "Show this help message")
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), `pretriage - pre-triage ShiftStack Jira bugs

Pre-sets required fields for ART reconciliation bugs, assigns untriaged bugs
to available team members, and sends Slack notifications for each assignment.

Environment variables:
SLACK_HOOK Slack webhook URL for notifications
JIRA_EMAIL Jira account email address
JIRA_TOKEN Jira API token
JIRA_ACCOUNT_ID Jira account ID used to identify self-assigned bugs
PEOPLE JSON-formatted team member information

Flags:
`)
flag.PrintDefaults()
}
flag.Parse()

if helpFlag {
flag.Usage()
os.Exit(0)
}

queryUntriaged = query.ShiftStack + `AND ( assignee is EMPTY OR assignee = "` + JIRA_ACCOUNT_ID + `" ) AND (labels not in ("Triaged") OR labels is EMPTY)`

ex_usage := false
Expand Down
29 changes: 29 additions & 0 deletions cmd/triage/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package main

import (
"context"
"flag"
"fmt"
"log"
"os"
"strings"
Expand Down Expand Up @@ -92,7 +94,34 @@ func main() {
}
}

var helpFlag bool

func init() {
flag.BoolVar(&helpFlag, "help", false, "Show this help message")
flag.BoolVar(&helpFlag, "h", false, "Show this help message")
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), `triage - triage ShiftStack Jira bugs

Assigns untriaged ShiftStack Jira bugs to available team members and sends
Slack notifications for each assignment.

Environment variables:
SLACK_HOOK Slack webhook URL for notifications
JIRA_EMAIL Jira account email address
JIRA_TOKEN Jira API token
PEOPLE JSON-formatted team member information

Flags:
`)
flag.PrintDefaults()
}
flag.Parse()

if helpFlag {
flag.Usage()
os.Exit(0)
}

ex_usage := false
if SLACK_HOOK == "" {
ex_usage = true
Expand Down