Skip to content

Commit

Permalink
Merge pull request #21 from tracehubpm/docker.io
Browse files Browse the repository at this point in the history
feat(#2, #6): more puzzles, delete EntryTest.java
  • Loading branch information
h1alexbel authored Mar 29, 2024
2 parents bad4fdf + 8468435 commit 5e40127
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 52 deletions.
28 changes: 28 additions & 0 deletions src/main/java/git/tracehub/codereview/action/Entry.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
*/
package git.tracehub.codereview.action;

import com.jcabi.github.Coordinates;
import com.jcabi.github.Repo;
import com.jcabi.github.RtGithub;
import com.jcabi.log.Logger;
import git.tracehub.codereview.action.github.JsonPull;
import java.io.IOException;
import java.io.StringReader;
import java.nio.file.Files;
Expand All @@ -42,10 +46,29 @@ public final class Entry {

/**
* Application entry point.
*
* @param args Application arguments
* @throws IOException if I/O fails.
* @todo #2:25min Implement GhIdentity.
* For now we do create RtGithub right here, in the main method.
* Let's implement some sort of "smart" identity that based on
* INPUT_GITHUBTOKEN variable presence inside the environment will
* create corresponding object, either RtGithub (real github instance)
* or MkGithub (mocked github server in memory xml).
* @todo #2:30min Develop a prompt to the language model.
* After information is collected (pull request itself, its files,
* and reviews) we can feed it into the model asking what is the quality
* of the following code review.
* @todo #2:30min Fetch all the info about pull request we are working with.
* We should fetch all useful information about pull request that we are dealing with:
* title, files (changes), and its author. Let's present this data in JSON/XML format.
* @todo #2:30min Formulate action stoppers.
* We should formulate some action stoppers that would not "go further"
* into processing if: pull request is too small (we need a specific number),
* or some other alerts that would be reasonable.
*/
public static void main(final String... args) throws IOException {
final String name = System.getenv().get("GITHUB_REPOSITORY");
final JsonObject event = Json.createReader(
new StringReader(
new String(
Expand All @@ -58,5 +81,10 @@ public static void main(final String... args) throws IOException {
)
).readObject();
Logger.info(Entry.class, "event received %s", event.toString());
final Repo repo = new RtGithub(
System.getenv().get("INPUT_GITHUBTOKEN")
).repos().get(new Coordinates.Simple(name));
final JsonObject pull = new JsonPull(repo, event).value();
Logger.info(Entry.class, "pull request found: %s", pull);
}
}
52 changes: 0 additions & 52 deletions src/test/java/git/tracehub/codereview/action/EntryTest.java

This file was deleted.

5 comments on commit 5e40127

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 5e40127 Mar 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 1-e94249ce disappeared from src/test/java/git/tracehub/codereview/action/EntryTest.java), that's why I closed #6. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 5e40127 Mar 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 2-b2790fa0 discovered in src/main/java/git/tracehub/codereview/action/Entry.java) and submitted as #22. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 5e40127 Mar 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 2-15ec98f3 discovered in src/main/java/git/tracehub/codereview/action/Entry.java) and submitted as #23. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 5e40127 Mar 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 2-a5971890 discovered in src/main/java/git/tracehub/codereview/action/Entry.java) and submitted as #24. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 5e40127 Mar 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 2-b6929245 discovered in src/main/java/git/tracehub/codereview/action/Entry.java) and submitted as #25. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

Please sign in to comment.