You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .helm-staging.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ providers:
27
27
app_id: 17877
28
28
private_key: /local/lookout/private-key.pem
29
29
secretName: lookout-staging-github-key
30
-
comment_footer: '_If you have feedback about this comment, please, [tell us](%s)._'
30
+
comment_footer: "_{{if .Feedback}}If you have feedback about this comment made by the analyzer {{.Name}}, please, [tell us]({{.Feedback}}){{else}}Comment made by the analyzer {{.Name}}{{end}}._"
Copy file name to clipboardExpand all lines: config.yml.tpl
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ analyzers:
8
8
9
9
providers:
10
10
github:
11
-
comment_footer: '_If you have feedback about this comment, please, [tell us](%s)._'
11
+
comment_footer: "_{{if .Feedback}}If you have feedback about this comment made by the analyzer {{.Name}}, please, [tell us]({{.Feedback}}){{else}}Comment made by the analyzer {{.Name}}{{end}}._"
12
12
# The minimum watch interval to discover new pull requests and push events
Copy file name to clipboardExpand all lines: docs/configuration.md
+24-10Lines changed: 24 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,14 +39,14 @@ The `providers.github` key configures how **source{d} Lookout** will connect wit
39
39
```yaml
40
40
providers:
41
41
github:
42
-
comment_footer: "_If you have feedback about this comment, please, [tell us](%s)._"
42
+
comment_footer: "_Comment made by '{{.Name}}'{{with .Feedback}}, [tell us]({{.}}){{end}}._"
43
43
# app_id: 1234
44
44
# private_key: ./key.pem
45
45
# installation_sync_interval: 1h
46
46
# watch_min_interval: 2s
47
47
```
48
48
49
-
`comment_footer` key defines a format-string that will be used for custom messages for every message posted on GitHub; see how to [add a custom message to the posted comments](#add-a-custom-message-to-the-posted-comments)
49
+
`comment_footer` key defines the [go template](https://golang.org/pkg/text/template) that will be used for custom messages for every message posted on GitHub; see how to [add a custom message to the posted comments](#add-a-custom-message-to-the-posted-comments)
50
50
51
51
### Authentication with GitHub
52
52
@@ -141,17 +141,31 @@ analyzers:
141
141
142
142
### Add a Custom Message to the Posted Comments
143
143
144
-
You can configure **source{d} Lookout** to add a custom message to every comment that each analyzer returns. This custom message will be created following the rule:
If any of those two keys are not defined, the custom message won't be added.
144
+
You can configure **source{d} Lookout** to add a custom message to every comment that each analyzer returns. This custom message will be created from the template defined by `providers.github.comment_footer`, using the configuration set for each analyzer.
149
145
150
-
Example:
151
-
```text
152
-
"_If you have feedback about this comment, please, [tell us](%s)._"
146
+
If the template (`providers.github.comment_footer`) is empty, or the analyzer configuration does not define any of the values that the template requires, the custom message won't be added.
147
+
148
+
For example, for this configuration, each analyzer needs to define `name` and `settings.email`:
149
+
150
+
```yaml
151
+
providers:
152
+
github:
153
+
comment_footer: "Comment made by analyzer {{.Name}}, [email me]({{.Settings.email}})."
154
+
155
+
analyzers:
156
+
- name: Fancy Analyzer
157
+
addr: ipv4://localhost:9930
158
+
settings:
159
+
email: admin@example.org
160
+
- name: Awesome Analyzer
161
+
addr: ipv4://localhost:9931
153
162
```
154
163
164
+
Comments from `Fancy Analyzer` will have this footer appended:
165
+
>_Comment made by analyzer Fancy Analyzer, [email me](admin@example.org)._
166
+
167
+
but comments from `Awesome Analyzer` wont have a footer message because in its configuration it's missing the `settings.email` value.
0 commit comments