Skip to content

Commit

Permalink
Changed belongs to belong in error message, add integration tests(#108)
Browse files Browse the repository at this point in the history
Co-authored-by: Mateusz Szostok <szostok.mateusz@gmail.com>
  • Loading branch information
kyleellman and mszostok committed Feb 12, 2022
1 parent e933870 commit 0e709b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/check/valid_owner.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (v *ValidOwner) validateTeam(ctx context.Context, name string) *validateErr
team := parts[1]

if org != v.orgName {
return newValidateError("Team %q does not belongs to %q organization.", team, v.orgName)
return newValidateError("Team %q does not belong to %q organization.", name, v.orgName)
}

teamExists := func() bool {
Expand All @@ -208,7 +208,7 @@ func (v *ValidOwner) validateTeam(ctx context.Context, name string) *validateErr
}

if !teamExists() {
return newValidateError("Team %q does not exist in organization %q.", team, org)
return newValidateError("Team %q does not exist in organization %q.", name, org)
}

// repo contains the permissions for the team slug given
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
[err] line 15: Team "vikings" cannot review PRs on "codeowners-samples" as neither it nor any parent team has write permissions.
[err] line 15: Team "warriors" does not have permissions associated with the repository "codeowners-samples".
[err] line 15: Team "wolf-pack" does not have permissions associated with the repository "codeowners-samples".
[err] line 17: Team "not-existing-team" does not exist in organization "gh-codeowners".
[err] line 17: Team "@gh-codeowners/not-existing-team" does not exist in organization "gh-codeowners".
[err] line 17: Team "@wrong-org/a-team" does not belong to "gh-codeowners" organization.
[war] line 23: Missing owner, at least one owner is required

1 check(s) executed, 1 failure(s)

0 comments on commit 0e709b4

Please sign in to comment.