From b7e575e41b810c033abd931d65ec6fac8476ccae Mon Sep 17 00:00:00 2001 From: devhindo Date: Fri, 27 Dec 2024 14:31:55 +0200 Subject: [PATCH 1/3] fix: update GitHub Actions to use latest setup-go and golangci-lint versions; improve error handling in Istio package; fixing golangci-lint failures Signed-off-by: devhindo --- .github/workflows/ci.yml | 6 +++--- istio/istio.go | 5 +++-- istio/oam.go | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2421e6ad..57f28208f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,12 +16,12 @@ jobs: name: golangci-lint runs-on: ubuntu-22.04 steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: 1.23 - uses: actions/checkout@v4 - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. version: latest @@ -38,7 +38,7 @@ jobs: with: fetch-depth: 1 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: 1.23 - name: Create cluster using KinD diff --git a/istio/istio.go b/istio/istio.go index 69831ce1b..6c9e0a1dc 100644 --- a/istio/istio.go +++ b/istio/istio.go @@ -3,6 +3,7 @@ package istio import ( "context" "fmt" + stderrors "errors" "github.com/layer5io/meshery-adapter-library/adapter" "github.com/layer5io/meshery-adapter-library/common" @@ -214,9 +215,9 @@ func (istio *Istio) ApplyOperation(ctx context.Context, opReq adapter.OperationR for msg := range responseChan { switch msg.EventType { case meshes.EventType_ERROR: - istio.StreamErr(msg, ErrIstioVet(fmt.Errorf(msg.Details))) + istio.StreamErr(msg, ErrIstioVet(stderrors.New(msg.Details))) case meshes.EventType_WARN: - istio.StreamWarn(msg, ErrIstioVet(fmt.Errorf(msg.Details))) + istio.StreamWarn(msg, ErrIstioVet(stderrors.New(msg.Details))) default: istio.StreamInfo(msg) } diff --git a/istio/oam.go b/istio/oam.go index ccce04744..7eda0c64a 100644 --- a/istio/oam.go +++ b/istio/oam.go @@ -262,7 +262,7 @@ func mergeErrors(errs []error) error { errMsgs = append(errMsgs, err.Error()) } - return fmt.Errorf(strings.Join(errMsgs, "\n")) + return fmt.Errorf("%s", strings.Join(errMsgs, "\n")) } func mergeMsgs(strs []string) string { From bc6ea33dd3f0cb5565973926112f9179a12fd643 Mon Sep 17 00:00:00 2001 From: devhindo Date: Fri, 27 Dec 2024 14:45:43 +0200 Subject: [PATCH 2/3] fix: update actions/download-artifact to version 4 in e2etests workflow Signed-off-by: devhindo --- .github/workflows/e2etests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2etests.yml b/.github/workflows/e2etests.yml index 3a3929d15..411f1de8e 100644 --- a/.github/workflows/e2etests.yml +++ b/.github/workflows/e2etests.yml @@ -83,7 +83,7 @@ jobs: repository: meshery/meshery token: ${{ secrets.GH_ACCESS_TOKEN }} - name: DownloadJSON - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: data.json - name: Add commit SHORT_SHA @@ -198,7 +198,7 @@ jobs: repository: meshery/meshery token: ${{ secrets.GH_ACCESS_TOKEN }} - name: DownloadJSON - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: data.json - name: Add commit SHORT_SHA @@ -313,7 +313,7 @@ jobs: repository: meshery/meshery token: ${{ secrets.GH_ACCESS_TOKEN }} - name: DownloadJSON - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: data.json - name: Add commit SHORT_SHA From 1d77cb10de451d1c7e27b930943d156ac2d7eae6 Mon Sep 17 00:00:00 2001 From: devhindo Date: Fri, 27 Dec 2024 15:03:53 +0200 Subject: [PATCH 3/3] fix: update actions/upload-artifact to version 4 in e2etests workflow Signed-off-by: devhindo --- .github/workflows/e2etests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2etests.yml b/.github/workflows/e2etests.yml index 411f1de8e..1e2cd7c26 100644 --- a/.github/workflows/e2etests.yml +++ b/.github/workflows/e2etests.yml @@ -40,7 +40,7 @@ jobs: yq e -i '.services.istio.version="${{ steps.gettag.outputs.release }}"' ./.github/install/deploy.yaml cat ./.github/install/deploy.yaml - name: Uploading file - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: patternfile path: ./.github/install/deploy.yaml @@ -155,7 +155,7 @@ jobs: yq e -i '.services.prometheus.version="${{ steps.gettag.outputs.release }}"' ./.github/install/deploywithaddons.yaml cat ./.github/install/deploywithaddons.yaml - name: Uploading file - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: patternfile path: ./.github/install/deploywithaddons.yaml @@ -270,7 +270,7 @@ jobs: yq e -i '.services.istioinstallation.settings.istioVersion="${{ steps.gettag.outputs.release }}"' ./.github/install/deploywithsampleapp.yaml cat ./.github/install/deploywithsampleapp.yaml - name: Uploading file - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: patternfile path: ./.github/install/deploywithsampleapp.yaml