From bc24bca4826bcea8418798a95af7846fc08ef896 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 26 May 2024 04:06:53 +0000 Subject: [PATCH 01/13] Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc Bumps [go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc](https://github.com/open-telemetry/opentelemetry-go-contrib) from 0.51.0 to 0.52.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/zpages/v0.51.0...zpages/v0.52.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 16 ++++++++-------- go.sum | 32 ++++++++++++++++---------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index cf44759cd..a6173e9e1 100644 --- a/go.mod +++ b/go.mod @@ -65,17 +65,17 @@ require ( github.com/tidwall/sjson v1.2.5 github.com/xeipuuv/gojsonschema v1.2.0 go.mongodb.org/mongo-driver v1.13.1 - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 - go.opentelemetry.io/otel v1.26.0 + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 + go.opentelemetry.io/otel v1.27.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.26.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.16.0 go.opentelemetry.io/otel/sdk v1.26.0 - go.opentelemetry.io/otel/trace v1.26.0 + go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/zap v1.27.0 golang.org/x/sync v0.6.0 - google.golang.org/grpc v1.63.2 + google.golang.org/grpc v1.64.0 google.golang.org/protobuf v1.34.1 gopkg.in/AlecAivazis/survey.v1 v1.8.8 gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 @@ -223,13 +223,13 @@ require ( github.com/zmap/zlint v0.0.0-20190806154020-fd021b4cfbeb // indirect go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.44.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 // indirect - go.opentelemetry.io/otel/metric v1.26.0 // indirect + go.opentelemetry.io/otel/metric v1.27.0 // indirect go.opentelemetry.io/proto/otlp v1.2.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.23.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/oauth2 v0.17.0 // indirect + golang.org/x/oauth2 v0.18.0 // indirect golang.org/x/sys v0.20.0 // indirect golang.org/x/term v0.20.0 // indirect golang.org/x/text v0.15.0 // indirect @@ -238,8 +238,8 @@ require ( golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 278ed5018..49b9d8eec 100644 --- a/go.sum +++ b/go.sum @@ -970,14 +970,14 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 h1:A3SayB3rNyt+1S6qpI9mHPkeHTZbD7XILEqWnYZb2l0= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0/go.mod h1:27iA5uvhuRNmalO+iEUdVn5ZMj2qy10Mm+XRIpRmyuU= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 h1:vS1Ao/R55RNV4O7TA2Qopok8yN+X0LIP6RVWLFkprck= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0/go.mod h1:BMsdeOxN04K0L5FNUBfjFdvwWGNe/rkmSwH4Aelu/X0= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.44.0 h1:ewRgsETI7b5nPCK3FqKdY9mFR/9ZwtexwC26//Srjn0= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.44.0/go.mod h1:+BrAX3hlRmkYIKl2e/eSRaKLkClDTY19gzegkQ+KeEQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 h1:Xs2Ncz0gNihqu9iosIZ5SkBbWo5T8JhhLJFMQL1qmLI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0/go.mod h1:vy+2G/6NvVMpwGX/NyLqcC41fxepnuKHk16E6IZUcJc= -go.opentelemetry.io/otel v1.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs= -go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4= +go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= +go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 h1:1u/AyyOqAWzy+SkPxDpahCNZParHV8Vid1RnI2clyDE= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0/go.mod h1:z46paqbJ9l7c9fIPCXTqTGwhQZ5XoTIsfeFYWboizjs= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.26.0 h1:Waw9Wfpo/IXzOI8bCB7DIk+0JZcqqsyn1JFnAc+iam8= @@ -986,12 +986,12 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMey go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.16.0 h1:+XWJd3jf75RXJq29mxbuXhCXFDG3S3R4vBUeSI2P7tE= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.16.0/go.mod h1:hqgzBPTf4yONMFgdZvL/bK42R/iinTyVQtiWihs3SZc= -go.opentelemetry.io/otel/metric v1.26.0 h1:7S39CLuY5Jgg9CrnA9HHiEjGMF/X2VHvoXGgSllRz30= -go.opentelemetry.io/otel/metric v1.26.0/go.mod h1:SY+rHOI4cEawI9a7N1A4nIg/nTQXe1ccCNWYOJUrpX4= +go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= +go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= go.opentelemetry.io/otel/sdk v1.26.0 h1:Y7bumHf5tAiDlRYFmGqetNcLaVUZmh4iYfmGxtmz7F8= go.opentelemetry.io/otel/sdk v1.26.0/go.mod h1:0p8MXpqLeJ0pzcszQQN4F0S5FVjBLgypeGSngLsmirs= -go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA= -go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0= +go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= +go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -1125,8 +1125,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ= -golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= +golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= +golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1380,10 +1380,10 @@ google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= -google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= -google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 h1:Q2RxlXqh1cgzzUgV261vBO2jI5R/3DD1J2pM0nI4NhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.0.5/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1406,8 +1406,8 @@ google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= -google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From a72aad9cba825a8aaaf45e007240ac1e6335d071 Mon Sep 17 00:00:00 2001 From: Kim Christensen Date: Sun, 26 May 2024 22:03:19 +0200 Subject: [PATCH 02/13] Stop using deprecated functions Signed-off-by: Kim Christensen --- pkg/portercontext/telemetry.go | 3 +-- pkg/storage/grpc_test.go | 2 +- tests/grpc/installation_test.go | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/portercontext/telemetry.go b/pkg/portercontext/telemetry.go index 2e6206031..3fd20bc63 100644 --- a/pkg/portercontext/telemetry.go +++ b/pkg/portercontext/telemetry.go @@ -22,7 +22,6 @@ import ( semconv "go.opentelemetry.io/otel/semconv/v1.4.0" "go.opentelemetry.io/otel/trace/noop" "go.uber.org/zap" - "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) @@ -126,7 +125,7 @@ func (c *Context) createTraceClient(cfg LogConfiguration) (otlptrace.Client, err switch cfg.TelemetryProtocol { case "grpc": - opts := []otlptracegrpc.Option{otlptracegrpc.WithDialOption(grpc.WithBlock())} + opts := []otlptracegrpc.Option{} if cfg.TelemetryEndpoint != "" { opts = append(opts, otlptracegrpc.WithEndpoint(cfg.TelemetryEndpoint)) } diff --git a/pkg/storage/grpc_test.go b/pkg/storage/grpc_test.go index f51e09561..4704ce88b 100644 --- a/pkg/storage/grpc_test.go +++ b/pkg/storage/grpc_test.go @@ -40,7 +40,7 @@ func TestRoundTripDataOverGRPC(t *testing.T) { } }() - conn, err := grpc.Dial(lis.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(lis.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials())) require.NoError(t, err) defer conn.Close() client := pluginstore.NewClient(proto.NewStorageProtocolClient(conn)) diff --git a/tests/grpc/installation_test.go b/tests/grpc/installation_test.go index 39d67134a..1d1f32e4c 100644 --- a/tests/grpc/installation_test.go +++ b/tests/grpc/installation_test.go @@ -124,7 +124,7 @@ func TestInstall_installationMessage(t *testing.T) { //Client setup ctx := context.TODO() - client, err := grpc.DialContext(ctx, "bufnet", grpc.WithContextDialer(bufDialer), grpc.WithTransportCredentials(insecure.NewCredentials())) + client, err := grpc.NewClient("passthrough://bufnet", grpc.WithContextDialer(bufDialer), grpc.WithTransportCredentials(insecure.NewCredentials())) require.NoError(t, err) defer client.Close() instClient := pGRPC.NewPorterClient(client) From e5e562f0e8f5de69a26643c81ad932a68b924d45 Mon Sep 17 00:00:00 2001 From: Kim Christensen <2461567+kichristensen@users.noreply.github.com> Date: Tue, 28 May 2024 19:05:50 +0200 Subject: [PATCH 03/13] Check if CLI docs have been committed during CI (#3132) AS CLI reference docs is generated during build, we should ensure that they have been committed and pushed whenever a they are changed. Signed-off-by: Kim Christensen Co-authored-by: schristoff <28318173+schristoff@users.noreply.github.com> --- .github/workflows/porter.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/porter.yml b/.github/workflows/porter.yml index e7deb53f3..0173e8286 100644 --- a/.github/workflows/porter.yml +++ b/.github/workflows/porter.yml @@ -26,6 +26,17 @@ jobs: - name: Native Build run: go run mage.go build shell: bash + - name: Check if all doc changes have been pushed + run: | + if [ "$(git status --porcelain docs/)" ]; + then + echo "There are changes to the documentation that have not been pushed! Please push the following files after build" + git status -s docs/ + exit 1 + else + echo "All documentation changes have been pushed" + fi + shell: bash - name: Publish Native Binaries uses: actions/upload-artifact@v3.1.1 with: From 7546b2e1974b960972655908df920e3847bb16f2 Mon Sep 17 00:00:00 2001 From: Kim Christensen Date: Tue, 28 May 2024 23:00:55 +0200 Subject: [PATCH 04/13] Run signing integration test In order parallelize integration tests, the Github workflow doesn't use Mage to run all integration tests directly. Instead each integration test file is run in different jobs, requiring new integration test files to be manually added to the workflow. The integration test for signing images was missing and is added in this PR. Signed-off-by: Kim Christensen --- .github/workflows/porter-integration-pr.yml | 30 +++++++++++++++++++ .../workflows/porter-integration-release.yml | 30 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/.github/workflows/porter-integration-pr.yml b/.github/workflows/porter-integration-pr.yml index 7178f64c7..1314a4265 100644 --- a/.github/workflows/porter-integration-pr.yml +++ b/.github/workflows/porter-integration-pr.yml @@ -124,3 +124,33 @@ jobs: PORTER_INTEG_FILE: uninstall_test.go run: go run mage.go -v TestIntegration shell: bash + signing_test_integ: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + - uses: actions/setup-go@v4 + with: + go-version: "${{ env.GOVERSION }}" + cache: true + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + - name: Docker Login + uses: docker/login-action@v3.0.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Configure Agent + run: go run mage.go build + shell: bash + - name: Integration Test + env: + PORTER_INTEG_FILE: signing_test.go + run: go run mage.go -v TestIntegration + shell: bash diff --git a/.github/workflows/porter-integration-release.yml b/.github/workflows/porter-integration-release.yml index 95634fc29..d2bb40643 100644 --- a/.github/workflows/porter-integration-release.yml +++ b/.github/workflows/porter-integration-release.yml @@ -163,3 +163,33 @@ jobs: PORTER_INTEG_FILE: uninstall_test.go run: go run mage.go -v TestIntegration shell: bash + signing_test_integ: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + - uses: actions/setup-go@v4 + with: + go-version: "${{ env.GOVERSION }}" + cache: true + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + - name: Docker Login + uses: docker/login-action@v3.0.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Configure Agent + run: go run mage.go build + shell: bash + - name: Integration Test + env: + PORTER_INTEG_FILE: signing_test.go + run: go run mage.go -v TestIntegration + shell: bash From aa3cadf8e954a63a8718b369793a7ff7f10cc263 Mon Sep 17 00:00:00 2001 From: Kim Christensen Date: Tue, 28 May 2024 23:14:45 +0200 Subject: [PATCH 05/13] Do not signing tests in parallel Signed-off-by: Kim Christensen --- tests/integration/signing_test.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/integration/signing_test.go b/tests/integration/signing_test.go index f2d0174cd..9044f4907 100644 --- a/tests/integration/signing_test.go +++ b/tests/integration/signing_test.go @@ -19,8 +19,6 @@ import ( ) func TestCosign(t *testing.T) { - t.Parallel() - testr, err := tester.NewTestWithConfig(t, "tests/integration/testdata/signing/config/config-cosign.yaml") require.NoError(t, err, "tester.NewTest failed") defer testr.Close() @@ -47,8 +45,6 @@ func TestCosign(t *testing.T) { } func TestNotation(t *testing.T) { - t.Parallel() - testr, err := tester.NewTestWithConfig(t, "tests/integration/testdata/signing/config/config-notation.yaml") require.NoError(t, err, "tester.NewTest failed") defer testr.Close() From 5fbb6c9f43ef069b10fc491c36a371dbc2eaca08 Mon Sep 17 00:00:00 2001 From: Kim Christensen Date: Thu, 30 May 2024 23:33:44 +0200 Subject: [PATCH 06/13] Publish server images Signed-off-by: Kim Christensen --- .github/workflows/build_pipelinesrelease_template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_pipelinesrelease_template.yml b/.github/workflows/build_pipelinesrelease_template.yml index ee7618306..f7aa811bc 100644 --- a/.github/workflows/build_pipelinesrelease_template.yml +++ b/.github/workflows/build_pipelinesrelease_template.yml @@ -190,4 +190,4 @@ jobs: username: "${{ github.actor }}" password: "${{ secrets.GITHUB_TOKEN }}" - name: Publish Docker Images to ${{inputs.registry}} - run: PORTER_REGISTRY=${{inputs.registry}} mage PublishImages + run: PORTER_REGISTRY=${{inputs.registry}} mage PublishImages PublishServerMultiArchImages From 9670e3e4ad3ab8b1f09c136825c262fba0b30d6d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 Jun 2024 04:39:23 +0000 Subject: [PATCH 07/13] Bump github.com/mattn/go-isatty from 0.0.19 to 0.0.20 Bumps [github.com/mattn/go-isatty](https://github.com/mattn/go-isatty) from 0.0.19 to 0.0.20. - [Commits](https://github.com/mattn/go-isatty/compare/v0.0.19...v0.0.20) --- updated-dependencies: - dependency-name: github.com/mattn/go-isatty dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 225e8d0d0..2a4b35a20 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( github.com/hashicorp/go-plugin v1.4.0 github.com/magefile/mage v1.15.0 github.com/mattn/go-colorable v0.1.13 - github.com/mattn/go-isatty v0.0.19 + github.com/mattn/go-isatty v0.0.20 github.com/mikefarah/yq/v3 v3.0.0-20201202084205-8846255d1c37 github.com/mitchellh/mapstructure v1.5.0 github.com/mmcdole/gofeed v1.3.0 diff --git a/go.sum b/go.sum index 7348f73ca..d25190c62 100644 --- a/go.sum +++ b/go.sum @@ -606,8 +606,8 @@ github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOA github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= From 75ee7772f831169ae5568a10654adc52ac065775 Mon Sep 17 00:00:00 2001 From: schristoff <28318173+schristoff@users.noreply.github.com> Date: Sun, 2 Jun 2024 15:37:54 -0600 Subject: [PATCH 08/13] chore: update go ver and magefile dep (#3139) * chore: update go ver and magefile dep Signed-off-by: schristoff <28318173+schristoff@users.noreply.github.com> --------- Signed-off-by: schristoff <28318173+schristoff@users.noreply.github.com> --- .../workflows/build_pipelinesrelease_template.yml | 14 +++++++------- build/protoc.Dockerfile | 2 +- go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_pipelinesrelease_template.yml b/.github/workflows/build_pipelinesrelease_template.yml index f7aa811bc..0eb8cd452 100644 --- a/.github/workflows/build_pipelinesrelease_template.yml +++ b/.github/workflows/build_pipelinesrelease_template.yml @@ -28,7 +28,7 @@ jobs: uses: actions/checkout@v4.1.0 - uses: actions/setup-go@v4 with: - go-version: "${{ inputs.GOVERSION }}" + go-version: ${{ inputs.goVersion }} - name: Configure Agent run: go run mage.go ConfigureAgent - name: Native Build @@ -49,7 +49,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v4 with: - go-version: "${{ inputs.GOVERSION }}" + go-version: ${{ inputs.goVersion }} - name: Configure Agent run: go run mage.go ConfigureAgent - name: Cross Compile @@ -68,7 +68,7 @@ jobs: uses: actions/checkout@v4.1.0 - uses: actions/setup-go@v4 with: - go-version: "${{ inputs.GOVERSION }}" + go-version: ${{ inputs.goVersion }} - name: Configure Agent run: go run mage.go ConfigureAgent - name: Vet @@ -86,7 +86,7 @@ jobs: uses: actions/checkout@v4.1.0 - uses: actions/setup-go@v4 with: - go-version: "${{ inputs.GOVERSION }}" + go-version: ${{ inputs.goVersion }} - name: Configure Agent run: go run mage.go ConfigureAgent - name: Unit Test @@ -110,7 +110,7 @@ jobs: uses: actions/checkout@v4.1.0 - uses: actions/setup-go@v4 with: - go-version: "${{ inputs.GOVERSION }}" + go-version: ${{ inputs.goVersion }} - name: Download Cross-Compiled Porter Binaries uses: actions/download-artifact@v4.1.0 with: @@ -139,7 +139,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v4 with: - go-version: "${{ inputs.GOVERSION }}" + go-version: ${{ inputs.goVersion }} - name: Download Cross-Compiled Porter Binaries uses: actions/download-artifact@v4.1.0 with: @@ -175,7 +175,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v4 with: - go-version: "${{ inputs.GOVERSION }}" + go-version: ${{ inputs.goVersion }} - name: Download Cross-Compiled Porter Binaries uses: actions/download-artifact@v4.1.0 with: diff --git a/build/protoc.Dockerfile b/build/protoc.Dockerfile index 6ad558086..d3b45f1ef 100644 --- a/build/protoc.Dockerfile +++ b/build/protoc.Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.20 +FROM golang:1.21 RUN apt-get update && apt-get -y install protobuf-compiler RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 diff --git a/go.mod b/go.mod index 2a4b35a20..6d0a6b942 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ replace ( ) require ( - get.porter.sh/magefiles v0.6.6 + get.porter.sh/magefiles v0.6.7 github.com/Masterminds/semver/v3 v3.2.1 github.com/PaesslerAG/jsonpath v0.1.1 github.com/carolynvs/aferox v0.3.0 diff --git a/go.sum b/go.sum index d25190c62..1e8a62333 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -get.porter.sh/magefiles v0.6.6 h1:WGV9U8hvE3q1IhgVU4sbyOhq1sjxhKJbKRQPcltdB20= -get.porter.sh/magefiles v0.6.6/go.mod h1:w37oTKICvvaEKR5KVB9UfN2EX30uYO9Qk0oRoz80DOU= +get.porter.sh/magefiles v0.6.7 h1:/MtnsUs17yRRSZyh6IRX+eP4dc47IRGwUY0aMgUK06Y= +get.porter.sh/magefiles v0.6.7/go.mod h1:w37oTKICvvaEKR5KVB9UfN2EX30uYO9Qk0oRoz80DOU= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 h1:59MxjQVfjXsBpLy+dbd2/ELV5ofnUkUZBvWSC85sheA= From 59974ae0915dcca58f9e45bff8030d9cac9355b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 10:43:34 -0600 Subject: [PATCH 09/13] Bump golang.org/x/sync from 0.6.0 to 0.7.0 (#3142) Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.6.0 to 0.7.0. - [Commits](https://github.com/golang/sync/compare/v0.6.0...v0.7.0) --- updated-dependencies: - dependency-name: golang.org/x/sync dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: schristoff <28318173+schristoff@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6d0a6b942..ed5627903 100644 --- a/go.mod +++ b/go.mod @@ -74,7 +74,7 @@ require ( go.opentelemetry.io/otel/sdk v1.26.0 go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/zap v1.27.0 - golang.org/x/sync v0.6.0 + golang.org/x/sync v0.7.0 google.golang.org/grpc v1.64.0 google.golang.org/protobuf v1.34.1 gopkg.in/AlecAivazis/survey.v1 v1.8.8 diff --git a/go.sum b/go.sum index 1e8a62333..05db6f6bb 100644 --- a/go.sum +++ b/go.sum @@ -1141,8 +1141,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/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.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From b7b00c5a22c2923b289a5f3dab8c0d7f6bf4143c Mon Sep 17 00:00:00 2001 From: David Gannon <19214156+dgannon991@users.noreply.github.com> Date: Mon, 3 Jun 2024 21:06:13 +0100 Subject: [PATCH 10/13] Feat/3140/better error message on mixin missing (#3145) * WIP: Add extra error when mixin missing Signed-off-by: David Gannon <19214156+dgannon991@users.noreply.github.com> * Added more information to the error message Signed-off-by: David Gannon <19214156+dgannon991@users.noreply.github.com> --------- Signed-off-by: David Gannon <19214156+dgannon991@users.noreply.github.com> Co-authored-by: schristoff <28318173+schristoff@users.noreply.github.com> --- pkg/linter/linter.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/linter/linter.go b/pkg/linter/linter.go index f5e67f8c3..3a763c771 100644 --- a/pkg/linter/linter.go +++ b/pkg/linter/linter.go @@ -210,7 +210,7 @@ func (l *Linter) Lint(ctx context.Context, m *manifest.Manifest) (Results, error return nil, span.Error(fmt.Errorf("error validating action: %s", action.name)) } results = append(results, res...) - } + } deps := make(map[string]interface{}, len(m.Dependencies.Requires)) for _, dep := range m.Dependencies.Requires { @@ -247,6 +247,10 @@ func (l *Linter) Lint(ctx context.Context, m *manifest.Manifest) (Results, error if strings.Contains(response.Error.Error(), "unknown command") { continue } + // put a helpful error when the mixin is not installed + if strings.Contains(response.Error.Error(), "not installed") { + return nil, span.Error(fmt.Errorf("mixin %[1]s is not currently installed. To find view more details you can run: porter mixin search %[1]s. To install you can run porter mixin install %[1]s", response.Name)) + } return nil, span.Error(fmt.Errorf("lint command failed for mixin %s: %s", response.Name, response.Stdout)) } From 01732635a6b641b2a2462d2a81fa31b843a6eb0a Mon Sep 17 00:00:00 2001 From: Kim Christensen <2461567+kichristensen@users.noreply.github.com> Date: Tue, 4 Jun 2024 23:05:39 +0200 Subject: [PATCH 11/13] Use PUBLISH_TOKEN for publishing mixins (#3146) * Use PUBLISH_TOKEN for publishing mixins GITHUB_TOKEN only have access to the current repository, when publishing mixins we need permission to create commits in the packages repo. Signed-off-by: Kim Christensen * Dummy commit to trigger DCO again Signed-off-by: Kim Christensen --------- Signed-off-by: Kim Christensen --- .github/workflows/build_pipelinesrelease_template.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_pipelinesrelease_template.yml b/.github/workflows/build_pipelinesrelease_template.yml index 0eb8cd452..b98536a13 100644 --- a/.github/workflows/build_pipelinesrelease_template.yml +++ b/.github/workflows/build_pipelinesrelease_template.yml @@ -151,7 +151,12 @@ jobs: env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" VERSION: ${{github.ref_name}} - run: mage PublishPorter PublishMixins + run: mage PublishPorter + - name: Publish Porter Mixins + env: + GITHUB_TOKEN: "${{ secrets.PUBLISH_TOKEN }}" + VERSION: ${{github.ref_name}} + run: mage PublishMixins publish-ghcr: env: DOCKER_REGISTRY: ${{inputs.registry}} @@ -191,3 +196,4 @@ jobs: password: "${{ secrets.GITHUB_TOKEN }}" - name: Publish Docker Images to ${{inputs.registry}} run: PORTER_REGISTRY=${{inputs.registry}} mage PublishImages PublishServerMultiArchImages + From 92919adc2fa1f9a63e33050a5d075611766ee65a Mon Sep 17 00:00:00 2001 From: Kim Christensen <2461567+kichristensen@users.noreply.github.com> Date: Fri, 7 Jun 2024 06:01:10 +0200 Subject: [PATCH 12/13] Pass secrets to release workflow (#3150) Secrets are not passed to reusable workflows by default, it has to be enabled. See https://docs.github.com/en/actions/using-workflows/reusing-workflows#passing-inputs-and-secrets-to-a-reusable-workflow for more information Signed-off-by: Kim Christensen --- .github/workflows/porter-canary.yml | 1 + .github/workflows/porter-release.yml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/porter-canary.yml b/.github/workflows/porter-canary.yml index 2b67a6185..f24d2729f 100644 --- a/.github/workflows/porter-canary.yml +++ b/.github/workflows/porter-canary.yml @@ -12,3 +12,4 @@ jobs: registry: ghcr.io/getporter shouldPublish: true skipTests: false + secrets: inherit diff --git a/.github/workflows/porter-release.yml b/.github/workflows/porter-release.yml index 34fbecf52..3e909a190 100644 --- a/.github/workflows/porter-release.yml +++ b/.github/workflows/porter-release.yml @@ -13,4 +13,5 @@ jobs: with: registry: ghcr.io/getporter shouldPublish: true - skipTests: false \ No newline at end of file + skipTests: false + secrets: inherit From 39d28dbc1bf1de9014d77b855c178ea2462fee05 Mon Sep 17 00:00:00 2001 From: schristoff <28318173+schristoff@users.noreply.github.com> Date: Fri, 7 Jun 2024 02:08:41 -0600 Subject: [PATCH 13/13] chore: Add OpenSSF badge (#3151) Update README.md Signed-off-by: schristoff <28318173+schristoff@users.noreply.github.com> --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9d3e30228..01dee4240 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![porter](https://github.com/getporter/porter/actions/workflows/porter.yml/badge.svg?branch=main&event=push)](https://github.com/getporter/porter/actions/workflows/porter.yml) +[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8720/badge)](https://www.bestpractices.dev/projects/8720) # Porter