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

After applying a fix we are not seeing updated analysis results #156

Open
jwmatthews opened this issue Dec 12, 2024 · 4 comments
Open

After applying a fix we are not seeing updated analysis results #156

jwmatthews opened this issue Dec 12, 2024 · 4 comments
Assignees

Comments

@jwmatthews
Copy link
Member

We are not seeing analysis information being updated after we have applied a fix.
The flow we see is:

  1. We see initial analysis info correctly updated
  2. We pick an issue in a given file to fix, note the file has 3 other incidents, yet are specifically only fixing 1 incident
  3. We see the diff and it looks good, it fixed 1 line of the file and correctly fixed the issue we asked it to, the other issues are NOT fixed as we expect
  4. We apply the fix
  5. We see analysis is re-run for ~15 seconds and completes
  6. We do NOT see any incidents now for that file, even though we know that 3 incidents currently remain
  7. As we look at the outputted analysis.json from the partial analysis run we do NOT see any reference to the updated file.

We are testing with the file https://github.com/konveyor-ecosystem/coolstore/blob/main/src/main/java/com/redhat/coolstore/service/ShippingService.java

That file has 4 incidents over 3 issues.

We are fixing the incident for the 'Stateless' annotation
It gets fixed as we expect.

The imports are still wrong as we'd expect, they are 'javax', after the updated analysis run we expect to see incidents mentioned for the 'javax' imports as well as the RemoteEJB usage.

@rszwajko
Copy link
Contributor

In PR #162 I've improved the logging to better investigate this kind of bugs. Right now in the IDE you can see the summary of the received response i.e.:

Response received. Summary: {"wellFormed":true,"rawIncidentCount":1688,"incidentCount":1688,"partialAnalysis":{"incidentsBefore":1,"incidentsAfter":0}}

With better logging I've tested 2 scenarios on coolstore/src/main/java/com/redhat/coolstore/service/InventoryNotificationMDB.java

Scenario 1 - removing issues:

  1. state after full analysis - 2 issues found
  2. fix one issue manually and save the file (triggers partial analysis request)
  3. in the response there are no incidents in this file (there should be one left)

Scenario 2 - adding issues:

  1. run full analysis (after scenario 1) - 1 issue was found
  2. add back the issue fixed in the scenario 1 and save the file (triggers partial analysis request)
  3. in the response there are no incidents in this file (there should be 2)

@jwmatthews
it seems we get wrong results from the backend.

@jwmatthews
Copy link
Member Author

@rszwajko @pranavgaikwad is a good person to help identify potential backend issues.

rszwajko added a commit that referenced this issue Dec 16, 2024
Additional duplicated results were accumulated in the UI.
Improve input validation and logging in the partial analysis flow.

Reference-Url: #156

---------

Signed-off-by: Radoslaw Szwajkowski <[email protected]>
@pranavgaikwad pranavgaikwad self-assigned this Dec 19, 2024
@pranavgaikwad
Copy link

@jwmatthews @rszwajko Hi, I was able to reproduce this issue with the assets bundled with the extension. The issue seems to be with bundle where the analysis scope is not being set when partial analysis is run:

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-12-19 15:51:59.397
!MESSAGE scope: JavaSearchScope on [empty scope]

I am not able to reproduce this with the latest bundle. See the md5 differences:

dfe4e01693d8f312ad0b299bec12d6cc  /Users/pgaikwad/.vscode/extensions/konveyor.editor-extensions-vscode-0.0.4/assets/jdtls-bundles/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar

f058a1a1b0f3ac16d535bf860c35a64b  ./example/analysis/bundle.jar

My guess is this fix is missing from the bundle added to extension assets.

@pranavgaikwad
Copy link

I think assets should be downloaded at runtime when creating the vsix file to avoid such issues. Or at least have them regularly updated via CI (we need to have a CI to test happy path too). Let me know if I can help with any of this.

@rszwajko rszwajko assigned djzager and unassigned rszwajko Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants