Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Analyzing tackle-testapp produces no issues #52

Closed
1 task done
rromannissen opened this issue Sep 29, 2023 · 16 comments
Closed
1 task done

[BUG] Analyzing tackle-testapp produces no issues #52

rromannissen opened this issue Sep 29, 2023 · 16 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@rromannissen
Copy link

rromannissen commented Sep 29, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Konveyor version

0.3-alpha5

Priority

Blocker

Current Behavior

No issues are identified in the application:
Screenshot from 2023-09-29 11-40-53
Screenshot from 2023-09-29 11-41-04
Screenshot from 2023-09-29 11-41-12
Screenshot from 2023-09-29 11-41-23

Analysis execution log:

id: 1
createtime: 2023-09-29T09:09:47.518214397Z
name: Customers.1.windup
addon: analyzer
data:
    mode:
        artifact: ""
        binary: false
        diva: false
        withDeps: true
    rules:
        labels:
            excluded: []
            included:
                - konveyor.io/target=cloud-readiness
                - konveyor.io/target=linux
                - konveyor.io/source=java
        path: /rules
        tags:
            excluded: []
    scope:
        packages:
            excluded: []
            included: []
        withKnownLibs: false
    sources: []
    tagger:
        enabled: true
    targets: []
application:
    id: 1
    name: Customers
state: Succeeded
image: quay.io/konveyor/tackle2-addon-analyzer@sha256:e6f16f95086a92cbf916c6b6dd3fcfc497997cd15e54f45702510410c69fac37
started: 2023-09-29T09:09:47.964708066Z
terminated: 2023-09-29T10:12:41.359704187Z
activity:
    - Fetching application.
    - '[CMD] Running: /usr/bin/ssh-agent -a /tmp/agent.1'
    - '[CMD] succeeded.'
    - '[SSH] Agent started.'
    - '[GIT] Cloning: https://github.com/konveyor/tackle-testapp.git'
    - '[GIT] Using credentials (id=1) Git.'
    - '[FILE] Created /addon/.gitconfig.'
    - '[FILE] Created /addon/.git-credentials.'
    - '[CMD] Running: /usr/bin/git clone https://github.com/konveyor/tackle-testapp.git /addon/source/tackle-testapp'
    - '[CMD] succeeded.'
    - '[CMD] Running: /usr/bin/git checkout main'
    - '[CMD] succeeded.'
    - '[MVN] Using credentials (id=2) Maven.'
    - '[RULESET] fetching: id=1 (.discovery)'
    - '[RULESET] fetching: id=17 (openshift)'
    - '[RULESET] fetching (dep): id=21 (.technology-usage)'
    - '[RULESET] fetching: id=18 (os/windows)'
    - '[RULESET] fetching: id=5 (eap6/resin)'
    - '[CMD] Running: /usr/bin/windup-shim convert --outputdir /addon/rules/converted /addon/rules'
    - '[CMD] succeeded.'
    - 'Settings: /addon/opt/settings.json'
    - '> - name: go'
    - '>   binaryPath: /usr/bin/generic-external-provider'
    - '>   initConfig:'
    - '>   - location: /addon/source/tackle-testapp'
    - '>     analysisMode: full'
    - '>     providerSpecificConfig:'
    - '>       dependencyProviderPath: /usr/bin/golang-dependency-provider'
    - '>       lspServerPath: /root/go/bin/gopls'
    - '>       name: go'
    - '> - name: java'
    - '>   binaryPath: /jdtls/bin/jdtls'
    - '>   initConfig:'
    - '>   - location: /addon/source/tackle-testapp'
    - '>     analysisMode: full'
    - '>     providerSpecificConfig:'
    - '>       bundles: /jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar'
    - '>       depOpenSourceLabelsFile: /usr/local/etc/maven.default.index'
    - '>       lspServerPath: /jdtls/bin/jdtls'
    - '>       mavenSettingsFile: /addon/opt/maven/settings.xml'
    - '> - name: builtin'
    - '>   initConfig:'
    - '>   - location: /addon/source/tackle-testapp'
    - '>     analysisMode: ""'
    - '> '
    - '[CMD] Running: /usr/bin/konveyor-analyzer --provider-settings /addon/opt/settings.json --output-file /addon/report.yaml --rules /addon/rules/files --rules /addon/rules/rulesets/1/rules --rules /addon/rules/rulesets/17/rules --rules /addon/rules/rulesets/21/rules --rules /addon/rules/rulesets/18/rules --rules /addon/rules/rulesets/5/rules --rules /addon/rules/converted --label-selector (phase=PostMigrationRulesPhase||(konveyor.io/source=java&&(konveyor.io/target=cloud-readiness||konveyor.io/target=linux))) --dep-label-selector !konveyor.io/dep-source=open-source'
    - '[CMD] succeeded.'
    - '[CMD] Running: /usr/bin/konveyor-analyzer-dep --provider-settings /addon/opt/settings.json --output-file /addon/deps.yaml'
    - '[CMD] succeeded.'
    - 'Analysis reported. duration: 8.613242ms'
    - '[TAG] Tagging Application 1.'
    - Facts updated.
    - Done.

Expected Behavior

The following issues should have been identified:

  • Hard-coded IP address (at src/main/resources/persistence.properties)
  • Legacy configuration with io.konveyor.demo.config.ApplicationConfiguration (at io.konveyor.demo.ordermanagement.config.PersistenceConfig via the custom rule
  • File system - Java IO (in the config-utils dependency at io.konveyor.demo.config.ApplicationConfiguration)

How Reproducible

Always (Default)

Steps To Reproduce

  1. Analyze tackle-test app with the configuration available in the Environment section.
  2. Go to the issues view

Environment

- Fedora 36
- minikube v1.31.2 (--driver=kvm2 --memory=10g --cpus=3)
- Konveyor 0.3 alpha-5
- [tackle-testapp](https://github.com/konveyor/tackle-testapp) application
- Analysis configuration:
  - Source + Dependencies
  - cloud-readiness, linux
  - Application and internal dependencies only
  - Custom rule manually uploaded
  - No additional advanced options

Anything else?

No response

@rromannissen rromannissen added the kind/bug Categorizes issue or PR as related to a bug. label Sep 29, 2023
@dymurray dymurray added this to the 0.3-beta.1 milestone Sep 29, 2023
@jortel jortel transferred this issue from konveyor/analyzer-lsp Sep 29, 2023
@jortel jortel moved this from 🆕 New to 🔖 Ready in Planning Sep 29, 2023
aufi added a commit to aufi/go-konveyor-tests that referenced this issue Oct 2, 2023
Adding TestApp analysis test with custom rule
corporate-framework-config.

Related to konveyor/tackle2-addon-analyzer#52
and konveyor#39

Signed-off-by: Marek Aufart <maufart@redhat.com>
@pranavgaikwad pranavgaikwad moved this from 🔖 Ready to ✅ Done in Planning Oct 12, 2023
@pranavgaikwad
Copy link

@jortel close?

@rromannissen
Copy link
Author

Reproduced in 0.3.0-beta1. Can we verify this gets fixed before cutting releases?

@rromannissen
Copy link
Author

This has improved in 0.3.0-beta1.1, but it is far from being complete. The issue related to the custom rule has been detected correctly, but issues related to the Cloud Readiness migration path are missing:

  • Hard-coded IP address at src/main/resources/persistence.properties
  • File system - Java IO at io.konveyor.demo.config.ApplicationConfiguration in the config-utils library.

Screenshot from 2023-10-20 12-00-35

Execution report is as follows:

id: 1
createtime: 2023-10-20T09:07:11.26642378Z
name: Customers.1.windup
addon: analyzer
data:
    mode:
        artifact: ""
        binary: false
        diva: false
        withDeps: true
    rules:
        labels:
            excluded: []
            included:
                - konveyor.io/target=linux
                - konveyor.io/source=java
                - konveyor.io/target=cloud-readiness
        path: /rules
        tags:
            excluded: []
    scope:
        packages:
            excluded: []
            included: []
        withKnownLibs: false
    sources: []
    tagger:
        enabled: true
    targets: []
application:
    id: 1
    name: Customers
state: Succeeded
image: quay.io/konveyor/tackle2-addon-analyzer@sha256:961473ff47d622409e59de7654bf668da05278c9c827b1caae8033bd5b9ba67f
pod: my-konveyor-operator/task-1-gcssl
started: 2023-10-20T09:07:11.659074617Z
terminated: 2023-10-20T09:09:59.479701584Z
bucket:
    id: 11
    name: ""
activity:
    - Fetching application.
    - '[CMD] Running: /usr/bin/ssh-agent -a /tmp/agent.1'
    - '[CMD] succeeded.'
    - '[SSH] Agent started.'
    - '[GIT] Cloning: https://github.com/konveyor/tackle-testapp.git'
    - '[GIT] Using credentials (id=1) Git.'
    - '[FILE] Created /addon/.gitconfig.'
    - '[FILE] Created /addon/.git-credentials.'
    - '[CMD] Running: /usr/bin/git clone https://github.com/konveyor/tackle-testapp.git /addon/source/tackle-testapp'
    - '[CMD] succeeded.'
    - '[CMD] Running: /usr/bin/git checkout main'
    - '[CMD] succeeded.'
    - '[MVN] Using credentials (id=2) Maven.'
    - '[RULESET] fetching: id=18 (os/windows)'
    - '[RULESET] fetching (dep): id=1 (.discovery)'
    - '[RULESET] fetching (dep): id=21 (.technology-usage)'
    - '[RULESET] fetching: id=5 (eap6/resin)'
    - '[RULESET] fetching: id=17 (openshift)'
    - '[CMD] Running: /usr/bin/windup-shim convert --outputdir /addon/rules/converted /addon/rules'
    - '[CMD] succeeded.'
    - 'Settings: /addon/opt/settings.json'
    - '> - name: go'
    - '>   binaryPath: /usr/bin/generic-external-provider'
    - '>   initConfig:'
    - '>   - location: /addon/source/tackle-testapp'
    - '>     analysisMode: full'
    - '>     providerSpecificConfig:'
    - '>       dependencyProviderPath: /usr/bin/golang-dependency-provider'
    - '>       lspServerPath: /root/go/bin/gopls'
    - '>       name: go'
    - '> - name: java'
    - '>   binaryPath: /jdtls/bin/jdtls'
    - '>   initConfig:'
    - '>   - location: /addon/source/tackle-testapp'
    - '>     analysisMode: full'
    - '>     providerSpecificConfig:'
    - '>       bundles: /jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar'
    - '>       depOpenSourceLabelsFile: /usr/local/etc/maven.default.index'
    - '>       lspServerPath: /jdtls/bin/jdtls'
    - '>       mavenSettingsFile: /addon/opt/maven/settings.xml'
    - '> - name: builtin'
    - '>   initConfig:'
    - '>   - location: /addon/source/tackle-testapp'
    - '>     analysisMode: ""'
    - '> '
    - '[CMD] Running: /usr/bin/konveyor-analyzer --provider-settings /addon/opt/settings.json --output-file /addon/report.yaml --rules /addon/rules/files --rules /addon/rules/rulesets/18/rules --rules /addon/rules/rulesets/1/rules --rules /addon/rules/rulesets/21/rules --rules /addon/rules/rulesets/5/rules --rules /addon/rules/rulesets/17/rules --rules /addon/rules/converted --label-selector (konveyor.io/source=java&&(konveyor.io/target=linux||konveyor.io/target=cloud-readiness)) --dep-label-selector !konveyor.io/dep-source=open-source'
    - '[CMD] succeeded.'
    - '[CMD] Running: /usr/bin/konveyor-analyzer-dep --provider-settings /addon/opt/settings.json --output-file /addon/deps.yaml'
    - '[CMD] succeeded.'
    - 'Analysis reported. duration: 10.16861ms'
    - '[TAG] Tagging Application 1.'
    - Facts updated.
    - Done.

Please, check the results from a Windup analysis for completeness.

@rromannissen
Copy link
Author

Reproduced again in 0.3.0-beta2, with some improvements. The following issue is still missing:

  • File system - Java IO (local-storage-00001) at io.konveyor.demo.config.ApplicationConfiguration in the config-utils library.

Screenshot from 2023-11-03 12-19-14

Execution report is as follows:

id: 1
createTime: 2023-11-03T11:07:35.978934324Z
name: Customers.1.windup
addon: analyzer
data:
    mode:
        artifact: ""
        binary: false
        diva: false
        withDeps: true
    rules:
        labels:
            excluded: []
            included:
                - konveyor.io/target=cloud-readiness
                - konveyor.io/target=openjdk
                - konveyor.io/target=linux
        path: /rules
        tags:
            excluded: []
    scope:
        packages:
            excluded: []
            included: []
        withKnownLibs: false
    sources: []
    tagger:
        enabled: true
    targets: []
application:
    id: 1
    name: Customers
state: Succeeded
image: quay.io/konveyor/tackle2-addon-analyzer@sha256:fe3b25ecb831e66849aef89a24b11f935fe0a1230fcc44e1ab74ddf075c51870
pod: my-konveyor-operator/task-1-tlg6w
started: 2023-11-03T11:07:36.012089241Z
terminated: 2023-11-03T11:11:33.475575617Z
bucket:
    id: 11
    name: ""
activity:
    - Fetching application.
    - '[CMD] Running: /usr/bin/ssh-agent -a /tmp/agent.1'
    - '[CMD] succeeded.'
    - '[SSH] Agent started.'
    - '[GIT] Cloning: https://github.com/konveyor/tackle-testapp.git'
    - '[GIT] Using credentials (id=1) Git.'
    - '[FILE] Created /addon/.gitconfig.'
    - '[FILE] Created /addon/.git-credentials.'
    - '[CMD] Running: /usr/bin/git clone https://github.com/konveyor/tackle-testapp.git /addon/source/tackle-testapp'
    - '[CMD] succeeded.'
    - '[CMD] Running: /usr/bin/git checkout main'
    - '[CMD] succeeded.'
    - '[MVN] Using credentials (id=2) Maven.'
    - '[RULESET] fetching: id=1 (.discovery)'
    - '[RULESET] fetching: id=24 (openshift)'
    - '[RULESET] fetching (dep): id=20 (.technology-usage)'
    - '[RULESET] fetching: id=23 (openjdk17)'
    - '[RULESET] fetching: id=14 (openjdk11/openjdk8)'
    - '[RULESET] fetching: id=13 (openjdk7/oraclejdk7)'
    - '[RULESET] fetching: id=15 (openjdk17/openjdk11)'
    - '[RULESET] fetching: id=17 (os/windows)'
    - '[CMD] Running: /usr/bin/windup-shim convert --outputdir /addon/rules/converted /addon/rules'
    - '[CMD] succeeded.'
    - 'Settings: /addon/opt/settings.json'
    - '> - name: go'
    - '>   binaryPath: /usr/bin/generic-external-provider'
    - '>   initConfig:'
    - '>   - location: /addon/source/tackle-testapp'
    - '>     analysisMode: full'
    - '>     providerSpecificConfig:'
    - '>       dependencyProviderPath: /usr/bin/golang-dependency-provider'
    - '>       lspServerPath: /root/go/bin/gopls'
    - '>       name: go'
    - '> - name: java'
    - '>   binaryPath: /jdtls/bin/jdtls'
    - '>   initConfig:'
    - '>   - location: /addon/source/tackle-testapp'
    - '>     analysisMode: full'
    - '>     providerSpecificConfig:'
    - '>       bundles: /jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar'
    - '>       depOpenSourceLabelsFile: /usr/local/etc/maven.default.index'
    - '>       lspServerPath: /jdtls/bin/jdtls'
    - '>       mavenSettingsFile: /addon/opt/maven/settings.xml'
    - '> - name: builtin'
    - '>   initConfig:'
    - '>   - location: /addon/source/tackle-testapp'
    - '>     analysisMode: ""'
    - '> '
    - '[CMD] Running: /usr/bin/konveyor-analyzer --provider-settings /addon/opt/settings.json --output-file /addon/report.yaml --rules /addon/rules/files --rules /addon/rules/rulesets/1/rules --rules /addon/rules/rulesets/24/rules --rules /addon/rules/rulesets/20/rules --rules /addon/rules/rulesets/23/rules --rules /addon/rules/rulesets/14/rules --rules /addon/rules/rulesets/13/rules --rules /addon/rules/rulesets/15/rules --rules /addon/rules/rulesets/17/rules --rules /addon/rules/converted --label-selector (konveyor.io/target=cloud-readiness||konveyor.io/target=openjdk||konveyor.io/target=linux) --dep-label-selector !konveyor.io/dep-source=open-source'
    - '[CMD] succeeded.'
    - '[CMD] Running: /usr/bin/konveyor-analyzer-dep --provider-settings /addon/opt/settings.json --output-file /addon/deps.yaml'
    - '[CMD] succeeded.'
    - 'Analysis reported. duration: 8.739651ms'
    - '[TAG] Tagging Application 1.'
    - Facts updated.
    - Done.

aufi added a commit to aufi/go-konveyor-tests that referenced this issue Nov 3, 2023
Adding TestApp analysis test with custom rule
corporate-framework-config.

Related to konveyor/tackle2-addon-analyzer#52
and konveyor#39

Signed-off-by: Marek Aufart <maufart@redhat.com>
@aufi
Copy link
Member

aufi commented Nov 3, 2023

@rromannissen Hi, just for clarification, I'd like ask if the change in sources/targets was intentional (if so, I'd add this case to API analysis test, it is still in draft).

Task from comment on Oct 20th

                - konveyor.io/target=linux
                - konveyor.io/source=java
                - konveyor.io/target=cloud-readiness

Task from the latest comment (no java source here)

                - konveyor.io/target=cloud-readiness
                - konveyor.io/target=openjdk
                - konveyor.io/target=linux

@rromannissen
Copy link
Author

@aufi I think the source was being added automatically by the UI, I didn't add it manually by myself in previous beta versions. This is something that I think @jortel and @ibolton336 have been discussing and changed on this last release. Regarding the additional target (openjdk), it was simply not available before so I wasn't able to add it.

@jortel
Copy link
Contributor

jortel commented Nov 3, 2023

The UI stopped automatically adding the source because it should not.

@aufi
Copy link
Member

aufi commented Nov 3, 2023

Correct, then it looks addon doesn't add custom rule, since it has specified source https://github.com/konveyor/go-konveyor-tests/blob/4f3cc0e786eaa675771ed21c83f905750394ed60/analysis/data/corporate-framework-config.windup.xml#L14-L15 (I'm not sure if this is a wanted/expected behaviour or not)

@rromannissen
Copy link
Author

@aufi the custom rule is being triggered correctly. It is local-storage-00001 what is not being triggered.

@jortel
Copy link
Contributor

jortel commented Nov 3, 2023

I just tested
latest and same targets and custom rule and the rule is triggered and the issue created. Will re-test using the newest beta build.

@jortel
Copy link
Contributor

jortel commented Nov 3, 2023

Just tested with :v0.3.0-beta.2 images in fresh install and the rule is run and produced the expected issue.

@aufi
Copy link
Member

aufi commented Nov 7, 2023

Sorry for issues potentialy on my side, but I wasn't able execute Tackle Testapp public application analysis in a way that returns all 3 rules issues (hardcoded-ip-address, local-storage-00001 and corporate-config-01000 from custom rule). Tried few combinations of source/targets using go-konveyor-tests as well as "standard" Konveyor UI, got the same results.

Please, could you confirm expected source/target to get mentioned rules issues (or should the corporate config custom rule test not expect local-storage and hardcoded-ip-address rules to be executed if source was set to java or java-ee)?

@jortel
Copy link
Contributor

jortel commented Nov 7, 2023

Sorry for issues potentialy on my side, but I wasn't able execute Tackle Testapp public application analysis in a way that returns all 3 rules issues (hardcoded-ip-address, local-storage-00001 and corporate-config-01000 from custom rule).

Which issues did you get (or not get)?

@aufi
Copy link
Member

aufi commented Nov 8, 2023

Which issues did you get (or not get)?

@jortel Pasted task, analysis output, etc. to https://gist.github.com/aufi/7f02a3ee9d1e322b04f083ee8d0f6e7e (corporate-config-01000 issues were missing)

@pranavgaikwad
Copy link

Hey folks, this issue is caused due to a change in the analyzer...it was introduced due to a change in the logic that determines which dependency sources need to be decompiled:
konveyor/analyzer-lsp#385

It is being fixed here: konveyor/analyzer-lsp#409

@jortel
Copy link
Contributor

jortel commented Jan 9, 2024

This appears to be fixed.

@jortel jortel closed this as completed Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
Status: ✅ Done
Development

No branches or pull requests

5 participants