Skip to content

Commit 969b59b

Browse files
Merge pull request #50 from pfnet-research/fix-annotation-key
Fix "skip auto close" annotation key
2 parents a81e80c + 127dc55 commit 969b59b

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ OPTIONS:
8585
--github-app-installation-id value GitHub App installation ID (default: 0) [$ATG_GITHUB_APP_INSTALLATION_ID]
8686
--github-app-private-key value GitHub App private key (command line argument is not recommended) [$ATG_GITHUB_APP_PRIVATE_KEY]
8787
--github-token value GitHub API token (command line argument is not recommended) [$ATG_GITHUB_TOKEN]
88-
--auto-close-resolved-issues Should issues be automatically closed when resolved. If alerts have 'atg-skip-auto-close=true' annotation, issues will not be auto-closed. (default: true) [$ATG_AUTO_CLOSE_RESOLVED_ISSUES]
88+
--auto-close-resolved-issues Should issues be automatically closed when resolved. If alerts have 'atg_skip_auto_close=true' annotation, issues will not be auto-closed. (default: true) [$ATG_AUTO_CLOSE_RESOLVED_ISSUES]
8989
--reopen-window value Alerts will create a new issue instead of reopening closed issues if the specified duration has passed [$ATG_REOPEN_WINDOW]
9090
--help, -h show help
9191
```
@@ -110,15 +110,15 @@ Issue title and body are rendered from [Go template](https://golang.org/pkg/text
110110
111111
You can use the `--auto-close-resolved-issues` flag to automatically close issues when alerts are resolved.
112112
113-
If you want to skip auto-close for some alerts, add the `atg-skip-auto-close=true` annotation to them.
113+
If you want to skip auto-close for some alerts, add the `atg_skip_auto_close=true` annotation to them.
114114
115115
```yaml
116116
- alert: HighRequestLatency
117117
expr: job:request_latency_seconds:mean5m{job="myjob"} > 0.5
118118
labels:
119119
severity: critical
120120
annotations:
121-
atg-skip-auto-close: "true"
121+
atg_skip_auto_close: "true"
122122
```
123123
124124
## Customize organization and repository

pkg/cli/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func App() *cli.App {
182182
Name: flagAutoCloseResolvedIssues,
183183
Required: false,
184184
Value: true,
185-
Usage: "Should issues be automatically closed when resolved. If alerts have 'atg-skip-auto-close=true' annotation, issues will not be auto-closed.",
185+
Usage: "Should issues be automatically closed when resolved. If alerts have 'atg_skip_auto_close=true' annotation, issues will not be auto-closed.",
186186
EnvVars: []string{"ATG_AUTO_CLOSE_RESOLVED_ISSUES"},
187187
},
188188
&noDefaultDurationFlag{

pkg/cli/templates/body.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Previous Issue: {{ $previousIssue.HTMLURL }}
5757

5858
{{- if $payload.HasSkipAutoCloseAnnotation }}
5959

60-
*This issue will not be auto-closed because the alerts have `atg-skip-auto-close=true` annotation.*
60+
*This issue will not be auto-closed because the alerts have `atg_skip_auto_close=true` annotation.*
6161
{{- end }}
6262

6363
<!-- alert data: {{json $payload}} -->

pkg/types/payload.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const (
1111
AlertStatusResolved AlertStatus = "resolved"
1212
AlertStatusFiring AlertStatus = "firing"
1313

14-
skipAutoCloseAnnotationKey = "atg-skip-auto-close"
14+
skipAutoCloseAnnotationKey = "atg_skip_auto_close"
1515
skipAutoCloseAnnotationValue = "true"
1616
)
1717

pkg/types/payload_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func TestWebhookPayloadHasSkipAutoCloseAnnotation(t *testing.T) {
2828
payload: &WebhookPayload{
2929
Alerts: []WebhookAlert{{
3030
Annotations: map[string]string{
31-
"atg-skip-auto-close": "true",
31+
"atg_skip_auto_close": "true",
3232
},
3333
}},
3434
},
@@ -69,7 +69,7 @@ func TestWebhookPayloadHasSkipAutoCloseAnnotation(t *testing.T) {
6969
Alerts: []WebhookAlert{
7070
{
7171
Annotations: map[string]string{
72-
"atg-skip-auto-close": "true",
72+
"atg_skip_auto_close": "true",
7373
},
7474
},
7575
{

0 commit comments

Comments
 (0)