Skip to content

Commit 067f7f6

Browse files
committed
Merge branch 'master' into feat/hook-event-parity
2 parents 131c712 + 5693244 commit 067f7f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+259
-253
lines changed

api/admin/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Use of this source code is governed by the LICENSE file in this repository.
44

5-
// nolint: dupl // ignore similar code
5+
//nolint:dupl // ignore similar code
66
package admin
77

88
import (

api/admin/hook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Use of this source code is governed by the LICENSE file in this repository.
44

5-
// nolint: dupl // ignore similar code
5+
//nolint:dupl // ignore similar code
66
package admin
77

88
import (

api/admin/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Use of this source code is governed by the LICENSE file in this repository.
44

5-
// nolint: dupl // ignore similar code
5+
//nolint:dupl // ignore similar code
66
package admin
77

88
import (

api/admin/secret.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Use of this source code is governed by the LICENSE file in this repository.
44

5-
// nolint: dupl // ignore similar code
5+
//nolint:dupl // ignore similar code
66
package admin
77

88
import (

api/admin/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Use of this source code is governed by the LICENSE file in this repository.
44

5-
// nolint: dupl // ignore similar code
5+
//nolint:dupl // ignore similar code
66
package admin
77

88
import (

api/admin/step.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Use of this source code is governed by the LICENSE file in this repository.
44

5-
// nolint: dupl // ignore similar code
5+
//nolint:dupl // ignore similar code
66
package admin
77

88
import (

api/admin/user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Use of this source code is governed by the LICENSE file in this repository.
44

5-
// nolint: dupl // ignore similar code
5+
//nolint:dupl // ignore similar code
66
package admin
77

88
import (

api/build.go

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"context"
99
"encoding/json"
1010
"fmt"
11-
"io/ioutil"
11+
"io"
1212
"net/http"
1313
"strconv"
1414
"strings"
@@ -85,7 +85,8 @@ import (
8585
// "$ref": "#/definitions/Error"
8686

8787
// CreateBuild represents the API handler to create a build in the configured backend.
88-
// nolint: funlen,gocyclo // ignore function length and cyclomatic complexity
88+
//
89+
//nolint:funlen,gocyclo // ignore function length and cyclomatic complexity
8990
func CreateBuild(c *gin.Context) {
9091
// capture middleware values
9192
m := c.MustGet("metadata").(*types.Metadata)
@@ -307,7 +308,7 @@ func CreateBuild(c *gin.Context) {
307308

308309
// check if the pipeline did not already exist in the database
309310
//
310-
// nolint: dupl // ignore duplicate code
311+
//nolint:dupl // ignore duplicate code
311312
if pipeline == nil {
312313
pipeline = compiled
313314
pipeline.SetRepoID(r.GetID())
@@ -327,7 +328,7 @@ func CreateBuild(c *gin.Context) {
327328
// send API call to capture the created pipeline
328329
pipeline, err = database.FromContext(c).GetPipelineForRepo(pipeline.GetCommit(), r)
329330
if err != nil {
330-
// nolint: lll // ignore long line length due to error message
331+
//nolint:lll // ignore long line length due to error message
331332
retErr := fmt.Errorf("unable to create new build: failed to get new pipeline %s/%s: %w", r.GetFullName(), pipeline.GetCommit(), err)
332333

333334
util.HandleError(c, http.StatusInternalServerError, retErr)
@@ -380,7 +381,8 @@ func CreateBuild(c *gin.Context) {
380381

381382
// skipEmptyBuild checks if the build should be skipped due to it
382383
// not containing any steps besides init or clone.
383-
// nolint: goconst // ignore init and clone constants
384+
//
385+
//nolint:goconst // ignore init and clone constants
384386
func skipEmptyBuild(p *pipeline.Build) string {
385387
if len(p.Stages) == 1 {
386388
if p.Stages[0].Name == "init" {
@@ -792,7 +794,7 @@ func GetOrgBuilds(c *gin.Context) {
792794
}
793795
// Only show public repos to non-admins
794796
//
795-
// nolint: goconst // ignore admin constant
797+
//nolint:goconst // ignore admin constant
796798
if perm != "admin" {
797799
filters["visibility"] = constants.VisibilityPublic
798800
}
@@ -922,7 +924,8 @@ func GetBuild(c *gin.Context) {
922924
// "$ref": "#/definitions/Error"
923925

924926
// RestartBuild represents the API handler to restart an existing build in the configured backend.
925-
// nolint: funlen // ignore statement count
927+
//
928+
//nolint:funlen // ignore statement count
926929
func RestartBuild(c *gin.Context) {
927930
// capture middleware values
928931
m := c.MustGet("metadata").(*types.Metadata)
@@ -1134,7 +1137,7 @@ func RestartBuild(c *gin.Context) {
11341137

11351138
// check if the pipeline did not already exist in the database
11361139
//
1137-
// nolint: dupl // ignore duplicate code
1140+
//nolint:dupl // ignore duplicate code
11381141
if pipeline == nil {
11391142
pipeline = compiled
11401143
pipeline.SetRepoID(r.GetID())
@@ -1154,7 +1157,7 @@ func RestartBuild(c *gin.Context) {
11541157
// send API call to capture the created pipeline
11551158
pipeline, err = database.FromContext(c).GetPipelineForRepo(pipeline.GetCommit(), r)
11561159
if err != nil {
1157-
// nolint: lll // ignore long line length due to error message
1160+
//nolint:lll // ignore long line length due to error message
11581161
retErr := fmt.Errorf("unable to get new pipeline %s/%s: %w", r.GetFullName(), pipeline.GetCommit(), err)
11591162

11601163
util.HandleError(c, http.StatusInternalServerError, retErr)
@@ -1465,7 +1468,7 @@ func getPRNumberFromBuild(b *library.Build) (int, error) {
14651468
// execution. This creates all resources, like steps
14661469
// and services, for the build in the configured backend.
14671470
// TODO:
1468-
// - return build and error
1471+
// - return build and error.
14691472
func planBuild(database database.Service, p *pipeline.Build, b *library.Build, r *library.Repo) error {
14701473
// update fields in build object
14711474
b.SetCreated(time.Now().UTC().Unix())
@@ -1601,7 +1604,8 @@ func cleanBuild(database database.Service, b *library.Build, services []*library
16011604
// "$ref": "#/definitions/Error"
16021605

16031606
// CancelBuild represents the API handler to cancel a running build.
1604-
// nolint: funlen // ignore statement count
1607+
//
1608+
//nolint:funlen // ignore statement count
16051609
func CancelBuild(c *gin.Context) {
16061610
// capture middleware values
16071611
b := build.Retrieve(c)
@@ -1674,7 +1678,7 @@ func CancelBuild(c *gin.Context) {
16741678
defer resp.Body.Close()
16751679

16761680
// Read Response Body
1677-
respBody, err := ioutil.ReadAll(resp.Body)
1681+
respBody, err := io.ReadAll(resp.Body)
16781682
if err != nil {
16791683
retErr := fmt.Errorf("unable to read response from %s: %w", u, err)
16801684
util.HandleError(c, http.StatusBadRequest, retErr)

api/log.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func GetBuildLogs(c *gin.Context) {
150150
// CreateServiceLog represents the API handler to create
151151
// the logs for a service in the configured backend.
152152
//
153-
// nolint: dupl // ignore similar code with step
153+
//nolint:dupl // ignore similar code with step
154154
func CreateServiceLog(c *gin.Context) {
155155
// capture middleware values
156156
b := build.Retrieve(c)
@@ -445,7 +445,7 @@ func UpdateServiceLog(c *gin.Context) {
445445
// DeleteServiceLog represents the API handler to remove
446446
// the logs for a service from the configured backend.
447447
//
448-
// nolint: dupl // ignore similar code with step
448+
//nolint:dupl // ignore similar code with step
449449
func DeleteServiceLog(c *gin.Context) {
450450
// capture middleware values
451451
b := build.Retrieve(c)
@@ -535,7 +535,7 @@ func DeleteServiceLog(c *gin.Context) {
535535
// CreateStepLog represents the API handler to create
536536
// the logs for a step in the configured backend.
537537
//
538-
// nolint: dupl // ignore similar code with service
538+
//nolint:dupl // ignore similar code with service
539539
func CreateStepLog(c *gin.Context) {
540540
// capture middleware values
541541
b := build.Retrieve(c)
@@ -831,7 +831,7 @@ func UpdateStepLog(c *gin.Context) {
831831
// DeleteStepLog represents the API handler to remove
832832
// the logs for a step from the configured backend.
833833
//
834-
// nolint: dupl // ignore similar code with service
834+
//nolint:dupl // ignore similar code with service
835835
func DeleteStepLog(c *gin.Context) {
836836
// capture middleware values
837837
b := build.Retrieve(c)

api/metrics.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ func CustomMetrics(c *gin.Context) {
191191
}
192192

193193
// helper function to get the totals of resource types.
194-
// nolint: funlen,gocyclo // ignore function length and cyclomatic complexity
194+
//
195+
//nolint:funlen,gocyclo // ignore function length and cyclomatic complexity
195196
func recordGauges(c *gin.Context) {
196197
// variable to store query parameters
197198
q := MetricsQueryParameters{}

0 commit comments

Comments
 (0)