tracehubpm / code-review-action

Quality of Code Review Checker, plugin it as GitHub Action
MIT License
7 stars 2 forks source link

investigate on what is the best way to present pull request diff #41

Closed h1alexbel closed 7 months ago

h1alexbel commented 8 months ago

in https://github.com/tracehubpm/code-review-action/issues/40 we discovered the format of pull.files(). However we can't present these raw JSONs to LLM. We need to know how to present pull request diff patch and transform raw JSONs respectively.

Let's investigate how to present these diffs to LLM the right way

h1alexbel commented 7 months ago

let's try to present it in this way:

{
  "filename": "eo-maven-plugin/src/main/resources/org/eolang/maven/pre/to-java.xsl",
  "additions": 0,
  "deletions": 3,
  "changes": 3,
  "patch": "@@ -419,9 +419,6 @@ SOFTWARE.
       <xsl:when test="$method='&amp;'">
         <xsl:text>σ</xsl:text>
       </xsl:when>
-      <xsl:when test="$method='&lt;'">
-        <xsl:text>ν</xsl:text>
-      </xsl:when>
       <xsl:otherwise>
         <xsl:value-of select="eo:attr-name($method)"/>
       </xsl:otherwise>"
}

Then we extract this JSON and prompt into LLM