Skip to content

Commit

Permalink
Merge pull request #107 from tracehubpm/87
Browse files Browse the repository at this point in the history
feat(#87): completes analysis once
  • Loading branch information
h1alexbel committed May 10, 2024
2 parents ea6f127 + edc3377 commit 14b9d35
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,12 @@ public void exec(final Pull pull, final String model) throws Exception {
)
);
final String score = analysis.completion();
Logger.info(this, "Suggested review score is %s", score);
if (score.toLowerCase(Locale.ROOT).contains("excellent")) {
new FeedbackInPull(
new StartWithNickname(
this.approver,
new AnalyzedWith(
analysis,
score,
model
)
),
Expand Down Expand Up @@ -143,7 +142,7 @@ public void exec(final Pull pull, final String model) throws Exception {
).asString()
)
)
),
).completion(),
model
),
score
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public final class AnalyzedWith implements Text {
/**
* Model.
*/
private final Model model;
private final String completion;

/**
* Tag.
Expand All @@ -48,7 +48,7 @@ public final class AnalyzedWith implements Text {
public String asString() throws Exception {
return String.join(
"\n",
this.model.completion(),
this.completion,
"",
String.format(
"Analyzed with `%s`",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public final class SuggestionPrompt implements Text {
public String asString() throws Exception {
return String.join(
"\n",
"Code review was not excellent, please post one suggestion for code reviewer",
"Code review was not excellent, please post one small suggestion (30 words is a max) for code reviewer",
"what he/she can improve in the future.",
"Start suggestion with text \"I would recommend ...\"",
"Code review:",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ final class AnalyzedWithTest {
@Test
void tagsResponse() throws Exception {
final String tagged = new AnalyzedWith(
new FakeModel(), "fake-gpt-4"
new FakeModel().completion(), "fake-gpt-4"
).asString();
final String expected =
"This is a fake completion performed by"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void compilesSuggestionPrompt() throws Exception {
).asString();
final String expected = String.join(
"\n",
"Code review was not excellent, please post one suggestion for code reviewer",
"Code review was not excellent, please post one small suggestion (30 words is a max) for code reviewer",
"what he/she can improve in the future.",
"Start suggestion with text \"I would recommend ...\"",
"Code review:",
Expand Down

0 comments on commit 14b9d35

Please sign in to comment.