Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
Signed-off-by: Pranav Gaikwad <[email protected]>
  • Loading branch information
pranavgaikwad authored Jul 2, 2024
2 parents 166729b + 8a0c9ff commit 2fa5e38
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 15 deletions.
52 changes: 50 additions & 2 deletions .github/workflows/image-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

env:
tag: ${{ github.ref == 'refs/heads/main' && 'latest' || github.ref_name }}

jobs:
image-build:
strategy:
Expand Down Expand Up @@ -91,7 +94,7 @@ jobs:
shell: bash
run: |
TAG=${GITHUB_REF_NAME/main/latest}
IMAGE_NAME=quay.io/konveyor/analyzer-lsp:${TAG}-ltsc2022
IMAGE_NAME=quay.io/konveyor/analyzer-lsp:${TAG}-windowsservercore-ltsc2022
docker build -t ${IMAGE_NAME} -f ./Dockerfile.windows .
docker push ${IMAGE_NAME}
Expand All @@ -111,6 +114,51 @@ jobs:
shell: bash
run: |
TAG=${GITHUB_REF_NAME/main/latest}
IMAGE_NAME=quay.io/konveyor/dotnet-external-provider:${TAG}-ltsc2022
IMAGE_NAME=quay.io/konveyor/dotnet-external-provider:${TAG}-windowsservercore-ltsc2022
docker build -t ${IMAGE_NAME} -f ./external-providers/dotnet-external-provider/Dockerfile.windows .
docker push ${IMAGE_NAME}
update-analyzer-manifest:
needs:
- image-build
- analyzer-windows-build
runs-on: ubuntu-latest
steps:
- name: update manifest
run: |
podman manifest create temp
podman manifest add temp --all quay.io/konveyor/analyzer-lsp:${tag}
podman manifest add temp --all quay.io/konveyor/analyzer-lsp:${tag}-windowsservercore-ltsc2022
podman tag temp quay.io/konveyor/analyzer-lsp:${tag}
- name: Push manifest to Quay
uses: redhat-actions/push-to-registry@main
id: push
with:
image: konveyor/analyzer-lsp
tags: ${{ env.tag }}
username: ${{ secrets.QUAY_PUBLISH_ROBOT }}
password: ${{ secrets.QUAY_PUBLISH_TOKEN }}
registry: quay.io


update-dotnet-manifest:
needs:
- image-build
- dotnet-windows-build
runs-on: ubuntu-latest
steps:
- name: update manifest
run: |
podman manifest create temp
podman manifest add temp --all quay.io/konveyor/dotnet-external-provider:${tag}
podman manifest add temp --all quay.io/konveyor/dotnet-external-provider:${tag}-windowsservercore-ltsc2022
podman tag temp quay.io/konveyor/dotnet-external-provider:${tag}
- name: Push manifest to Quay
uses: redhat-actions/push-to-registry@main
id: push
with:
image: konveyor/dotnet-external-provider
tags: ${{ env.tag }}
username: ${{ secrets.QUAY_PUBLISH_ROBOT }}
password: ${{ secrets.QUAY_PUBLISH_TOKEN }}
registry: quay.io
13 changes: 13 additions & 0 deletions demo-output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,19 @@
matchingXML: ""
effort: 1
insights:
field-rule-00001:
description: Sample field declaration rule
category: mandatory
incidents:
- uri: file:///examples/customers-tomcat-legacy/src/main/java/io/konveyor/demo/ordermanagement/service/CustomerService.java
message: Field found
codeSnip: " 8 import org.springframework.data.domain.Page;\n 9 import org.springframework.data.domain.Pageable;\n10 import org.springframework.stereotype.Service;\n11 import org.springframework.transaction.annotation.Transactional;\n12 \n13 @Service\n14 @Transactional\n15 public class CustomerService implements ICustomerService{\n16 \t\n17 \t@Autowired\n18 \tprivate CustomerRepository repository;\n19 \t\n20 \tprivate static Logger logger = Logger.getLogger( CustomerService.class.getName() );\n21 \t\n22 \tpublic Customer findById(Long id) {\n23 \t\tlogger.debug(\"Entering CustomerService.findById()\");\n24 \t\tCustomer c = repository.findById(id).orElse(null);\n25 \t\tlogger.debug(\"Returning element: \" + c);\n26 \t\treturn c;\n27 \t}\n28 \t"
lineNumber: 18
variables:
file: file:///examples/customers-tomcat-legacy/src/main/java/io/konveyor/demo/ordermanagement/service/CustomerService.java
kind: Field
name: repository
package: io.konveyor.demo.ordermanagement.service
java-downloaded-maven-artifact:
description: |
This rule tests the application downloaded from maven artifact
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ func (p *dotnetProvider) Capabilities() []provider.Capability {

func (p *dotnetProvider) Init(ctx context.Context, log logr.Logger, config provider.InitConfig) (provider.ServiceClient, provider.InitConfig, error) {
var mode provider.AnalysisMode = provider.AnalysisMode(config.AnalysisMode)
if mode != provider.FullAnalysisMode {
return nil, provider.InitConfig{}, fmt.Errorf("only full analysis is supported")
if mode != provider.SourceOnlyAnalysisMode {
return nil, fmt.Errorf("only full analysis is supported")
}

// handle proxy settings
Expand Down
2 changes: 0 additions & 2 deletions external-providers/java-external-provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,3 @@ require (
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.33.1-0.20240408130810-98873a205002 // indirect
)

replace github.com/konveyor/analyzer-lsp => ../../
12 changes: 4 additions & 8 deletions external-providers/java-external-provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,17 @@ 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.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
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/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.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/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/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
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/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
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=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ var locationToCode = map[string]int{
"variable_declaration": 9,
"type": 10,
"package": 11,
"field": 12,
}

type javaProvider struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ func (p *javaServiceClient) Evaluate(ctx context.Context, cap string, conditionI
incidents, err = p.filterDefault(symbols)
case 11:
incidents, err = p.filterDefault(symbols)
case 12:
incidents, err = p.filterDefault(symbols)
default:

}
Expand Down
10 changes: 9 additions & 1 deletion rule-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,12 @@
ruleID: java-downloaded-maven-artifact
when:
java.referenced:
pattern: io.javaoperatorsdk.operator.Operator
pattern: io.javaoperatorsdk.operator.Operator
- category: mandatory
description: Sample field declaration rule
message: "Field found"
ruleID: field-rule-00001
when:
java.referenced:
pattern: io.konveyor.demo.ordermanagement.repository.CustomerRepository
location: FIELD

0 comments on commit 2fa5e38

Please sign in to comment.