Skip to content

Commit

Permalink
fixing vaders comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Claire.Nicholas authored and Claire.Nicholas committed Dec 28, 2023
1 parent 0c00bcd commit 0758cb3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions api/build/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ func RestartBuild(c *gin.Context) {

c.JSON(http.StatusCreated, b)

d, err2 := database.FromContext(c).GetDeploymentForRepo(c, r, b.GetDeployNumber())
if err2 != nil {
logger.Errorf("unable to set get deployment for build %s: %v", entry, err2)
d, err := database.FromContext(c).GetDeploymentForRepo(c, r, b.GetDeployNumber())
if err != nil {
logger.Errorf("unable to set get deployment for build %s: %v", entry, err)
}

build := append(d.Builds, b)
Expand Down
8 changes: 8 additions & 0 deletions api/deployment/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,13 @@ func GetDeployment(c *gin.Context) {
dep = d
}

if dep == nil {
retErr := fmt.Errorf("invalid deployment parameter provided: %s", deployment)

util.HandleError(c, http.StatusBadRequest, retErr)

return
}

c.JSON(http.StatusOK, dep)
}
2 changes: 1 addition & 1 deletion database/deployment/count_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/sirupsen/logrus"
)

// CountDeploymentssForRepo gets the count of deployments by repo ID from the database.
// CountDeploymentsForRepo gets the count of deployments by repo ID from the database.
func (e *engine) CountDeploymentsForRepo(ctx context.Context, r *library.Repo) (int64, error) {

Check failure on line 14 in database/deployment/count_repo.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] database/deployment/count_repo.go#L14

unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
database/deployment/count_repo.go:14:42: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (e *engine) CountDeploymentsForRepo(ctx context.Context, r *library.Repo) (int64, error) {
                                         ^

Check failure on line 14 in database/deployment/count_repo.go

View workflow job for this annotation

GitHub Actions / full-review

unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
e.logger.WithFields(logrus.Fields{
"org": r.GetOrg(),
Expand Down

0 comments on commit 0758cb3

Please sign in to comment.