Skip to content

Commit cdabf49

Browse files
committed
Enable PR creation
1 parent 4ec13fc commit cdabf49

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

tests/tck-build-logic/src/main/java/org/graalvm/internal/tck/ContributionTask.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ void run() throws IOException {
109109
boolean shouldCreatePR = shouldCreatePullRequest();
110110
if (shouldCreatePR) {
111111
String branch = "add-support-for-" + coordinates.toString().replace(':', '-');
112-
System.out.println("shouldCreatePR = " + shouldCreatePR);
113-
// createPullRequest(branch);
112+
createPullRequest(branch);
114113

115114
InteractiveTaskUtils.printUserInfo("After your pull requests gets generated, please update the pull request description to mention all places where your pull request" +
116115
"accesses files, network, docker, or any other external service, and check if all checks in the description are correctly marked");
@@ -532,11 +531,8 @@ private void trimIndexFile(Path index, List<CONFIG_FILES> remainingFiles) throws
532531
}
533532

534533
private boolean shouldCreatePullRequest() {
535-
String question = "Do you want to create a pull request to the reachability metadata repository [Y/n]:";
536-
String helpMessage = "If you want, we can create a pull request for you! " +
537-
"All you have to do is to provide necessary information for the GitHub CLI, and answer few contributingQuestions regarding the pull request description.";
538-
539-
return InteractiveTaskUtils.askYesNoQuestion(question, helpMessage, true);
534+
ContributingQuestion question = questions.get("shouldCreatePullRequest");
535+
return InteractiveTaskUtils.askYesNoQuestion(question.question(), question.help(), true);
540536
}
541537

542538
private void createPullRequest(String branch) {

tests/tck-build-logic/src/main/java/org/graalvm/internal/tck/utils/ConfigurationStringBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public ConfigurationStringBuilder() {
1616

1717
public ConfigurationStringBuilder append(String content) {
1818
if (startedNewLine) {
19-
sb.append("\t".repeat(Math.max(0, indentationLevel)));
19+
sb.append(" ".repeat(Math.max(0, indentationLevel)));
2020
}
2121
sb.append(content);
2222
startedNewLine = false;

tests/tck-build-logic/src/main/resources/contributing/empty-resource-config.json.template

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/tck-build-logic/src/main/resources/contributing/questions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,10 @@
2828
"question-key": "additionalDependencies",
2929
"question": "What additional testImplementation dependencies you want to include? Enter the next dependency (to stop type \"-\")",
3030
"help": "Enter the testImplementation dependencies (pres enter after each dependency) you want to include use in tests. Provide dependencies in form of Maven coordinates. Maven coordinates consist of three parts in the following format \"groupId:artifactId:version\". For more information visit: https://maven.apache.org/repositories/artifacts.html When you finish adding dependencies, type \"-\" to terminate the inclusion process"
31+
},
32+
{
33+
"question-key": "shouldCreatePullRequest",
34+
"question": "Do you want to create a pull request to the reachability metadata repository [Y/n]:",
35+
"help": "In case you want to open a pull request to Reachability metadata repository automatically, type \"y\". This way the task will create a new branch for you, commit changes with a proper message, and push the branch remotly. At the end, the task will give you a link to the Github repository where you should fill in a pull request checkslist and complete the process."
3136
}
3237
]

0 commit comments

Comments
 (0)