Skip to content

Commit

Permalink
Show negative results in Signed-Tags details
Browse files Browse the repository at this point in the history
Negative results logged with a "!!" prefix.

Updates #95

$ go run . --repo=github.com/cilium/cilium --show-details --checks=Signed-Tags
Starting [Signed-Tags]
Finished [Signed-Tags]

RESULTS
-------
Signed-Tags: Fail 4
    verified tag found: v1.9.0-rc1, commit: a46b5c308779b00676bcbffe6847701984fb7ec7
    !! unverified tag found: v1.9.0-rc2, commit: 2ee8e4659ad4050154eb83008ba6434bddad44eb, reason: unsigned
    verified tag found: v1.9.0-rc3, commit: ee77e846a9b85e318d6d077c801e2615d5e7dbe3
    !! unverified tag found: v1.9.0, commit: 1cdd547dce26adb046d117494d559c64007365fd, reason: unsigned
    verified tag found: v1.9.1, commit: bb4abe1720cb56c6a5f74d0567665555ad8434f1
    found 3 of 5 verified tags
  • Loading branch information
moorereason committed Dec 20, 2020
1 parent 4ec34e9 commit eb0d488
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions checks/signed_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func init() {
}

func SignedTags(c checker.Checker) checker.CheckResult {

type ref struct {
Name githubv4.String
Target struct {
Expand Down Expand Up @@ -61,10 +60,18 @@ func SignedTags(c checker.Checker) checker.CheckResult {
return checker.RetryResult(err)
}
if gt.GetVerification().GetVerified() {
c.Logf("signed tag found: %s, commit: %s", t.Name, sha)
c.Logf("verified tag found: %s, commit: %s", t.Name, sha)
totalSigned++
} else {
c.Logf("!! unverified tag found: %s, commit: %s, reason: %s", t.Name, sha, gt.GetVerification().GetReason())
}
}

if totalReleases == 0 {
c.Logf("no releases found")
return checker.InconclusiveResult
}

c.Logf("found %d of %d verified tags", totalSigned, totalReleases)
return checker.ProportionalResult(totalSigned, totalReleases, 0.8)
}

0 comments on commit eb0d488

Please sign in to comment.