diff --git a/app/models/coverage.go b/app/models/coverage.go index 6e60007..3fe83dc 100644 --- a/app/models/coverage.go +++ b/app/models/coverage.go @@ -221,7 +221,7 @@ func (c *Coverage) GetLatestBranchScoresWithPR(orgName string, repoName string, AND t.name = @typeName ORDER BY - c.created_at DESC + c.created_at DESC, c.id DESC LIMIT @limit; ` err := db.Db().Raw( @@ -353,7 +353,7 @@ func (c *Coverage) GetLatestUserScore(orgName string, repoName string, userName AND t.name = @typeName ORDER BY - c.created_at DESC + c.created_at DESC, c.id DESC LIMIT 1; ` err := db.Db().Raw( diff --git a/app/pkg/pr.go b/app/pkg/pr.go index 75e07d7..122f494 100644 --- a/app/pkg/pr.go +++ b/app/pkg/pr.go @@ -7,6 +7,7 @@ import ( md "github.com/go-spectest/markdown" "github.com/kevincobain2000/action-coveritup/models" + "github.com/sirupsen/logrus" ) const () @@ -14,10 +15,13 @@ const () type PR struct { coverageModel *models.Coverage typeModel *models.Type + log *logrus.Logger } func NewPR() *PR { - return &PR{} + return &PR{ + log: Logger(), + } } func (p *PR) Get(req *PRRequest, types []models.Type) (string, error) { @@ -110,6 +114,7 @@ func (p *PR) TypesChangedSince(req *PRRequest) ([]models.Type, error) { for _, t := range types { sbs, err := p.coverageModel.GetLatestBranchScoresWithPR(req.Org, req.Repo, req.Branch, t.Name, 2) if err != nil { + p.log.Error(err) typesChanged = append(typesChanged, t) continue }