Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use server API and compiler types #609

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/vela-worker/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

"github.com/go-vela/sdk-go/vela"
api "github.com/go-vela/server/api/types"
"github.com/go-vela/server/compiler/types/pipeline"
"github.com/go-vela/server/queue/models"
"github.com/go-vela/types"
"github.com/go-vela/types/constants"
"github.com/go-vela/types/library"
"github.com/go-vela/types/pipeline"
"github.com/go-vela/worker/executor"
"github.com/go-vela/worker/runtime"
"github.com/go-vela/worker/version"
Expand All @@ -27,8 +27,8 @@
// exec is a helper function to poll the queue
// and execute Vela pipelines for the Worker.
//
//nolint:nilerr,funlen // ignore returning nil - don't want to crash worker

Check failure on line 30 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/exec.go#L30

directive `//nolint:nilerr,funlen // ignore returning nil - don't want to crash worker` is unused for linter "nilerr" (nolintlint)
Raw output
cmd/vela-worker/exec.go:30:1: directive `//nolint:nilerr,funlen // ignore returning nil - don't want to crash worker` is unused for linter "nilerr" (nolintlint)
//nolint:nilerr,funlen // ignore returning nil - don't want to crash worker
^
func (w *Worker) exec(index int, config *api.Worker) error {

Check failure on line 31 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / diff-review

cyclomatic complexity 31 of func `(*Worker).exec` is high (> 30) (gocyclo)

Check failure on line 31 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / full-review

cyclomatic complexity 31 of func `(*Worker).exec` is high (> 30) (gocyclo)

Check failure on line 31 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/exec.go#L31

cyclomatic complexity 31 of func `(*Worker).exec` is high (> 30) (gocyclo)
Raw output
cmd/vela-worker/exec.go:31:1: cyclomatic complexity 31 of func `(*Worker).exec` is high (> 30) (gocyclo)
func (w *Worker) exec(index int, config *api.Worker) error {
^
var err error

// setup the version
Expand Down
2 changes: 1 addition & 1 deletion cmd/vela-worker/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
_ "github.com/joho/godotenv/autoload"

api "github.com/go-vela/server/api/types"
"github.com/go-vela/server/compiler/types/pipeline"
"github.com/go-vela/server/queue"
"github.com/go-vela/types/constants"
"github.com/go-vela/types/pipeline"
"github.com/go-vela/worker/executor"
"github.com/go-vela/worker/runtime"
)
Expand Down
2 changes: 1 addition & 1 deletion executor/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"

api "github.com/go-vela/server/api/types"
"github.com/go-vela/types/pipeline"
"github.com/go-vela/server/compiler/types/pipeline"
)

// Engine represents the interface for Vela integrating
Expand Down
2 changes: 1 addition & 1 deletion executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"github.com/go-vela/sdk-go/vela"
api "github.com/go-vela/server/api/types"
"github.com/go-vela/server/api/types/actions"
"github.com/go-vela/server/compiler/types/pipeline"
"github.com/go-vela/server/mock/server"
"github.com/go-vela/types/constants"
"github.com/go-vela/types/pipeline"
"github.com/go-vela/worker/executor/linux"
"github.com/go-vela/worker/executor/local"
"github.com/go-vela/worker/runtime/docker"
Expand Down
9 changes: 4 additions & 5 deletions executor/linux/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import (
"time"

api "github.com/go-vela/server/api/types"
"github.com/go-vela/server/compiler/types/pipeline"
"github.com/go-vela/types/constants"
"github.com/go-vela/types/library"
"github.com/go-vela/types/pipeline"
"github.com/go-vela/worker/internal/service"
"github.com/go-vela/worker/internal/step"
)
Expand Down Expand Up @@ -63,7 +62,7 @@ func (c *client) CancelBuild() (*api.Build, error) {
s, err := service.Load(_service, &c.services)
if err != nil {
// create the library service object
s = new(library.Service)
s = new(api.Service)
s.SetName(_service.Name)
s.SetNumber(_service.Number)
s.SetImage(_service.Image)
Expand Down Expand Up @@ -104,7 +103,7 @@ func (c *client) CancelBuild() (*api.Build, error) {
s, err := step.Load(_step, &c.steps)
if err != nil {
// create the library step object
s = new(library.Step)
s = new(api.Step)
s.SetName(_step.Name)
s.SetNumber(_step.Number)
s.SetImage(_step.Image)
Expand Down Expand Up @@ -146,7 +145,7 @@ func (c *client) CancelBuild() (*api.Build, error) {
s, err := step.Load(_step, &c.steps)
if err != nil {
// create the library step object
s = new(library.Step)
s = new(api.Step)
s.SetName(_step.Name)
s.SetNumber(_step.Number)
s.SetImage(_step.Image)
Expand Down
7 changes: 4 additions & 3 deletions executor/linux/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import (

"golang.org/x/sync/errgroup"

api "github.com/go-vela/server/api/types"
"github.com/go-vela/server/compiler/types/pipeline"
"github.com/go-vela/types/constants"
"github.com/go-vela/types/library"
"github.com/go-vela/types/pipeline"
"github.com/go-vela/worker/internal/build"
context2 "github.com/go-vela/worker/internal/context"
"github.com/go-vela/worker/internal/image"
Expand Down Expand Up @@ -699,8 +700,8 @@ func (c *client) StreamBuild(ctx context.Context) error {
func loadLazySecrets(c *client, _step *pipeline.Container) error {
_log := new(library.Log)

lazySecrets := make(map[string]*library.Secret)
lazyNoSubSecrets := make(map[string]*library.Secret)
lazySecrets := make(map[string]*api.Secret)
lazyNoSubSecrets := make(map[string]*api.Secret)

// this requires a small preface and brief description on
// how normal secrets make it into a container:
Expand Down
2 changes: 1 addition & 1 deletion executor/linux/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"github.com/go-vela/sdk-go/vela"
api "github.com/go-vela/server/api/types"
"github.com/go-vela/server/compiler/native"
"github.com/go-vela/server/compiler/types/pipeline"
"github.com/go-vela/server/mock/server"
"github.com/go-vela/types/constants"
"github.com/go-vela/types/pipeline"
"github.com/go-vela/worker/internal/message"
"github.com/go-vela/worker/runtime"
"github.com/go-vela/worker/runtime/docker"
Expand Down Expand Up @@ -199,12 +199,12 @@
}

loggedError := false
for _, logEntry := range loggerHook.AllEntries() {

Check failure on line 202 in executor/linux/build_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/linux/build_test.go#L202

ranges should only be cuddled with assignments used in the iteration (wsl)
Raw output
executor/linux/build_test.go:202:4: ranges should only be cuddled with assignments used in the iteration (wsl)
			for _, logEntry := range loggerHook.AllEntries() {
			^
// Many errors during StreamBuild get logged and ignored.
// So, Make sure there are no errors logged during StreamBuild.
if logEntry.Level == logrus.ErrorLevel {
loggedError = true
if !test.logError {

Check failure on line 207 in executor/linux/build_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/linux/build_test.go#L207

if statements should only be cuddled with assignments used in the if statement itself (wsl)
Raw output
executor/linux/build_test.go:207:6: if statements should only be cuddled with assignments used in the if statement itself (wsl)
					if !test.logError {
					^
t.Errorf("%s StreamBuild for %s logged an Error: %v", test.name, test.pipeline, logEntry.Message)
}
}
Expand Down Expand Up @@ -386,7 +386,7 @@
// So, Make sure there are no errors logged during StreamBuild.
if logEntry.Level == logrus.ErrorLevel {
loggedError = true
if !test.logError {

Check failure on line 389 in executor/linux/build_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/linux/build_test.go#L389

if statements should only be cuddled with assignments used in the if statement itself (wsl)
Raw output
executor/linux/build_test.go:389:6: if statements should only be cuddled with assignments used in the if statement itself (wsl)
					if !test.logError {
					^
t.Errorf("%s StreamBuild for %s logged an Error: %v", test.name, test.pipeline, logEntry.Message)
}
}
Expand Down Expand Up @@ -837,7 +837,7 @@
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
logger := testLogger.WithFields(logrus.Fields{"test": test.name})
defer loggerHook.Reset()

Check failure on line 840 in executor/linux/build_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/linux/build_test.go#L840

defer statements should only be cuddled with expressions on same variable (wsl)
Raw output
executor/linux/build_test.go:840:4: defer statements should only be cuddled with expressions on same variable (wsl)
			defer loggerHook.Reset()
			^

_pipeline, _, err := compiler.
Duplicate().
Expand Down Expand Up @@ -942,7 +942,7 @@

percents := []int{0, 0, 50, 100}
lastIndex := len(percents) - 1
for index, stepsCompletedPercent := range percents {

Check failure on line 945 in executor/linux/build_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/linux/build_test.go#L945

only one cuddle assignment allowed before range statement (wsl)
Raw output
executor/linux/build_test.go:945:6: only one cuddle assignment allowed before range statement (wsl)
					for index, stepsCompletedPercent := range percents {
					^
if index == 0 || index == lastIndex {
stepsRunningCount = 0
} else {
Expand Down Expand Up @@ -989,7 +989,7 @@
}
}
}
if test.logError && !loggedError {

Check failure on line 992 in executor/linux/build_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/linux/build_test.go#L992

if statements should only be cuddled with assignments (wsl)
Raw output
executor/linux/build_test.go:992:4: if statements should only be cuddled with assignments (wsl)
			if test.logError && !loggedError {
			^
t.Errorf("%s StreamBuild for %s did not log an Error but should have", test.name, test.pipeline)
}
})
Expand Down Expand Up @@ -1097,7 +1097,7 @@
streamFunc: func(c *client) message.StreamFunc {
return c.StreamService
},
planFunc: func(c *client) planFuncType {

Check failure on line 1100 in executor/linux/build_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/linux/build_test.go#L1100

unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
executor/linux/build_test.go:1100:19: unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
			planFunc: func(c *client) planFuncType {
			               ^
// simulate failure to call PlanService
return planNothing
},
Expand Down Expand Up @@ -1480,7 +1480,7 @@
streamRequests := make(chan message.StreamRequest)

logger := testLogger.WithFields(logrus.Fields{"test": test.name})
defer loggerHook.Reset()

Check failure on line 1483 in executor/linux/build_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/linux/build_test.go#L1483

defer statements should only be cuddled with expressions on same variable (wsl)
Raw output
executor/linux/build_test.go:1483:4: defer statements should only be cuddled with expressions on same variable (wsl)
			defer loggerHook.Reset()
			^

_pipeline, _, err := compiler.
Duplicate().
Expand All @@ -1500,7 +1500,7 @@
case constants.DriverKubernetes:
_pod := testPodFor(_pipeline)
_runtime, err = kubernetes.NewMock(_pod)
if err != nil {

Check failure on line 1503 in executor/linux/build_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/linux/build_test.go#L1503

only one cuddle assignment allowed before if statement (wsl)
Raw output
executor/linux/build_test.go:1503:5: only one cuddle assignment allowed before if statement (wsl)
				if err != nil {
				^
t.Errorf("unable to create kubernetes runtime engine: %v", err)
}
case constants.DriverDocker:
Expand Down Expand Up @@ -1592,17 +1592,17 @@
}

loggedError := false
for _, logEntry := range loggerHook.AllEntries() {

Check failure on line 1595 in executor/linux/build_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/linux/build_test.go#L1595

ranges should only be cuddled with assignments used in the iteration (wsl)
Raw output
executor/linux/build_test.go:1595:4: ranges should only be cuddled with assignments used in the iteration (wsl)
			for _, logEntry := range loggerHook.AllEntries() {
			^
// Many errors during StreamBuild get logged and ignored.
// So, Make sure there are no errors logged during StreamBuild.
if logEntry.Level == logrus.ErrorLevel {
loggedError = true
if !test.logError {

Check failure on line 1600 in executor/linux/build_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/linux/build_test.go#L1600

if statements should only be cuddled with assignments used in the if statement itself (wsl)
Raw output
executor/linux/build_test.go:1600:6: if statements should only be cuddled with assignments used in the if statement itself (wsl)
					if !test.logError {
					^
t.Errorf("%s StreamBuild for %s logged an Error: %v", test.name, test.pipeline, logEntry.Message)
}
}
}
if test.logError && !loggedError {

Check failure on line 1605 in executor/linux/build_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/linux/build_test.go#L1605

if statements should only be cuddled with assignments (wsl)
Raw output
executor/linux/build_test.go:1605:4: if statements should only be cuddled with assignments (wsl)
			if test.logError && !loggedError {
			^
t.Errorf("%s StreamBuild for %s did not log an Error but should have", test.name, test.pipeline)
}
})
Expand Down Expand Up @@ -1754,7 +1754,7 @@
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
logger := testLogger.WithFields(logrus.Fields{"test": test.name})
defer loggerHook.Reset()

Check failure on line 1757 in executor/linux/build_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/linux/build_test.go#L1757

defer statements should only be cuddled with expressions on same variable (wsl)
Raw output
executor/linux/build_test.go:1757:4: defer statements should only be cuddled with expressions on same variable (wsl)
			defer loggerHook.Reset()
			^

_pipeline, _, err := compiler.
Duplicate().
Expand Down Expand Up @@ -1825,7 +1825,7 @@
}

loggedError := false
for _, logEntry := range loggerHook.AllEntries() {

Check failure on line 1828 in executor/linux/build_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/linux/build_test.go#L1828

ranges should only be cuddled with assignments used in the iteration (wsl)
Raw output
executor/linux/build_test.go:1828:4: ranges should only be cuddled with assignments used in the iteration (wsl)
			for _, logEntry := range loggerHook.AllEntries() {
			^
// Many errors during StreamBuild get logged and ignored.
// So, Make sure there are no errors logged during StreamBuild.
if logEntry.Level == logrus.ErrorLevel {
Expand Down
11 changes: 5 additions & 6 deletions executor/linux/linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import (

"github.com/go-vela/sdk-go/vela"
api "github.com/go-vela/server/api/types"
"github.com/go-vela/types/library"
"github.com/go-vela/types/pipeline"
"github.com/go-vela/server/compiler/types/pipeline"
"github.com/go-vela/worker/internal/message"
"github.com/go-vela/worker/runtime"
)
Expand All @@ -25,8 +24,8 @@ type (
Logger *logrus.Entry
Vela *vela.Client
Runtime runtime.Engine
Secrets map[string]*library.Secret
NoSubSecrets map[string]*library.Secret
Secrets map[string]*api.Secret
NoSubSecrets map[string]*api.Secret
Hostname string
Version string
OutputCtn *pipeline.Container
Expand Down Expand Up @@ -117,10 +116,10 @@ func New(opts ...Opt) (*client, error) {
}

// instantiate map for non-plugin secrets
c.Secrets = make(map[string]*library.Secret)
c.Secrets = make(map[string]*api.Secret)

// instantiate map for non-substituted secrets
c.NoSubSecrets = make(map[string]*library.Secret)
c.NoSubSecrets = make(map[string]*api.Secret)

// instantiate all client services
c.secret = &secretSvc{client: c}
Expand Down
2 changes: 1 addition & 1 deletion executor/linux/linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (

"github.com/go-vela/sdk-go/vela"
api "github.com/go-vela/server/api/types"
"github.com/go-vela/server/compiler/types/pipeline"
"github.com/go-vela/server/mock/server"
"github.com/go-vela/types/constants"
"github.com/go-vela/types/pipeline"
"github.com/go-vela/worker/runtime/docker"
)

Expand Down
2 changes: 1 addition & 1 deletion executor/linux/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/go-vela/sdk-go/vela"
api "github.com/go-vela/server/api/types"
"github.com/go-vela/types/pipeline"
"github.com/go-vela/server/compiler/types/pipeline"
"github.com/go-vela/worker/internal/message"
"github.com/go-vela/worker/runtime"
)
Expand Down
2 changes: 1 addition & 1 deletion executor/linux/opts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (

"github.com/go-vela/sdk-go/vela"
api "github.com/go-vela/server/api/types"
"github.com/go-vela/server/compiler/types/pipeline"
"github.com/go-vela/server/mock/server"
"github.com/go-vela/types/constants"
"github.com/go-vela/types/pipeline"
"github.com/go-vela/worker/runtime"
"github.com/go-vela/worker/runtime/docker"
"github.com/go-vela/worker/runtime/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion executor/linux/outputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
envparse "github.com/hashicorp/go-envparse"
"github.com/sirupsen/logrus"

"github.com/go-vela/types/pipeline"
"github.com/go-vela/server/compiler/types/pipeline"
)

// outputSvc handles communication with the outputs container during the build.
Expand Down
14 changes: 7 additions & 7 deletions executor/linux/outputs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"github.com/urfave/cli/v2"

"github.com/go-vela/sdk-go/vela"
api "github.com/go-vela/server/api/types"
"github.com/go-vela/server/compiler/native"
"github.com/go-vela/server/compiler/types/pipeline"
"github.com/go-vela/server/mock/server"
"github.com/go-vela/types/constants"
"github.com/go-vela/types/library"
"github.com/go-vela/types/pipeline"
"github.com/go-vela/worker/internal/message"
"github.com/go-vela/worker/runtime"
"github.com/go-vela/worker/runtime/docker"
Expand Down Expand Up @@ -143,7 +143,7 @@ func TestLinux_Outputs_delete(t *testing.T) {
t.Errorf("unable to create docker runtime engine: %v", err)
}

_step := new(library.Step)
_step := new(api.Step)
_step.SetName("clone")
_step.SetNumber(2)
_step.SetStatus(constants.StatusPending)
Expand All @@ -154,7 +154,7 @@ func TestLinux_Outputs_delete(t *testing.T) {
failure bool
runtime runtime.Engine
container *pipeline.Container
step *library.Step
step *api.Step
steps *pipeline.Build
}{
{
Expand All @@ -170,7 +170,7 @@ func TestLinux_Outputs_delete(t *testing.T) {
Number: 1,
Pull: "always",
},
step: new(library.Step),
step: new(api.Step),
steps: _dockerSteps,
},
{
Expand Down Expand Up @@ -202,7 +202,7 @@ func TestLinux_Outputs_delete(t *testing.T) {
Number: 2,
Pull: "always",
},
step: new(library.Step),
step: new(api.Step),
steps: _dockerSteps,
},
{
Expand All @@ -218,7 +218,7 @@ func TestLinux_Outputs_delete(t *testing.T) {
Number: 2,
Pull: "always",
},
step: new(library.Step),
step: new(api.Step),
steps: _dockerSteps,
},
{
Expand Down
12 changes: 6 additions & 6 deletions executor/linux/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

"github.com/sirupsen/logrus"

api "github.com/go-vela/server/api/types"
"github.com/go-vela/server/compiler/types/pipeline"
"github.com/go-vela/types/constants"
"github.com/go-vela/types/library"
"github.com/go-vela/types/pipeline"
"github.com/go-vela/worker/internal/message"
"github.com/go-vela/worker/internal/step"
)
Expand Down Expand Up @@ -190,8 +190,8 @@
}

// pull defines a function that pulls the secrets from the server for a given pipeline.
func (s *secretSvc) pull(secret *pipeline.Secret) (*library.Secret, error) {
_secret := new(library.Secret)
func (s *secretSvc) pull(secret *pipeline.Secret) (*api.Secret, error) {
_secret := new(api.Secret)

switch secret.Type {
// handle repo secrets
Expand All @@ -206,7 +206,7 @@
// https://pkg.go.dev/github.com/go-vela/sdk-go/vela#SecretService.Get
_secret, _, err = s.client.Vela.Secret.Get(secret.Engine, secret.Type, org, "*", key)
if err != nil {
return nil, fmt.Errorf("%s: %w", ErrUnableToRetrieve, err)

Check failure on line 209 in executor/linux/secret.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/linux/secret.go#L209

non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
Raw output
executor/linux/secret.go:209:37: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
			return nil, fmt.Errorf("%s: %w", ErrUnableToRetrieve, err)
			                                 ^
}

secret.Value = _secret.GetValue()
Expand All @@ -223,7 +223,7 @@
// https://pkg.go.dev/github.com/go-vela/sdk-go/vela#SecretService.Get
_secret, _, err = s.client.Vela.Secret.Get(secret.Engine, secret.Type, org, repo, key)
if err != nil {
return nil, fmt.Errorf("%s: %w", ErrUnableToRetrieve, err)

Check failure on line 226 in executor/linux/secret.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/linux/secret.go#L226

non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
Raw output
executor/linux/secret.go:226:37: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
			return nil, fmt.Errorf("%s: %w", ErrUnableToRetrieve, err)
			                                 ^
}

secret.Value = _secret.GetValue()
Expand All @@ -240,7 +240,7 @@
// https://pkg.go.dev/github.com/go-vela/sdk-go/vela#SecretService.Get
_secret, _, err = s.client.Vela.Secret.Get(secret.Engine, secret.Type, org, team, key)
if err != nil {
return nil, fmt.Errorf("%s: %w", ErrUnableToRetrieve, err)

Check failure on line 243 in executor/linux/secret.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/linux/secret.go#L243

non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
Raw output
executor/linux/secret.go:243:37: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
			return nil, fmt.Errorf("%s: %w", ErrUnableToRetrieve, err)
			                                 ^
}

secret.Value = _secret.GetValue()
Expand Down Expand Up @@ -336,7 +336,7 @@
// TODO: Evaluate pulling this into a "bool" types function for injecting
//
// helper function to check secret whitelist before setting value.
func injectSecrets(ctn *pipeline.Container, m map[string]*library.Secret) error {
func injectSecrets(ctn *pipeline.Container, m map[string]*api.Secret) error {
// inject secrets for step
for _, _secret := range ctn.Secrets {
logrus.Tracef("looking up secret %s from pipeline secrets", _secret.Source)
Expand All @@ -358,7 +358,7 @@

// escapeNewlineSecrets is a helper function to double-escape escaped newlines,
// double-escaped newlines are resolved to newlines during env substitution.
func escapeNewlineSecrets(m map[string]*library.Secret) {
func escapeNewlineSecrets(m map[string]*api.Secret) {
for i, secret := range m {
// only double-escape secrets that have been manually escaped
if !strings.Contains(secret.GetValue(), "\\\\n") {
Expand Down
Loading
Loading