From 78c50cac5e891a4e9f0107f830291d9df17b7e0e Mon Sep 17 00:00:00 2001 From: Shawn Hurley Date: Wed, 27 Mar 2024 11:25:01 -0400 Subject: [PATCH] :bug: fixing the location of the created programs to correct dir Signed-off-by: Shawn Hurley --- .github/workflows/testing.yaml | 22 ++++++++++++++++++++++ cmd/analyze.go | 4 ++-- entrypoint.sh | 2 +- pkg/testing/runner.go | 10 +++++----- 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index 9ac5bb7..edddbb8 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -6,8 +6,30 @@ jobs: test: runs-on: ubuntu-latest steps: + - name: Extract pull request number from inputs or PR description + run: | + echo "${{ github.event.pull_request.body }}" + PULL_REQUEST_NUMBER=$(echo "${{ github.event.pull_request.body }}" | grep -oP 'Analyzer PR: \K\d+' || true) + if [ -z "$PULL_REQUEST_NUMBER" ]; then + echo "ANALYZER_REF=main" >>$GITHUB_ENV + else + echo "ANALYZER_REF=refs/pull/$PULL_REQUEST_NUMBER/merge" >>$GITHUB_ENV + fi + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + repository: konveyor/analyzer-lsp + ref: "${{ env.ANALYZER_REF}}" + path: analyzer-lsp + + - name: Build anaylzer and save image + working-directory: analyzer-lsp + run: | + podman build -t quay.io/konveyor/analyzer-lsp:latest . + - uses: actions/checkout@v3 + - name: Build image and binary run: | podman build -t localhost/kantra:latest -f Dockerfile . diff --git a/cmd/analyze.go b/cmd/analyze.go index fdeff2e..3f311ee 100644 --- a/cmd/analyze.go +++ b/cmd/analyze.go @@ -447,14 +447,14 @@ func (a *analyzeCommand) getConfigVolumes() (map[string]string, error) { goConfig := provider.Config{ Name: "go", - BinaryPath: "/usr/bin/generic-external-provider", + BinaryPath: "/usr/local/bin/generic-external-provider", InitConfig: []provider.InitConfig{ { Location: otherProvsMountPath, AnalysisMode: provider.FullAnalysisMode, ProviderSpecificConfig: map[string]interface{}{ "name": "go", - "dependencyProviderPath": "/usr/bin/golang-dependency-provider", + "dependencyProviderPath": "/usr/local/bin/golang-dependency-provider", provider.LspServerPathConfigKey: "/root/go/bin/gopls", }, }, diff --git a/entrypoint.sh b/entrypoint.sh index 6567778..27d1062 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,5 +3,5 @@ set -x cp -r /opt/input/source /tmp/source-code sed -i 's|/opt/input/source|/tmp/source-code|g' /opt/input/config/settings.json -/usr/bin/konveyor-analyzer "$@" +/usr/local/bin/konveyor-analyzer "$@" sed -i 's|/tmp/source-code|/opt/input/source|g' /opt/input/config/settings.json diff --git a/pkg/testing/runner.go b/pkg/testing/runner.go index 23a859c..974bfb0 100644 --- a/pkg/testing/runner.go +++ b/pkg/testing/runner.go @@ -60,7 +60,7 @@ var defaultProviderConfig = []provider.Config{ }, { Name: "go", - BinaryPath: "/usr/bin/generic-external-provider", + BinaryPath: "/usr/local/bin/generic-external-provider", InitConfig: []provider.InitConfig{ { AnalysisMode: provider.FullAnalysisMode, @@ -68,14 +68,14 @@ var defaultProviderConfig = []provider.Config{ "lspServerName": "generic", provider.LspServerPathConfigKey: "/root/go/bin/gopls", "lspServerArgs": []string{}, - "dependencyProviderPath": "/usr/bin/golang-dependency-provider", + "dependencyProviderPath": "/usr/local/bin/golang-dependency-provider", }, }, }, }, { Name: "python", - BinaryPath: "/usr/bin/generic-external-provider", + BinaryPath: "/usr/local/bin/generic-external-provider", InitConfig: []provider.InitConfig{ { AnalysisMode: provider.FullAnalysisMode, @@ -91,7 +91,7 @@ var defaultProviderConfig = []provider.Config{ }, { Name: "nodejs", - BinaryPath: "/usr/bin/generic-external-provider", + BinaryPath: "/usr/local/bin/generic-external-provider", InitConfig: []provider.InitConfig{ { AnalysisMode: provider.FullAnalysisMode, @@ -107,7 +107,7 @@ var defaultProviderConfig = []provider.Config{ }, { Name: "yaml", - BinaryPath: "/usr/bin/yq-external-provider", + BinaryPath: "/usr/local/bin/yq-external-provider", InitConfig: []provider.InitConfig{ { AnalysisMode: provider.FullAnalysisMode,