diff --git a/cli/certs/generate_certs.go b/cli/certs/generate_certs.go index 6d198d70..5cde55b0 100644 --- a/cli/certs/generate_certs.go +++ b/cli/certs/generate_certs.go @@ -9,11 +9,10 @@ import ( "os" "path/filepath" + "github.com/alecthomas/kingpin/v2" "github.com/harness/godotenv/v3" "github.com/harness/lite-engine/config" - "github.com/pkg/errors" "github.com/sirupsen/logrus" - "gopkg.in/alecthomas/kingpin.v2" ) const certPermissions = os.FileMode(0600) @@ -26,35 +25,35 @@ type certCommand struct { func generateCert(serverName, relPath string) error { ca, err := GenerateCA() if err != nil { - return errors.Wrap(err, "failed to generate ca certificate") + return fmt.Errorf("failed to generate ca certificate: %w", err) } tlsCert, err := GenerateCert(serverName, ca) if err != nil { - return errors.Wrap(err, "failed to generate certificate") + return fmt.Errorf("failed to generate certificate: %w", err) } err = os.MkdirAll(relPath, os.ModePerm) if err != nil { - return errors.Wrap(err, fmt.Sprintf("failed to create directory at path: %s", relPath)) + return fmt.Errorf("failed to create directory at path: %s: %w", relPath, err) } caCertFilePath := filepath.Join(relPath, "ca-cert.pem") caKeyFilePath := filepath.Join(relPath, "ca-key.pem") if err := os.WriteFile(caCertFilePath, ca.Cert, certPermissions); err != nil { - return errors.Wrap(err, "failed to write CA cert file") + return fmt.Errorf("failed to write CA cert file: %w", err) } if err := os.WriteFile(caKeyFilePath, ca.Key, certPermissions); err != nil { - return errors.Wrap(err, "failed to write CA key file") + return fmt.Errorf("failed to write CA key file: %w", err) } certFilePath := filepath.Join(relPath, "server-cert.pem") keyFilePath := filepath.Join(relPath, "server-key.pem") if err := os.WriteFile(certFilePath, tlsCert.Cert, certPermissions); err != nil { - return errors.Wrap(err, "failed to write server cert file") + return fmt.Errorf("failed to write server cert file: %w", err) } if err := os.WriteFile(keyFilePath, tlsCert.Key, certPermissions); err != nil { - return errors.Wrap(err, "failed to write server key file") + return fmt.Errorf("failed to write server key file: %w", err) } return nil } diff --git a/cli/cli.go b/cli/cli.go index 3400ba05..6953fe99 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -12,7 +12,7 @@ import ( "github.com/harness/lite-engine/cli/server" "github.com/harness/lite-engine/version" - "gopkg.in/alecthomas/kingpin.v2" + "github.com/alecthomas/kingpin/v2" ) // Command parses the command line arguments and then executes a diff --git a/cli/client/client.go b/cli/client/client.go index ba790c08..9f6ae989 100644 --- a/cli/client/client.go +++ b/cli/client/client.go @@ -17,10 +17,9 @@ import ( "github.com/harness/lite-engine/engine/spec" "github.com/harness/lite-engine/logger" + "github.com/alecthomas/kingpin/v2" "github.com/harness/godotenv/v3" - "github.com/pkg/errors" "github.com/sirupsen/logrus" - "gopkg.in/alecthomas/kingpin.v2" ) type Client interface { @@ -86,7 +85,7 @@ func (c *clientCommand) run(*kingpin.ParseContext) error { if err != nil { logrus.WithError(err). Errorln("failed to create client") - return errors.Wrap(err, "failed to create client") + return fmt.Errorf("failed to create client: %w", err) } } @@ -103,7 +102,7 @@ func checkServerHealth(client Client) error { if healthErr != nil { logrus.WithError(healthErr). Errorln("cannot check the health of the server") - return errors.Wrap(healthErr, "cannot check the health of the server") + return fmt.Errorf("cannot check the health of the server: %w", healthErr) } logrus.WithField("response", response).Info("health check") return nil diff --git a/cli/server/server.go b/cli/server/server.go index edfe9030..f2ec0db7 100644 --- a/cli/server/server.go +++ b/cli/server/server.go @@ -20,9 +20,9 @@ import ( "github.com/harness/lite-engine/server" "github.com/harness/lite-engine/setup" + "github.com/alecthomas/kingpin/v2" "github.com/harness/godotenv/v3" "github.com/sirupsen/logrus" - "gopkg.in/alecthomas/kingpin.v2" ) type serverCommand struct { diff --git a/engine/engine.go b/engine/engine.go index 26c9fdc4..ac97b640 100644 --- a/engine/engine.go +++ b/engine/engine.go @@ -23,7 +23,6 @@ import ( "github.com/harness/lite-engine/engine/spec" "github.com/harness/lite-engine/logstream" "github.com/harness/lite-engine/pipeline" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -58,8 +57,7 @@ func NewEnv(opts docker.Opts) (*Engine, error) { func setupHelper(pipelineConfig *spec.PipelineConfig) error { // create global files and folders if err := createFiles(pipelineConfig.Files); err != nil { - return errors.Wrap(err, - fmt.Sprintf("failed to create files/folders for pipeline %v", pipelineConfig.Files)) + return fmt.Errorf("failed to create files/folders for pipeline %v: %w", pipelineConfig.Files, err) } // create volumes for _, vol := range pipelineConfig.Volumes { @@ -75,8 +73,7 @@ func setupHelper(pipelineConfig *spec.PipelineConfig) error { } if err := os.MkdirAll(path, permissions); err != nil { - return errors.Wrap(err, - fmt.Sprintf("failed to create directory for host volume path: %q", path)) + return fmt.Errorf("failed to create directory for host volume path: %q: %w", path, err) } _ = os.Chmod(path, permissions) } @@ -84,7 +81,7 @@ func setupHelper(pipelineConfig *spec.PipelineConfig) error { // create mTLS certs and set environment variable if successful certsWritten, err := createMtlsCerts(pipelineConfig.MtlsConfig) if err != nil { - return errors.Wrap(err, "failed to create mTLS certificates") + return fmt.Errorf("failed to create mTLS certificates: %w", err) } if certsWritten { // This can be used by STO and SSCA plugins to support mTLS @@ -109,34 +106,32 @@ func createMtlsCerts(mtlsConfig spec.MtlsConfig) (bool, error) { // Create the mTLS directory if err := os.MkdirAll(mtlsConfig.ClientCertDirPath, permissions); err != nil { - return false, errors.Wrap(err, "failed to create mTLS directory") + return false, fmt.Errorf("failed to create mTLS directory: %w", err) } // Decode and write certificate certPath := filepath.Join(mtlsConfig.ClientCertDirPath, "client.crt") if err := writeBase64ToFile(certPath, mtlsConfig.ClientCert); err != nil { - return false, errors.Wrap(err, "failed to write mTLS certificate") + return false, fmt.Errorf("failed to write mTLS certificate: %w", err) } // Set 0777 permissions for the certificate if _, err := os.Stat(certPath); err == nil { if err := os.Chmod(certPath, permissions); err != nil { - logrus.Error(errors.Wrap(err, - fmt.Sprintf("Failed to set permissions %o for file on host path: %q", permissions, certPath))) + logrus.Errorf("Failed to set permissions %o for file on host path: %q: %v", permissions, certPath, err) } } // Decode and write key keyPath := filepath.Join(mtlsConfig.ClientCertDirPath, "client.key") if err := writeBase64ToFile(keyPath, mtlsConfig.ClientCertKey); err != nil { - return false, errors.Wrap(err, "failed to write mTLS key") + return false, fmt.Errorf("failed to write mTLS key: %w", err) } // Set 0777 permissions for the key if _, err := os.Stat(keyPath); err == nil { if err := os.Chmod(keyPath, permissions); err != nil { - logrus.Error(errors.Wrap(err, - fmt.Sprintf("Failed to set permissions %o for file on host path: %q", permissions, certPath))) + logrus.Errorf("Failed to set permissions %o for file on host path: %q: %v", permissions, keyPath, err) } } @@ -154,7 +149,7 @@ func loadSanitizePatternsIntoRuntime(sanitizeConfig spec.SanitizeConfig) error { // Decode Base64 content data, err := base64.StdEncoding.DecodeString(sanitizeConfig.SanitizePatternsContent) if err != nil { - return errors.Wrap(err, "failed to decode sanitize patterns from Base64") + return fmt.Errorf("failed to decode sanitize patterns from Base64: %w", err) } // Load patterns directly from decoded string content (in-memory) @@ -170,7 +165,7 @@ func loadSanitizePatternsIntoRuntime(sanitizeConfig spec.SanitizeConfig) error { } if err := logstream.LoadCustomPatternsFromString(content); err != nil { - return errors.Wrap(err, "failed to load sanitize patterns into runtime") + return fmt.Errorf("failed to load sanitize patterns into runtime: %w", err) } logrus.WithField("pattern_count", patternCount).Info("successfully loaded sanitize patterns from delegate into runtime (in-memory)") @@ -181,11 +176,11 @@ func loadSanitizePatternsIntoRuntime(sanitizeConfig spec.SanitizeConfig) error { func writeBase64ToFile(filePath, base64Data string) error { data, err := base64.StdEncoding.DecodeString(base64Data) if err != nil { - return errors.Wrap(err, "failed to decode base64 data") + return fmt.Errorf("failed to decode base64 data: %w", err) } if err := os.WriteFile(filePath, data, permissions); err != nil { - return errors.Wrap(err, fmt.Sprintf("failed to write to file: %s", filePath)) + return fmt.Errorf("failed to write to file: %s: %w", filePath, err) } return nil @@ -354,8 +349,7 @@ func createFiles(paths []*spec.File) error { // make the file writable (if it exists) if _, err := os.Stat(path); err == nil { if err = os.Chmod(path, defaultFilePermissions); err != nil { - logrus.Error(errors.Wrap(err, - fmt.Sprintf("failed to set permissions for file on host path: %q", path))) + logrus.Errorf("failed to set permissions for file on host path: %q: %v", path, err) continue } } @@ -363,8 +357,7 @@ func createFiles(paths []*spec.File) error { if f.IsDir { // create a folder if err := os.MkdirAll(path, fs.FileMode(f.Mode)); err != nil { - return errors.Wrap(err, - fmt.Sprintf("failed to create directory for host path: %q", path)) + return fmt.Errorf("failed to create directory for host path: %q: %w", path, err) } continue } @@ -373,28 +366,25 @@ func createFiles(paths []*spec.File) error { dir := filepath.Dir(path) if _, err := os.Stat(dir); os.IsNotExist(err) { if err := os.MkdirAll(dir, fs.FileMode(permissions)); err != nil { - return errors.Wrap(err, fmt.Sprintf("failed to create directory: for path %q", path)) + return fmt.Errorf("failed to create directory for path %q: %w", path, err) } } // Create (or overwrite) the file file, err := os.Create(path) if err != nil { - return errors.Wrap(err, - fmt.Sprintf("failed to create file for host path: %q", path)) + return fmt.Errorf("failed to create file for host path: %q: %w", path, err) } if _, err = file.WriteString(f.Data); err != nil { _ = file.Close() - return errors.Wrap(err, - fmt.Sprintf("failed to write file for host path: %q", path)) + return fmt.Errorf("failed to write file for host path: %q: %w", path, err) } _ = file.Close() if err = os.Chmod(path, fs.FileMode(f.Mode)); err != nil { - return errors.Wrap(err, - fmt.Sprintf("failed to change permissions for file on host path: %q", path)) + return fmt.Errorf("failed to change permissions for file on host path: %q: %w", path, err) } } return nil diff --git a/go.mod b/go.mod index 71e1706f..11f38b1d 100644 --- a/go.mod +++ b/go.mod @@ -5,48 +5,47 @@ go 1.24.0 toolchain go1.24.12 require ( - github.com/bmatcuk/doublestar v1.3.4 - github.com/cenkalti/backoff/v4 v4.2.0 - github.com/docker/distribution v2.8.1+incompatible + github.com/alecthomas/kingpin/v2 v2.4.0 + github.com/bmatcuk/doublestar v1.3.4 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 + github.com/docker/distribution v2.8.2+incompatible github.com/docker/docker v28.0.2+incompatible github.com/docker/go-connections v0.4.0 github.com/drone/drone-go v1.7.1 - github.com/drone/runner-go v1.12.0 - github.com/go-chi/chi/v5 v5.0.8 - github.com/gofrs/uuid v4.4.0+incompatible - github.com/golang/mock v1.6.0 + github.com/drone/runner-go v1.13.0 + github.com/go-chi/chi/v5 v5.2.4 github.com/harness/ti-client v0.0.0-20260106231425-06bf65d965b0 github.com/hashicorp/go-multierror v1.1.1 github.com/kelseyhightower/envconfig v1.4.0 github.com/linkedin/goavro/v2 v2.12.0 github.com/mattn/go-zglob v0.0.4 github.com/mholt/archives v0.1.5 - github.com/pkg/errors v0.9.1 - github.com/sirupsen/logrus v1.9.3 + github.com/sirupsen/logrus v1.9.4 github.com/stretchr/testify v1.11.1 github.com/t-tomalak/logrus-easy-formatter v0.0.0-20190827215021-c074f06c5816 - golang.org/x/sync v0.17.0 - gopkg.in/alecthomas/kingpin.v2 v2.2.6 - gopkg.in/yaml.v2 v2.4.0 + golang.org/x/sync v0.18.0 ) require ( + github.com/bmatcuk/doublestar/v4 v4.10.0 github.com/cespare/xxhash/v2 v2.3.0 github.com/dgryski/go-lttb v0.0.0-20230207170358-f8fc36cdbff1 + github.com/google/uuid v1.6.0 github.com/harness/godotenv/v2 v2.0.0 github.com/harness/godotenv/v3 v3.0.1 github.com/harness/godotenv/v4 v4.0.2 github.com/shirou/gopsutil/v3 v3.23.5 - github.com/wings-software/dlite v1.0.0-rc.13 - golang.org/x/net v0.43.0 - golang.org/x/sys v0.35.0 + github.com/wings-software/dlite v1.0.0-rc.15 + go.uber.org/mock v0.6.0 + golang.org/x/net v0.47.0 + golang.org/x/sys v0.40.0 + gopkg.in/yaml.v3 v3.0.1 ) require ( github.com/99designs/httpsignatures-go v0.0.0-20170731043157-88528bf4ca7e // indirect github.com/Microsoft/go-winio v0.6.0 // indirect github.com/STARRY-S/zip v0.2.3 // indirect - github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/andybalholm/brotli v1.2.0 // indirect github.com/bodgit/plumbing v1.3.0 // indirect @@ -62,12 +61,12 @@ require ( github.com/drone/envsubst v1.0.3 // indirect github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/go-jose/go-jose/v4 v4.1.3 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/klauspost/compress v1.18.0 // indirect @@ -84,6 +83,7 @@ require ( github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pierrec/lz4/v4 v4.1.22 // indirect + github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect @@ -92,6 +92,7 @@ require ( github.com/tklauser/go-sysconf v0.3.11 // indirect github.com/tklauser/numcpus v0.6.0 // indirect github.com/ulikunitz/xz v0.5.15 // indirect + github.com/xhit/go-str2duration/v2 v2.1.0 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect go.mongodb.org/mongo-driver v1.17.4 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect @@ -101,14 +102,11 @@ require ( go.opentelemetry.io/otel/metric v1.38.0 // indirect go.opentelemetry.io/otel/trace v1.38.0 // indirect go4.org v0.0.0-20230225012048-214862532bf5 // indirect - golang.org/x/crypto v0.41.0 // indirect golang.org/x/exp v0.0.0-20220927162542-c76eaa363f9d // indirect - golang.org/x/mod v0.27.0 // indirect - golang.org/x/text v0.29.0 // indirect + golang.org/x/mod v0.29.0 // indirect + golang.org/x/text v0.31.0 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect - golang.org/x/tools v0.36.0 // indirect + golang.org/x/tools v0.38.0 // indirect google.golang.org/genproto v0.0.0-20230320184635-7606e756e683 // indirect - gopkg.in/square/go-jose.v2 v2.6.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.2 // indirect ) diff --git a/go.sum b/go.sum index 4f874f5d..8be3754e 100644 --- a/go.sum +++ b/go.sum @@ -15,7 +15,6 @@ cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+ cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/99designs/basicauth-go v0.0.0-20160802081356-2a93ba0f464d/go.mod h1:3cARGAK9CfW3HoxCy1a0G4TKrdiKke8ftOMEOHyySYs= github.com/99designs/httpsignatures-go v0.0.0-20170731043157-88528bf4ca7e h1:rl2Aq4ZODqTDkeSqQBy+fzpZPamacO1Srp8zq7jf2Sc= github.com/99designs/httpsignatures-go v0.0.0-20170731043157-88528bf4ca7e/go.mod h1:Xa6lInWHNQnuWoF0YPSsx+INFA9qk7/7pTjwb3PInkY= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= @@ -26,15 +25,16 @@ github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2y github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= github.com/STARRY-S/zip v0.2.3 h1:luE4dMvRPDOWQdeDdUxUoZkzUIpTccdKdhHHsQJ1fm4= github.com/STARRY-S/zip v0.2.3/go.mod h1:lqJ9JdeRipyOQJrYSOtpNAiaesFO6zVDsE8GIGFaoSk= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/kingpin/v2 v2.4.0 h1:f48lwail6p8zpO1bC4TxtqACaGqHYA22qkHjHpqDjYY= +github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ= github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY= -github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/bmatcuk/doublestar v1.3.4 h1:gPypJ5xD31uhX6Tf54sDPUOBXTqKH4c9aPY66CyQrS0= github.com/bmatcuk/doublestar v1.3.4/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= +github.com/bmatcuk/doublestar/v4 v4.10.0 h1:zU9WiOla1YA122oLM6i4EXvGW62DvKZVxIe6TYWexEs= +github.com/bmatcuk/doublestar/v4 v4.10.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/bodgit/plumbing v1.3.0 h1:pf9Itz1JOQgn7vEOE7v7nlEfBykYqvUYioC61TwWCFU= github.com/bodgit/plumbing v1.3.0/go.mod h1:JOTb4XiRu5xfnmdnDJo6GmSbSbtSyufrsyZFByMtKEs= github.com/bodgit/sevenzip v1.6.1 h1:kikg2pUMYC9ljU7W9SaqHXhym5HyKm8/M/jd31fYan4= @@ -45,8 +45,8 @@ github.com/buildkite/yaml v2.1.0+incompatible h1:xirI+ql5GzfikVNDmt+yeiXpf/v1Gt0 github.com/buildkite/yaml v2.1.0+incompatible/go.mod h1:UoU8vbcwu1+vjZq01+KrpSeLBgQQIjL/H7Y6KwikUrI= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= -github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -58,7 +58,6 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -68,22 +67,20 @@ github.com/dgryski/go-lttb v0.0.0-20230207170358-f8fc36cdbff1 h1:dxwR3CStJdJamsI github.com/dgryski/go-lttb v0.0.0-20230207170358-f8fc36cdbff1/go.mod h1:UwftcHUI/qTYvLAxrWmANuRckf8+08O3C3hwStvkhDU= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= -github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v28.0.2+incompatible h1:9BILleFwug5FSSqWBgVevgL3ewDJfWWWyZVqlDMttE8= github.com/docker/docker v28.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/drone/drone-go v1.7.1 h1:ZX+3Rs8YHUSUQ5mkuMLmm1zr1ttiiE2YGNxF3AnyDKw= github.com/drone/drone-go v1.7.1/go.mod h1:fxCf9jAnXDZV1yDr0ckTuWd1intvcQwfJmTRpTZ1mXg= -github.com/drone/envsubst v1.0.2/go.mod h1:bkZbnc/2vh1M12Ecn7EYScpI4YGYU0etwLJICOWi8Z0= github.com/drone/envsubst v1.0.3 h1:PCIBwNDYjs50AsLZPYdfhSATKaRg/FJmDc2D6+C2x8g= github.com/drone/envsubst v1.0.3/go.mod h1:N2jZmlMufstn1KEqvbHjw40h1KyTmnVzHcSc9bFiJ2g= -github.com/drone/runner-go v1.12.0 h1:zUjDj9ylsJ4n4Mvy4znddq/Z4EBzcUXzTltpzokKtgs= -github.com/drone/runner-go v1.12.0/go.mod h1:vu4pPPYDoeN6vdYQAY01GGGsAIW4aLganJNaa8Fx8zE= +github.com/drone/runner-go v1.13.0 h1:hG/4WAptS/P8NgVjsq87IYV8D3FTxMHf2UnXdF+Kyfo= +github.com/drone/runner-go v1.13.0/go.mod h1:lQequ7MIt/ur8eI+iTaxOPyduq99qVFo9E9yhOMYR0s= github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 h1:2tV76y6Q9BB+NEBasnqvs7e49aEBFI8ejC89PSnWH+4= github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707/go.mod h1:qssHWj60/X5sZFNxpG4HBPDHVqxNm4DfnCKgrbZOT+s= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= @@ -91,10 +88,12 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= -github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/chi/v5 v5.2.4 h1:WtFKPHwlywe8Srng8j2BhOD9312j9cGUxG1SP4V2cR4= +github.com/go-chi/chi/v5 v5.2.4/go.mod h1:X7Gx4mteadT3eDOMTsXzmI4/rwUpOwBHLpAfupzFJP0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-jose/go-jose/v4 v4.1.3 h1:CVLmWDhDVRa6Mi/IgCgaopNosCaHz7zrMeF9MlZRkrs= +github.com/go-jose/go-jose/v4 v4.1.3/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -102,8 +101,6 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -114,8 +111,6 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -156,7 +151,6 @@ github.com/harness/ti-client v0.0.0-20260106231425-06bf65d965b0/go.mod h1:dGKnH3 github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -232,8 +226,8 @@ github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= -github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w= +github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= github.com/sorairolake/lzip-go v0.3.8 h1:j5Q2313INdTA80ureWYRhX+1K78mUXfMoPZCw/ivWik= github.com/sorairolake/lzip-go v0.3.8/go.mod h1:JcBqGMV0frlxwrsE9sMWXDjqn3EeVf0/54YPsw66qkU= github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= @@ -246,7 +240,6 @@ github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -263,13 +256,14 @@ github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.15 h1:9DNdB5s+SgV3bQ2ApL10xRc35ck0DuIX/isZvIk+ubY= github.com/ulikunitz/xz v0.5.15/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/wings-software/dlite v1.0.0-rc.13 h1:p5cWaspKrSS9x9qheqf/yN9V39jnlMp82JR1p1tO0Ts= -github.com/wings-software/dlite v1.0.0-rc.13/go.mod h1:zZd6iaMk8Av1QSABGuDWdxBFO82MxE0r6PRoDsLDvCE= +github.com/wings-software/dlite v1.0.0-rc.15 h1:6whSLodukeud4qK+Ym2Zj+RQWJ1QPFz9oprJ9TZ8r2Y= +github.com/wings-software/dlite v1.0.0-rc.15/go.mod h1:W/6pI0ik6dm7D/mFkz+nRWZp03MZxhEr4bISm5MN7+8= +github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc= +github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= @@ -299,17 +293,16 @@ go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJr go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= go.opentelemetry.io/proto/otlp v1.7.1 h1:gTOMpGDb0WTBOP8JaO72iL3auEZhVmAQg4ipjOVAtj4= go.opentelemetry.io/proto/otlp v1.7.1/go.mod h1:b2rVh6rfI/s2pHWNlB7ILJcRALpcNDzKhACevjI+ZnE= +go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y= +go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= go4.org v0.0.0-20230225012048-214862532bf5 h1:nifaUDeh+rPaBCMPMQHZmvJf+QdpLFnuQPwx+LxVmtc= go4.org v0.0.0-20230225012048-214862532bf5/go.mod h1:F57wTi5Lrj6WLyswp5EYV1ncrEbFGHD4hhz6S1ZYeaU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= -golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -338,10 +331,9 @@ golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= -golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= +golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA= +golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -358,11 +350,10 @@ golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= -golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= +golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= +golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -375,10 +366,9 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= -golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I= +golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -396,17 +386,14 @@ golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= -golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= +golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= @@ -417,8 +404,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk= -golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4= +golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= +golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= @@ -449,10 +436,9 @@ golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= -golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= +golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ= +golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -496,15 +482,11 @@ google.golang.org/grpc v1.75.0 h1:+TW+dqTd2Biwe6KKfhE5JpiYIBWq865PhKGSXiivqt4= google.golang.org/grpc v1.75.0/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ= google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc= google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= -gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= -gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/internal/filesystem/mock_filesystem.go b/internal/filesystem/mock_filesystem.go index 0f2ba03a..529f419e 100644 --- a/internal/filesystem/mock_filesystem.go +++ b/internal/filesystem/mock_filesystem.go @@ -9,7 +9,7 @@ package filesystem import ( - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" io "io" os "os" reflect "reflect" diff --git a/logger/middleware.go b/logger/middleware.go index bbd6af4c..50892001 100644 --- a/logger/middleware.go +++ b/logger/middleware.go @@ -7,7 +7,7 @@ package logger import ( "net/http" - "github.com/gofrs/uuid" + "github.com/google/uuid" "github.com/sirupsen/logrus" ) @@ -16,7 +16,7 @@ func Middleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { id := r.Header.Get("X-Request-ID") if id == "" { - newUUID, _ := uuid.NewV4() + newUUID, _ := uuid.NewRandom() id = newUUID.String() } ctx := r.Context() diff --git a/ti/avro/avro.go b/ti/avro/avro.go index 144e0896..7c49ba77 100644 --- a/ti/avro/avro.go +++ b/ti/avro/avro.go @@ -8,7 +8,6 @@ import ( "fmt" goavro "github.com/linkedin/goavro/v2" - "github.com/pkg/errors" cg "github.com/harness/lite-engine/ti/avro/schema/callgraph" cg_1_1 "github.com/harness/lite-engine/ti/avro/schema/callgraph_1_1" @@ -52,7 +51,7 @@ func NewCgphSerialzer(typ, version string) (*CgphSerialzer, error) { return nil, fmt.Errorf("type %s is not supported", typ) } if err != nil { - return nil, errors.Wrap(err, "failed to read schema file") + return nil, fmt.Errorf("failed to read schema file: %w", err) } codec, err := goavro.NewCodec(string(schema)) @@ -69,7 +68,7 @@ func NewCgphSerialzer(typ, version string) (*CgphSerialzer, error) { func (c *CgphSerialzer) Serialize(datum interface{}) ([]byte, error) { bin, err := c.codec.BinaryFromNative(nil, datum) if err != nil { - return nil, errors.Wrap(err, "failed to encode the data") + return nil, fmt.Errorf("failed to encode the data: %w", err) } return bin, nil } diff --git a/ti/callgraph/parser.go b/ti/callgraph/parser.go index 4d267f23..9f28b29d 100644 --- a/ti/callgraph/parser.go +++ b/ti/callgraph/parser.go @@ -14,7 +14,6 @@ import ( "strings" "github.com/harness/lite-engine/internal/filesystem" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -75,12 +74,12 @@ func (cg *CallGraphParser) readFiles(files []string) ([]string, error) { for _, file := range files { f, err := cg.fs.Open(file) if err != nil { - return []string{}, errors.Wrap(err, fmt.Sprintf("failed to open file %s", file)) + return []string{}, fmt.Errorf("failed to open file %s: %w", file, err) } r := bufio.NewReader(f) cgStr, err := rFile(r) if err != nil { - return []string{}, errors.Wrap(err, fmt.Sprintf("failed to parse file %s", file)) + return []string{}, fmt.Errorf("failed to parse file %s: %w", file, err) } finalData = append(finalData, cgStr...) } @@ -163,7 +162,7 @@ func parseCg(cgStr []string) (*Callgraph, error) { tinp := &Input{} err = json.Unmarshal([]byte(line), tinp) if err != nil { - return nil, errors.Wrap(err, fmt.Sprintf("data unmarshalling to json failed for line [%s]", line)) + return nil, fmt.Errorf("data unmarshalling to json failed for line [%s]: %w", line, err) } inp = append(inp, *tinp) } diff --git a/ti/callgraph/upload.go b/ti/callgraph/upload.go index 97d36d5d..6bc8a63f 100644 --- a/ti/callgraph/upload.go +++ b/ti/callgraph/upload.go @@ -27,7 +27,6 @@ import ( tiClient "github.com/harness/ti-client/client" tiClientTypes "github.com/harness/ti-client/types" "github.com/mattn/go-zglob" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -73,24 +72,24 @@ func Upload( } cg, err := parseCallgraphFiles(fmt.Sprintf(dir, stepDataDir), log) if err != nil { - return nil, errors.Wrap(err, "failed to parse callgraph files") + return nil, fmt.Errorf("failed to parse callgraph files: %w", err) } fileChecksums, err := instrumentation.GetGitFileChecksums(ctx, r.WorkingDir, log) if err != nil { - return nil, errors.Wrap(err, "failed to get file hashes") + return nil, fmt.Errorf("failed to get file hashes: %w", err) } uploadPayload, err := CreateUploadPayload(cg, fileChecksums, repo, cfg, sha, tests, log, r.Envs) if err != nil { - return nil, errors.Wrap(err, "failed to create upload payload") + return nil, fmt.Errorf("failed to create upload payload: %w", err) } err = cfg.GetClient().UploadCgV2(ctx, *uploadPayload, stepID, timeMs, cfg.GetSourceBranch(), cfg.GetTargetBranch()) if err != nil { - return nil, errors.Wrap(err, "failed to upload callgraph") + return nil, fmt.Errorf("failed to upload callgraph: %w", err) } } else { encCg, cgIsEmpty, matched, err := encodeCg(fmt.Sprintf(dir, stepDataDir), log, tests, "1_1", rerunFailedTests) if err != nil { - return nil, errors.Wrap(err, "failed to get avro encoded callgraph") + return nil, fmt.Errorf("failed to get avro encoded callgraph: %w", err) } c := cfg.GetClient() @@ -101,7 +100,7 @@ func Upload( // try with version "" encCg, cgIsEmpty, matched, avroErr := encodeCg(fmt.Sprintf(dir, stepDataDir), log, tests, "", rerunFailedTests) if avroErr != nil { - return nil, errors.Wrap(avroErr, "failed to get avro encoded callgraph") + return nil, fmt.Errorf("failed to get avro encoded callgraph: %w", avroErr) } if !cgIsEmpty { if cgErr := c.UploadCg(ctx, stepID, cfg.GetSourceBranch(), cfg.GetTargetBranch(), timeMs, encCg, rerunFailedTests && matched); cgErr != nil { @@ -126,13 +125,13 @@ func parseCallgraphFiles(dataDir string, log *logrus.Logger) (*Callgraph, error) } cgFiles, visFiles, err := getCgFiles(dataDir, "json", "csv", log) if err != nil { - return nil, errors.Wrap(err, "failed to fetch files inside the directory") + return nil, fmt.Errorf("failed to fetch files inside the directory: %w", err) } parser = NewCallGraphParser(log, fs) cg, err := parser.Parse(cgFiles, visFiles) if err != nil { - return nil, errors.Wrap(err, "failed to parse visgraph") + return nil, fmt.Errorf("failed to parse visgraph: %w", err) } return cg, nil } @@ -148,14 +147,14 @@ func encodeCg(dataDir string, log *logrus.Logger, tests []*tiClientTypes.TestCas } cgFiles, visFiles, err := getCgFiles(dataDir, "json", "csv", log) if err != nil { - return nil, cgIsEmpty, false, errors.Wrap(err, "failed to fetch files inside the directory") + return nil, cgIsEmpty, false, fmt.Errorf("failed to fetch files inside the directory: %w", err) } parser = NewCallGraphParser(log, fs) log.Infoln(fmt.Sprintf("Found callgraph files: %v", cgFiles)) cg, err := parser.Parse(cgFiles, visFiles) if err != nil { - return nil, cgIsEmpty, false, errors.Wrap(err, "failed to parse callgraph") + return nil, cgIsEmpty, false, fmt.Errorf("failed to parse callgraph: %w", err) } log.Infof("Callgraph parsing completed. Total nodes: %d", len(cg.Nodes)) @@ -215,11 +214,11 @@ func encodeCg(dataDir string, log *logrus.Logger, tests []*tiClientTypes.TestCas cgMap := cg.ToStringMap() cgSer, err := avro.NewCgphSerialzer(cgSchemaType, version) if err != nil { - return nil, cgIsEmpty, false, errors.Wrap(err, "failed to create serializer") + return nil, cgIsEmpty, false, fmt.Errorf("failed to create serializer: %w", err) } encCg, err := cgSer.Serialize(cgMap) if err != nil { - return nil, cgIsEmpty, false, errors.Wrap(err, "failed to encode callgraph") + return nil, cgIsEmpty, false, fmt.Errorf("failed to encode callgraph: %w", err) } return encCg, cgIsEmpty, allMatched, nil } @@ -317,7 +316,7 @@ func fetchFailedTests(filePath string) ([]string, error) { }) if err != nil { - return nil, errors.Wrap(err, fmt.Sprintf("failed to read file %s", filePath)) + return nil, fmt.Errorf("failed to read file %s: %w", filePath, err) } return lines, nil diff --git a/ti/instrumentation/csharp/dotnet_test.go b/ti/instrumentation/csharp/dotnet_test.go index 3672f485..24a5eccc 100644 --- a/ti/instrumentation/csharp/dotnet_test.go +++ b/ti/instrumentation/csharp/dotnet_test.go @@ -9,12 +9,12 @@ import ( "os" "testing" - "github.com/golang/mock/gomock" "github.com/harness/lite-engine/internal/filesystem" "github.com/harness/lite-engine/ti/instrumentation/common" ti "github.com/harness/ti-client/types" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestMain(t *testing.M) { diff --git a/ti/instrumentation/instrumentation_test.go b/ti/instrumentation/instrumentation_test.go index c5e47b8c..921fc12d 100644 --- a/ti/instrumentation/instrumentation_test.go +++ b/ti/instrumentation/instrumentation_test.go @@ -6,13 +6,13 @@ import ( "strconv" "testing" - "github.com/golang/mock/gomock" "github.com/harness/lite-engine/api" tiCfg "github.com/harness/lite-engine/ti/config" mocks "github.com/harness/lite-engine/ti/instrumentation/mocks" ti "github.com/harness/ti-client/types" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestComputeSelected(t *testing.T) { //nolint:funlen diff --git a/ti/instrumentation/java/bazel_test.go b/ti/instrumentation/java/bazel_test.go index 71fd290c..b1cf9632 100644 --- a/ti/instrumentation/java/bazel_test.go +++ b/ti/instrumentation/java/bazel_test.go @@ -11,12 +11,12 @@ import ( "os/exec" "testing" - "github.com/golang/mock/gomock" "github.com/harness/lite-engine/internal/filesystem" "github.com/harness/lite-engine/ti/instrumentation/common" ti "github.com/harness/ti-client/types" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) const bazelRuleStringsBazelAutoDetectTests = "//module1:pkg1.cls1\n//module1:pkg1.cls2\n//module1:pkg2\n//module1:pkg2/cls2\n" diff --git a/ti/instrumentation/java/gradle_test.go b/ti/instrumentation/java/gradle_test.go index d95b4e0f..ca5732c9 100644 --- a/ti/instrumentation/java/gradle_test.go +++ b/ti/instrumentation/java/gradle_test.go @@ -10,12 +10,12 @@ import ( "path/filepath" "testing" - "github.com/golang/mock/gomock" "github.com/harness/lite-engine/internal/filesystem" "github.com/harness/lite-engine/ti/instrumentation/common" ti "github.com/harness/ti-client/types" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestGetGradleCmd(t *testing.T) { //nolint:funlen diff --git a/ti/instrumentation/java/helper_test.go b/ti/instrumentation/java/helper_test.go index 262250e6..4bce7be7 100644 --- a/ti/instrumentation/java/helper_test.go +++ b/ti/instrumentation/java/helper_test.go @@ -8,11 +8,11 @@ import ( "context" "testing" - "github.com/golang/mock/gomock" "github.com/harness/lite-engine/internal/filesystem" "github.com/harness/lite-engine/ti/instrumentation/common" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) const ( diff --git a/ti/instrumentation/java/maven_test.go b/ti/instrumentation/java/maven_test.go index f831f78d..4960c54e 100644 --- a/ti/instrumentation/java/maven_test.go +++ b/ti/instrumentation/java/maven_test.go @@ -12,11 +12,11 @@ import ( "github.com/stretchr/testify/assert" - "github.com/golang/mock/gomock" "github.com/harness/lite-engine/internal/filesystem" "github.com/harness/lite-engine/ti/instrumentation/common" ti "github.com/harness/ti-client/types" "github.com/sirupsen/logrus" + "go.uber.org/mock/gomock" ) func TestMaven_GetCmd(t *testing.T) { //nolint:funlen diff --git a/ti/instrumentation/java/sbt_test.go b/ti/instrumentation/java/sbt_test.go index d7b101ae..496fa0d8 100644 --- a/ti/instrumentation/java/sbt_test.go +++ b/ti/instrumentation/java/sbt_test.go @@ -11,11 +11,11 @@ import ( "github.com/stretchr/testify/assert" - "github.com/golang/mock/gomock" "github.com/harness/lite-engine/internal/filesystem" "github.com/harness/lite-engine/ti/instrumentation/common" ti "github.com/harness/ti-client/types" "github.com/sirupsen/logrus" + "go.uber.org/mock/gomock" ) func TestSBT_GetCmd(t *testing.T) { //nolint:funlen diff --git a/ti/instrumentation/mocks/runner_mock.go b/ti/instrumentation/mocks/runner_mock.go index aad8226e..a1a5c252 100644 --- a/ti/instrumentation/mocks/runner_mock.go +++ b/ti/instrumentation/mocks/runner_mock.go @@ -8,9 +8,9 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" common "github.com/harness/lite-engine/ti/instrumentation/common" types "github.com/harness/ti-client/types" + gomock "go.uber.org/mock/gomock" ) // MockTestRunner is a mock of TestRunner interface. diff --git a/ti/instrumentation/utils.go b/ti/instrumentation/utils.go index 14b69f54..30df3029 100644 --- a/ti/instrumentation/utils.go +++ b/ti/instrumentation/utils.go @@ -22,9 +22,8 @@ import ( "github.com/cespare/xxhash/v2" "github.com/mattn/go-zglob" - "github.com/pkg/errors" "github.com/sirupsen/logrus" - "gopkg.in/yaml.v2" + "gopkg.in/yaml.v3" "github.com/harness/lite-engine/internal/filesystem" tiCfg "github.com/harness/lite-engine/ti/config" @@ -814,11 +813,11 @@ func getTiConfig(workspace string, fs filesystem.FileSystem) (ti.TiConfig, error return err }) if err != nil { - return res, errors.Wrap(err, "could not read ticonfig file") + return res, fmt.Errorf("could not read ticonfig file: %w", err) } err = yaml.Unmarshal(data, &res) if err != nil { - return res, errors.Wrap(err, "could not unmarshal ticonfig file") + return res, fmt.Errorf("could not unmarshal ticonfig file: %w", err) } return res, nil } diff --git a/ti/instrumentation/utils_test.go b/ti/instrumentation/utils_test.go index eecfa1ff..9bc49020 100644 --- a/ti/instrumentation/utils_test.go +++ b/ti/instrumentation/utils_test.go @@ -5,11 +5,11 @@ import ( "reflect" "testing" - "github.com/golang/mock/gomock" tiCfg "github.com/harness/lite-engine/ti/config" ti "github.com/harness/ti-client/types" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func Test_GetSplitTests(t *testing.T) { diff --git a/ti/report/parser/junit/junit.go b/ti/report/parser/junit/junit.go index 01bcc1ca..db067930 100644 --- a/ti/report/parser/junit/junit.go +++ b/ti/report/parser/junit/junit.go @@ -5,6 +5,7 @@ package junit import ( + "errors" "fmt" "os" "path/filepath" @@ -12,7 +13,6 @@ import ( "github.com/harness/lite-engine/ti/report/parser/junit/gojunit" ti "github.com/harness/ti-client/types" "github.com/mattn/go-zglob" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -240,7 +240,7 @@ func expandTilde(path string) (string, error) { dir, err := os.UserHomeDir() if err != nil { - return "", errors.Wrap(err, "failed to fetch home directory") + return "", fmt.Errorf("failed to fetch home directory: %w", err) } return filepath.Join(dir, path[1:]), nil diff --git a/ti/testsplitter/utils.go b/ti/testsplitter/utils.go index 66fba758..6095dc74 100644 --- a/ti/testsplitter/utils.go +++ b/ti/testsplitter/utils.go @@ -4,7 +4,7 @@ import ( "encoding/json" "sort" - "github.com/bmatcuk/doublestar" + "github.com/bmatcuk/doublestar/v4" ) // ProcessFiles removes non-existent files and adds new files to the file-times map. @@ -42,7 +42,7 @@ func GetTestData(patterns, excludePatterns []string) (map[string]bool, error) { // We are not using filepath.Glob, // because it doesn't support '**' (to match all files in all nested directories) for _, pattern := range patterns { - currentFiles, err := doublestar.Glob(pattern) + currentFiles, err := doublestar.FilepathGlob(pattern) if err != nil { return currentFileSet, err } @@ -54,7 +54,7 @@ func GetTestData(patterns, excludePatterns []string) (map[string]bool, error) { // Exclude the specified files for _, excludePattern := range excludePatterns { - excludedFiles, err := doublestar.Glob(excludePattern) + excludedFiles, err := doublestar.FilepathGlob(excludePattern) if err != nil { return currentFileSet, err }