Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Branch-Protection: use debug message when unsure if PRs are required #3917

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions checks/branch_protection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@ func TestReleaseAndDevBranchProtected(t *testing.T) {
expected: scut.TestReturn{
Error: nil,
Score: 0,
NumberOfWarn: 6,
NumberOfWarn: 4,
NumberOfInfo: 0,
NumberOfDebug: 8,
NumberOfDebug: 10,
},
nonadmin: true,
defaultBranch: main,
Expand Down
11 changes: 2 additions & 9 deletions checks/evaluation/branch_protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,15 +407,8 @@ func adminReviewProtection(f *finding.Finding, doLogging bool, dl checker.Detail
if f.Outcome == finding.OutcomePositive {
score++
}
switch f.Probe {
case requiresLastPushApproval.Probe,
requiresUpToDateBranches.Probe:
logWithDebug(f, doLogging, dl)
if f.Outcome != finding.OutcomeNotAvailable {
max++
}
default:
logInfoOrWarn(f, doLogging, dl)
logWithDebug(f, doLogging, dl)
if f.Outcome != finding.OutcomeNotAvailable {
max++
}
return score, max
Expand Down
4 changes: 2 additions & 2 deletions checks/evaluation/branch_protection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -731,9 +731,9 @@ func TestBranchProtection(t *testing.T) {
},
result: scut.TestReturn{
Score: 3,
NumberOfWarn: 3,
NumberOfWarn: 2,
NumberOfInfo: 2,
NumberOfDebug: 4,
NumberOfDebug: 5,
},
},
{
Expand Down
Loading