Skip to content

Commit

Permalink
log err
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincobain2000 committed Jan 22, 2024
1 parent e35a606 commit 2c8be39
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/models/coverage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
7 changes: 6 additions & 1 deletion app/pkg/pr.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@ import (

md "github.com/go-spectest/markdown"
"github.com/kevincobain2000/action-coveritup/models"
"github.com/sirupsen/logrus"
)

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) {
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 2c8be39

Please sign in to comment.