konveyor / kai

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

Example: Dependencies migration: pom.xml #119

Open jwmatthews opened 8 months ago

jwmatthews commented 8 months ago

Background

Example

Kai Output from prior attempts

Konveyor static code analysis

Example of the Kantra Analysis

Example of what violations we see in this file:


$ time ./list_violations_for_file.py "pom.xml"
INFO - 2024-03-27 14:16:16,338 - [report.py:79 -         _read_report() ] - Reading report from ./analysis/coolstore/output.yaml
File 'pom.xml' has the following violations:
    eap7/weblogic/tests/data maven-javax-to-jakarta-00002 at line 
    eap8/eap7 javax-to-jakarta-dependencies-00006 at line 19
    eap8/eap7 javax-to-jakarta-dependencies-00006 at line 25
    eap8/eap7 javax-to-jakarta-dependencies-00007 at line 26
    eap8/eap7 javax-to-jakarta-dependencies-00008 at line 20
    kai/quarkus jms-to-reactive-quarkus-00000 at line 31
    quarkus/springboot javaee-pom-to-quarkus-00010 at line 5
    quarkus/springboot javaee-pom-to-quarkus-00020 at line 5
    quarkus/springboot javaee-pom-to-quarkus-00030 at line 5
    quarkus/springboot javaee-pom-to-quarkus-00040 at line 5
    quarkus/springboot javaee-pom-to-quarkus-00050 at line 5
    quarkus/springboot javaee-pom-to-quarkus-00060 at line 5
    quarkus/springboot quarkus-flyway-00000 at line 36
    quarkus/springboot quarkus-flyway-00010 at line 36

Early notebook examples

jwmatthews commented 8 months ago

Ran with mixtral

Server version

$ git log | head
commit a64d7a8b359b6d839c875b4133658f722d3ffea8
Author: Fabian von Feilitzsch <fabian@fabianism.us>
Date:   Thu Mar 28 14:45:09 2024 -0400

Output of pom.xml after being 'migrated'

<properties> 
  <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id> 
  <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id> 
  <quarkus.platform.version>3.1.0.Final</quarkus.platform.version>
</properties> 
<dependencyManagement> 
  <dependencies> 
    <dependency> 
      <groupId>$</groupId> 
      <artifactId>$</artifactId> 
      <version>$</version> 
      <type>pom</type> 
      <scope>import</scope> 
    </dependency> 
  </dependencies> 
</dependencyManagement>

$ gist pom.xml.llm_result https://gist.github.com/jwmatthews/b546d4ebdcd4ca1e6cd7aa0ab40304e5

$ gist pom.xml.prompts https://gist.github.com/jwmatthews/049f2a0c1f064057a559fcfaaea12905

$ gist pom.xml.reasoning https://gist.github.com/jwmatthews/e7613c6b23f630095b0e1ee5f3b45203