Skip to content

Commit

Permalink
Merge pull request #1639 from azuwis/tweak-approvalnotifier-template
Browse files Browse the repository at this point in the history
chore: Tweak APPROVALNOTIFIER markdown template to render consistent HTML
  • Loading branch information
jenkins-x-bot authored Jan 10, 2025
2 parents efe21a2 + 83e4aa6 commit 8859f66
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
40 changes: 20 additions & 20 deletions pkg/plugins/approve/approve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ Approvers can cancel approval by writing ` + "`/approve cancel`" + ` in a commen
expectComment: true,
expectedComment: `[APPROVALNOTIFIER] This PR is **NOT APPROVED**
This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **cjwagner**
This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **cjwagner**
You can assign the PR to them by writing ` + "`/assign @cjwagner`" + ` in a comment when ready.
The full list of commands accepted by this bot can be found [here](https://jenkins-x.io/v3/develop/reference/chatops/?repo=org%2Frepo).
Expand Down Expand Up @@ -410,8 +410,8 @@ Approvers can cancel approval by writing `+"`/approve cancel`"+` in a comment
expectComment: true,
expectedComment: `[APPROVALNOTIFIER] This PR is **NOT APPROVED**
This pull-request has been approved by: *[cjwagner](# "Author self-approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**
This pull-request has been approved by: *[cjwagner](# "Author self-approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**
You can assign the PR to them by writing ` + "`/assign @alice`" + ` in a comment when ready.
*No associated issue*. Update pull-request body to add a reference to an issue, or get approval with ` + "`/approve no-issue`" + `
Expand Down Expand Up @@ -451,8 +451,8 @@ Approvers can cancel approval by writing ` + "`/approve cancel`" + ` in a commen
expectComment: true,
expectedComment: `[APPROVALNOTIFIER] This PR is **NOT APPROVED**
This pull-request has been approved by: *[cjwagner](# "Author self-approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**
This pull-request has been approved by: *[cjwagner](# "Author self-approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**
You can assign the PR to them by writing ` + "`/assign @alice`" + ` in a comment when ready.
*No associated issue*. Update pull-request body to add a reference to an issue, or get approval with ` + "`/approve no-issue`" + `
Expand Down Expand Up @@ -674,8 +674,8 @@ Approvers can cancel approval by writing ` + "`/approve cancel`" + ` in a commen
comments: []*scm.Comment{
newTestComment("k8s-ci-robot", `[APPROVALNOTIFIER] This PR is **NOT APPROVED**
This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**
This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**
You can assign the PR to them by writing `+"`/assign @alice`"+` in a comment when ready.
The full list of commands accepted by this bot can be found [here](https://jenkins-x.io/v3/develop/reference/chatops/?repo=org%2Frepo).
Expand Down Expand Up @@ -752,8 +752,8 @@ Approvers can cancel approval by writing ` + "`/approve cancel`" + ` in a commen
expectComment: true,
expectedComment: `[APPROVALNOTIFIER] This PR is **NOT APPROVED**
This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **cjwagner**
This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **cjwagner**
You can assign the PR to them by writing ` + "`/assign @cjwagner`" + ` in a comment when ready.
The full list of commands accepted by this bot can be found [here](https://jenkins-x.io/v3/develop/reference/chatops/?repo=org%2Frepo).
Expand Down Expand Up @@ -822,8 +822,8 @@ Approvers can cancel approval by writing ` + "`/approve cancel`" + ` in a commen
expectComment: true,
expectedComment: `[APPROVALNOTIFIER] This PR is **NOT APPROVED**
This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **cjwagner**
This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **cjwagner**
You can assign the PR to them by writing ` + "`/assign @cjwagner`" + ` in a comment when ready.
The full list of commands accepted by this bot can be found [here](https://jenkins-x.io/v3/develop/reference/chatops/?repo=org%2Frepo).
Expand Down Expand Up @@ -860,8 +860,8 @@ Approvers can cancel approval by writing ` + "`/approve cancel`" + ` in a commen
expectComment: true,
expectedComment: `[APPROVALNOTIFIER] This PR is **NOT APPROVED**
This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **cjwagner**
This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **cjwagner**
You can assign the PR to them by writing ` + "`/assign @cjwagner`" + ` in a comment when ready.
The full list of commands accepted by this bot can be found [here](https://jenkins-x.io/v3/develop/reference/chatops/?repo=org%2Frepo).
Expand Down Expand Up @@ -936,8 +936,8 @@ Approvers can cancel approval by writing ` + "`/approve cancel`" + ` in a commen
expectComment: true,
expectedComment: `[APPROVALNOTIFIER] This PR is **NOT APPROVED**
This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **cjwagner**
This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **cjwagner**
You can assign the PR to them by writing ` + "`/assign @cjwagner`" + ` in a comment when ready.
The full list of commands accepted by this bot can be found [here](https://jenkins-x.io/v3/develop/reference/chatops/?repo=org%2Frepo).
Expand Down Expand Up @@ -971,8 +971,8 @@ Approvers can cancel approval by writing ` + "`/approve cancel`" + ` in a commen
expectComment: true,
expectedComment: `[APPROVALNOTIFIER] This PR is **NOT APPROVED**
This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **cjwagner**
This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **cjwagner**
You can assign the PR to them by writing ` + "`/assign @cjwagner`" + ` in a comment when ready.
The full list of commands accepted by this bot can be found [here](https://jenkins-x.io/v3/develop/reference/chatops/?repo=org%2Frepo).
Expand Down Expand Up @@ -1109,8 +1109,8 @@ Approvers can cancel approval by writing ` + "`/approve cancel`" + ` in a commen
expectComment: true,
expectedComment: `[APPROVALNOTIFIER] This PR is **NOT APPROVED**
This pull-request has been approved by: *[cjwagner](# "Author self-approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**
This pull-request has been approved by: *[cjwagner](# "Author self-approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**
You can assign the PR to them by writing ` + "`/assign @alice`" + ` in a comment when ready.
*No associated issue*. Update pull-request body to add a reference to an issue, or get approval with ` + "`/approve no-issue`" + `
Expand Down
28 changes: 14 additions & 14 deletions pkg/plugins/approve/approvers/approvers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,8 @@ func TestGetMessage(t *testing.T) {

want := `[APPROVALNOTIFIER] This PR is **NOT APPROVED**
This pull-request has been approved by: *[Bill](REFERENCE "Approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**
This pull-request has been approved by: *[Bill](REFERENCE "Approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**
You can assign the PR to them by writing ` + "`/assign @alice`" + ` in a comment when ready.
*No associated issue*. Update pull-request body to add a reference to an issue, or get approval with ` + "`/approve no-issue`" + `
Expand Down Expand Up @@ -751,8 +751,8 @@ func TestGetMessageBitBucketServer(t *testing.T) {

want := `[APPROVALNOTIFIER] This PR is **NOT APPROVED**
This pull-request has been approved by: *[Bill](REFERENCE "Approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**
This pull-request has been approved by: *[Bill](REFERENCE "Approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**
You can assign the PR to them by writing ` + "`/assign @\"alice\"`" + ` in a comment when ready.
*No associated issue*. Update pull-request body to add a reference to an issue, or get approval with ` + "`/approve no-issue`" + `
Expand Down Expand Up @@ -792,8 +792,8 @@ func TestGetMessageGitLab(t *testing.T) {

want := `[APPROVALNOTIFIER] This PR is **NOT APPROVED**
This pull-request has been approved by: *[Bill](REFERENCE "Approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**
This pull-request has been approved by: *[Bill](REFERENCE "Approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**
You can assign the PR to them by writing ` + "`/assign @alice`" + ` in a comment when ready.
*No associated issue*. Update pull-request body to add a reference to an issue, or get approval with ` + "`/approve no-issue`" + `
Expand Down Expand Up @@ -833,8 +833,8 @@ func TestGetMessageWithPrefix(t *testing.T) {

want := `[APPROVALNOTIFIER] This PR is **NOT APPROVED**
This pull-request has been approved by: *[Bill](REFERENCE "Approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**
This pull-request has been approved by: *[Bill](REFERENCE "Approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**
You can assign the PR to them by writing ` + "`/lh-assign @alice`" + ` in a comment when ready.
*No associated issue*. Update pull-request body to add a reference to an issue, or get approval with ` + "`/lh-approve no-issue`" + `
Expand Down Expand Up @@ -915,8 +915,8 @@ func TestGetMessageNoneApproved(t *testing.T) {
ap.RequireIssue = true
want := `[APPROVALNOTIFIER] This PR is **NOT APPROVED**
This pull-request has been approved by: *[John](REFERENCE "Author self-approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**, **bill**
This pull-request has been approved by: *[John](REFERENCE "Author self-approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**, **bill**
You can assign the PR to them by writing ` + "`/assign @alice @bill`" + ` in a comment when ready.
*No associated issue*. Update pull-request body to add a reference to an issue, or get approval with ` + "`/approve no-issue`" + `
Expand Down Expand Up @@ -1043,8 +1043,8 @@ func TestGetMessageMDOwners(t *testing.T) {
ap.RequireIssue = true
want := `[APPROVALNOTIFIER] This PR is **NOT APPROVED**
This pull-request has been approved by: *[John](REFERENCE "Author self-approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**, **doctor**
This pull-request has been approved by: *[John](REFERENCE "Author self-approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**, **doctor**
You can assign the PR to them by writing ` + "`/assign @alice @doctor`" + ` in a comment when ready.
*No associated issue*. Update pull-request body to add a reference to an issue, or get approval with ` + "`/approve no-issue`" + `
Expand Down Expand Up @@ -1084,8 +1084,8 @@ func TestGetMessageDifferentGitHubLink(t *testing.T) {
ap.RequireIssue = true
want := `[APPROVALNOTIFIER] This PR is **NOT APPROVED**
This pull-request has been approved by: *[John](REFERENCE "Author self-approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**, **doctor**
This pull-request has been approved by: *[John](REFERENCE "Author self-approved")*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **alice**, **doctor**
You can assign the PR to them by writing ` + "`/assign @alice @doctor`" + ` in a comment when ready.
*No associated issue*. Update pull-request body to add a reference to an issue, or get approval with ` + "`/approve no-issue`" + `
Expand Down
4 changes: 2 additions & 2 deletions pkg/plugins/approve/approvers/owners.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,8 @@ 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}}
Expand Down

0 comments on commit 8859f66

Please sign in to comment.