Skip to content

Commit

Permalink
✨ adding reflection client to determine what provider provides
Browse files Browse the repository at this point in the history
Signed-off-by: Shawn Hurley <shawn@hurley.page>
  • Loading branch information
shawn-hurley committed Apr 23, 2024
1 parent 20e6323 commit b823117
Show file tree
Hide file tree
Showing 29 changed files with 1,124 additions and 405 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/demo-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ jobs:
dir=$1
name=$2
pushd ${dir}
podman build -t quay.io/konveyor/${name}:latest -f Dockerfile .
go mod edit -replace=github.com/konveyor/analyzer-lsp=/analyzer-lsp
podman build -t quay.io/konveyor/${name}:latest -f Dockerfile ../../
popd
}
pushd ./external-providers/
Expand All @@ -51,8 +52,8 @@ jobs:
build_image yq-external-provider yq-external-provider
build_image generic-external-provider generic-external-provider
popd
build_image . analyzer-lsp
podman build -t quay.io/konveyor/analyzer-lsp:latest -f Dockerfile .
# run the demo in a podman pod
- name: run demo image
Expand Down Expand Up @@ -133,4 +134,4 @@ jobs:
uses: konveyor/ci/.github/workflows/global-ci.yml@main
with:
component_name: tackle2-addon-analyzer
api_tests_ref: "${{ needs.test.outputs.api_tests_ref }}"
api_tests_ref: "${{ needs.test.outputs.api_tests_ref }}"
2 changes: 1 addition & 1 deletion .github/workflows/pr-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: '1.20'

- name: Test
run: go test -v ./...
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19 as builder
FROM golang:1.20 as builder
WORKDIR /analyzer-lsp

COPY cmd /analyzer-lsp/cmd
Expand Down
46 changes: 46 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,49 @@ deps:

image-build:
docker build -f Dockerfile . -t $(DOCKER_IMAGE)

run-external: build-dotnet-provider build-generic-provider build-golang-dep-provider build-java-provider build-yq-provider run-images

build-dotnet-provider:
cd external-providers/dotnet-external-provider/ && go mod edit --replace=github.com/konveyor/analyzer-lsp=/analyzer-lsp
podman build -f external-providers/dotnet-external-provider/Dockerfile -t dotnet-provider .

build-generic-provider:
cd external-providers/generic-external-provider/ && go mod edit --replace=github.com/konveyor/analyzer-lsp=/analyzer-lsp
podman build -f external-providers/generic-external-provider/Dockerfile -t generic-provider .

build-golang-dep-provider:
cd external-providers/golang-dependency-provider/ && go mod edit --replace=github.com/konveyor/analyzer-lsp=/analyzer-lsp
podman build -f external-providers/golang-dependency-provider/Dockerfile -t golang-dep-provider .

build-java-provider:
cd external-providers/java-external-provider/ && go mod edit --replace=github.com/konveyor/analyzer-lsp=/analyzer-lsp
podman build -f external-providers/java-external-provider/Dockerfile -t java-provider .

build-yq-provider:
cd external-providers/yq-external-provider/ && go mod edit --replace=github.com/konveyor/analyzer-lsp=/analyzer-lsp
podman build -f external-providers/yq-external-provider/Dockerfile -t yq-provider .

run-images:
podman run --name java-provider -d -p 14651:14651 -v $(PWD)/external-providers/java-external-provider/examples:/examples java-provider --port 14651
podman run --name yq -d -p 14652:14652 -v $(PWD)/examples:/examples yq-provider --port 14652
podman run --name golang-provider -d -p 14653:14653 -v $(PWD)/examples:/examples generic-provider --port 14653
podman run --name nodejs -d -p 14654:14654 -v $(PWD)/examples:/examples generic-provider --port 14654 --name nodejs
podman run --name python -d -p 14655:14655 -v $(PWD)/examples:/examples generic-provider --port 14655 --name pylsp

stop-external-providers:
podman kill java-provider || true
podman kill yq || true
podman kill golang-provider || true
podman kill nodejs || true
podman kill python || true
podman rm java-provider || true
podman rm yq || true
podman rm golang-provider || true
podman rm nodejs || true
podman rm python || true
cd external-providers/yq-external-provider/ && go mod edit --dropreplace=github.com/konveyor/analyzer-lsp
cd external-providers/java-external-provider/ && go mod edit --dropreplace=github.com/konveyor/analyzer-lsp
cd external-providers/golang-dependency-provider/ && go mod edit --dropreplace=github.com/konveyor/analyzer-lsp
cd external-providers/generic-external-provider/ && go mod edit --dropreplace=github.com/konveyor/analyzer-lsp
cd external-providers/dotnet-external-provider/ && go mod edit --dropreplace=github.com/konveyor/analyzer-lsp
2 changes: 2 additions & 0 deletions demo.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ COPY rule-example.yaml /analyzer-lsp/rule-example.yaml
COPY examples /analyzer-lsp/examples
COPY external-providers/java-external-provider/examples /analyzer-lsp/examples

COPY provider_container_settings.json /analyzer-lsp/provider_settings.json

RUN python3 -m venv /analyzer-lsp/examples/python/.venv
RUN yes | python3 -m pip install -r /analyzer-lsp/examples/python/requirements.txt

Expand Down
9 changes: 6 additions & 3 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,12 @@ func (r *ruleEngine) getCodeLocation(ctx context.Context, m IncidentContext, rul
return "", nil
}

// We need to move this up, because the code only lives in the
// provider's
if rule.Snipper != nil {
return rule.Snipper.GetCodeSnip(m.FileURI, *m.CodeLocation)
}

if strings.HasPrefix(string(m.FileURI), uri.FileScheme) {
//Find the file, open it in a buffer.
readFile, err := os.Open(m.FileURI.Filename())
Expand All @@ -614,9 +620,6 @@ func (r *ruleEngine) getCodeLocation(ctx context.Context, m IncidentContext, rul
}
return codeSnip, nil
}
if rule.Snipper != nil {
return rule.Snipper.GetCodeSnip(m.FileURI, *m.CodeLocation)
}

// if it is not a file ask the provider
return "", nil
Expand Down
22 changes: 13 additions & 9 deletions external-providers/dotnet-external-provider/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# TODO: fix version mismatch in final container
FROM registry.access.redhat.com/ubi8/go-toolset:latest as go-builder
ENV GOPATH=$APP_ROOT
FROM golang:1.20 as go-builder

COPY Makefile .
COPY go.mod .
COPY go.sum .
COPY main.go .
COPY pkg/ ./pkg
RUN go mod download
COPY / /analyzer-lsp

WORKDIR /dotnet-provider

COPY external-providers/dotnet-external-provider/Makefile .
COPY external-providers/dotnet-external-provider/go.mod .
COPY external-providers/dotnet-external-provider/go.sum .
COPY external-providers/dotnet-external-provider/main.go .
COPY external-providers/dotnet-external-provider/pkg/ ./pkg

RUN go mod tidy

RUN make build
RUN ADD_PLAT=yes OS=windows make build
Expand Down Expand Up @@ -46,5 +50,5 @@ USER default
EXPOSE 3456

#COPY --from=builder /opt/app-root/src/omnisharp-roslyn-1.39.6/bin/Release/OmniSharp.Stdio.Driver/net6.0/ /opt/app-root/omnisharp
COPY --from=go-builder /opt/app-root/src/bin/ /usr/bin/
COPY --from=go-builder /dotnet-provider/bin/ /usr/bin/
ENTRYPOINT ["dotnet-external-provider", "-port", "3456"]
15 changes: 9 additions & 6 deletions external-providers/generic-external-provider/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
FROM golang:1.20 as go-builder

COPY / /analyzer-lsp

WORKDIR /generic-external-provider

COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
COPY external-providers/generic-external-provider/go.mod go.mod
COPY external-providers/generic-external-provider/go.sum go.sum

COPY external-providers/generic-external-provider/main.go main.go
COPY external-providers/generic-external-provider/pkg/ pkg/
RUN go mod tidy

COPY main.go main.go
COPY pkg/ pkg/
RUN go build -o generic-external-provider main.go

FROM quay.io/konveyor/golang-dependency-provider as go-dep-provider
Expand All @@ -27,4 +30,4 @@ RUN go install golang.org/x/tools/gopls@latest
COPY --from=go-builder /generic-external-provider/generic-external-provider /usr/local/bin/generic-external-provider
COPY --from=go-dep-provider /usr/local/bin/go-dependency-provider /usr/local/bin/go-dependency-provider

ENTRYPOINT [ "/usr/local/bin/generic-external-provider" ]
ENTRYPOINT [ "/usr/local/bin/generic-external-provider" ]
3 changes: 2 additions & 1 deletion external-providers/generic-external-provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
github.com/sirupsen/logrus v1.9.3
github.com/swaggest/openapi-go v0.2.45
go.lsp.dev/uri v0.3.0
google.golang.org/grpc v1.62.1
gopkg.in/yaml.v2 v2.4.0
)

Expand All @@ -31,7 +32,7 @@ require (
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
google.golang.org/grpc v1.54.0 // indirect
google.golang.org/grpc v1.62.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
12 changes: 7 additions & 5 deletions external-providers/golang-dependency-provider/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
FROM golang:1.20 as go-builder

copy / /analyzer-lsp

WORKDIR /go-dependency-provider

COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
COPY external-providers/golang-dependency-provider/go.mod go.mod
COPY external-providers/golang-dependency-provider/go.sum go.sum

COPY main.go main.go
COPY external-providers/golang-dependency-provider/main.go main.go
RUN go mod tidy
RUN go build -o go-dependency-provider main.go

FROM registry.access.redhat.com/ubi9/ubi-minimal:latest

COPY --from=go-builder /go-dependency-provider/go-dependency-provider /usr/local/bin/go-dependency-provider

ENTRYPOINT [ "/usr/local/bin/go-dependency-provider" ]
ENTRYPOINT [ "/usr/local/bin/go-dependency-provider" ]
2 changes: 1 addition & 1 deletion external-providers/golang-dependency-provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.19
require (
github.com/konveyor/analyzer-lsp v0.4.0-alpha.1
go.lsp.dev/uri v0.3.0
google.golang.org/grpc v1.62.1 // indirect
)

require (
Expand All @@ -29,7 +30,6 @@ require (
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5 // indirect
google.golang.org/grpc v1.58.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
13 changes: 8 additions & 5 deletions external-providers/java-external-provider/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Build the manager binary
FROM golang:1.21 as builder

COPY / /analyzer-lsp

WORKDIR /java-provider

COPY go.mod go.mod
COPY go.sum go.sum
COPY external-providers/java-external-provider/go.mod go.mod
COPY external-providers/java-external-provider/go.sum go.sum


RUN go mod download
COPY external-providers/java-external-provider/main.go main.go
COPY external-providers/java-external-provider/pkg/ pkg/

COPY main.go main.go
COPY pkg/ pkg/
RUN go mod tidy

RUN go build -a -o java-external-provider main.go

Expand Down
15 changes: 8 additions & 7 deletions external-providers/java-external-provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@ require (
github.com/vifraa/gopom v1.0.0
go.lsp.dev/uri v0.3.0
go.opentelemetry.io/otel v1.11.2
google.golang.org/grpc v1.62.1
gopkg.in/yaml.v2 v2.4.0
)

require github.com/sirupsen/logrus v1.9.0

require google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect

require (
github.com/PaesslerAG/gval v1.2.2 // indirect
github.com/bombsimon/logrusr/v3 v3.0.0
github.com/cbroglie/mustache v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/kr/text v0.1.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
Expand All @@ -28,10 +31,8 @@ require (
go.opentelemetry.io/otel/exporters/jaeger v1.11.2 // indirect
go.opentelemetry.io/otel/sdk v1.11.2 // indirect
go.opentelemetry.io/otel/trace v1.11.2 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
google.golang.org/grpc v1.54.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.33.1-0.20240408130810-98873a205002 // indirect
)
34 changes: 15 additions & 19 deletions external-providers/java-external-provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
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/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc=
Expand Down Expand Up @@ -64,22 +62,20 @@ go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNX
go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU=
go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0=
go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w=
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag=
google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
google.golang.org/protobuf v1.33.1-0.20240408130810-98873a205002 h1:V7Da7qt0MkY3noVANIMVBk28nOnijADeOR3i5Hcvpj4=
google.golang.org/protobuf v1.33.1-0.20240408130810-98873a205002/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ func (p *javaProvider) Init(ctx context.Context, log logr.Logger, config provide
}

// GetLocation given a dep, attempts to find line number, caches the line number for a given dep
func (j *javaProvider) GetLocation(ctx context.Context, dep konveyor.Dep) (engine.Location, error) {
func (j *javaProvider) GetLocation(ctx context.Context, dep konveyor.Dep, file string) (engine.Location, error) {
location := engine.Location{StartPosition: engine.Position{}, EndPosition: engine.Position{}}

cacheKey := fmt.Sprintf("%s-%s-%s-%v",
Expand Down Expand Up @@ -366,6 +366,9 @@ func (j *javaProvider) GetLocation(ctx context.Context, dep konveyor.Dep) (engin
groupId := dep.Extras[groupIdKey].(string)
artifactId := dep.Extras[artifactIdKey].(string)
path := dep.Extras[pomPathKey].(string)
if path == "" {
path = file
}
if path == "" {
return location, fmt.Errorf("unable to get location for dep %s, empty pom path", dep.Name)
}
Expand Down
12 changes: 7 additions & 5 deletions external-providers/yq-external-provider/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
FROM golang:1.20 as go-builder

copy / /analyzer-lsp

WORKDIR /yq-external-provider

COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
COPY external-providers/yq-external-provider/go.mod go.mod
COPY external-providers/yq-external-provider/go.sum go.sum

COPY main.go main.go
COPY pkg/ pkg/
COPY external-providers/yq-external-provider/main.go main.go
COPY external-providers/yq-external-provider/pkg/ pkg/
RUN go mod tidy

RUN go build -o yq-external-provider main.go

Expand Down
Loading

0 comments on commit b823117

Please sign in to comment.