Skip to content

Commit

Permalink
Finalize task
Browse files Browse the repository at this point in the history
  • Loading branch information
dnestoro committed Mar 7, 2025
1 parent 0a58b92 commit fede8f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ void run() throws IOException {
createPullRequest(pullRequestInfo);
}

// TODO ask user to check metadata. If everything is okay, ask user if the task should create a PR for him

InteractiveTaskUtils.printSuccessfulStatement("Contribution successfully completed! Thank you!");
}

private Coordinates getCoordinates() {
Expand Down Expand Up @@ -371,14 +370,9 @@ private void createPullRequest(Map<PullRequestInfo, Object> info) {
invokeCommand("git", List.of("commit", "-m", "Add metadata for " + coordinates), "Cannot commit changes", null);

InteractiveTaskUtils.printUserInfo("Pushing changes");
String output = invokeCommand("git push origin " + branch, "Cannot push to origin");

String pullRequestCreateLink = "https://github.com/oracle/graalvm-reachability-metadata/pull/new/" + branch;
if (!output.contains(pullRequestCreateLink)) {
throw new RuntimeException("Cannot find link for pull request creation");
}
invokeCommand("git push origin " + branch, "Cannot push to origin");

InteractiveTaskUtils.printUserInfo("Complete generating your pull request on GitHub: " + pullRequestCreateLink);
InteractiveTaskUtils.printUserInfo("Complete pull request creation on the above link");
}

private void writeToFile(Path path, String content, StandardOpenOption writeOption) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ public static void printUserInfo(String message) {
waitForUserToReadMessage();
}

public static void printSuccessfulStatement(String message) {
ColoredOutput.println("[SUCCESS] " + message, ColoredOutput.OUTPUT_COLOR.GREEN);
waitForUserToReadMessage();
}

private static void waitForUserToReadMessage() {
try {
Thread.sleep(3000);
Expand Down

0 comments on commit fede8f0

Please sign in to comment.