konveyor / kai

Konveyor AI - static code analysis driven migration to new targets via Generative AI
Apache License 2.0
23 stars 28 forks source link

Solved examples for some incidents are not being picked up even when they exist in the db #303

Open pranavgaikwad opened 4 weeks ago

pranavgaikwad commented 4 weeks ago

I am working on the following incident:

      - uri: file:///opt/input/source/src/main/java/com/redhat/coolstore/service/ShoppingCartOrderProcessor.java
        message: "JMS `Topic`s should be replaced with Micrometer `Emitter`s feeding a Channel. "
        codeSnip: "<REDACTED_FOR_BREVITY>"
        lineNumber: 24
        variables:
          file: file:///opt/input/source/src/main/java/com/redhat/coolstore/service/ShoppingCartOrderProcessor.java
          kind: Field
          name: ordersTopic

A solved example for above incident already exists in the database. See following example:

      - uri: file:///tmp/source-code/src/main/java/org/jboss/as/quickstarts/servlet/HelloWorldMDBServletClient.java
        message: "JMS `Topic`s should be replaced with Micrometer `Emitter`s feeding a Channel. See the following example of migrating\n a Topic to an Emitter:\n \n Before:\n ```\n @Resource(lookup = \"java:/topic/HELLOWORLDMDBTopic\")\n private Topic topic;\n ```\n \n After:\n ```\n @Inject\n @Channel(\"HELLOWORLDMDBTopic\")\n Emitter<String> topicEmitter;\n ```"
        codeSnip: "<REDACTED_FOR_BREVITY>"
        lineNumber: 29
        variables:
          file: file:///tmp/source-code/src/main/java/org/jboss/as/quickstarts/servlet/HelloWorldMDBServletClient.java
          kind: Module
          name: javax.jms.Topic
          package: org.jboss.as.quickstarts.servlet

The above example should be picked up but it is not because the name and type field in the variables is different in both of these incidents. The fix for both of these incidents essentially is the same.