Skip to content

Commit

Permalink
chore: Tweak APPROVALNOTIFIER markdown template to render consistent …
Browse files Browse the repository at this point in the history
…HTML

Currently the rendered HTML on gitlab is confusing:

```
This pull-request has been approved by: To complete the pull request process, please assign <user> You can assign the PR to them by writing /lh-assign @<user> in a comment when ready.
```

The above content are in one paragraph without new lines or `.`.

Tweak according to [CommonMark Spec][1], since both [GitHub Flavored Markdown
Spec][2] and [GitLab Flavored Markdown][3] are based on it.

This also add a missing newline before `To complete ...`, so it will take
it's own paragraph.

[1]: https://spec.commonmark.org/0.31.2/#hard-line-breaks
[2]: https://github.github.com/gfm/#hard-line-breaks
[3]: https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/user/markdown.md#newlines
  • Loading branch information
azuwis committed Jan 2, 2025
1 parent 3c5a461 commit 9fb1591
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/plugins/approve/approvers/owners.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,10 +638,10 @@ Approval requirements bypassed by manually added approval.
{{end -}}
This pull-request has been approved by:{{range $index, $approval := .ap.ListApprovals}}{{if $index}}, {{else}} {{end}}{{$approval}}{{end}}
{{- if (and (not .ap.AreFilesApproved) (not (call .ap.ManuallyApproved))) }}
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign {{range $index, $cc := .ap.GetCCs}}{{if $index}}, {{end}}**{{$cc}}**{{end}}
{{ if (and (not .ap.AreFilesApproved) (not (call .ap.ManuallyApproved))) -}}
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign {{range $index, $cc := .ap.GetCCs}}{{if $index}}, {{end}}**{{$cc}}**{{end}}.
You can assign the PR to them by writing `+"`/{{.lhPrefix}}assign {{range $index, $cc := .ap.GetQuotedCCs .providerType}}{{if $index}} {{end}}@{{$cc}}{{end}}`"+` in a comment when ready.
{{- end}}
{{ end -}}
{{if not .ap.RequireIssue -}}
{{else if .ap.AssociatedIssue -}}
Expand Down

0 comments on commit 9fb1591

Please sign in to comment.