Skip to content

Commit

Permalink
318: The "outdated" label should be renamed to "merge-conlict"
Browse files Browse the repository at this point in the history
Reviewed-by: ehelin
  • Loading branch information
rwestberg committed Mar 23, 2020
1 parent 4e75eeb commit 8cbce58
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions bots/pr/src/main/java/org/openjdk/skara/bots/pr/CheckRun.java
Original file line number Diff line number Diff line change
Expand Up @@ -609,16 +609,16 @@ private void checkStatus() {
var commitMessage = String.join("\n", commit.message());
var readyForIntegration = visitor.getMessages().isEmpty() && additionalErrors.isEmpty();
updateMergeReadyComment(readyForIntegration, commitMessage, comments, activeReviews, rebasePossible);
if (readyForIntegration) {
if (readyForIntegration && rebasePossible) {
newLabels.add("ready");
} else {
newLabels.remove("ready");
}
if (!rebasePossible) {
addOutdatedComment(comments);
newLabels.add("outdated");
newLabels.add("merge-conflict");
} else {
newLabels.remove("outdated");
newLabels.remove("merge-conflict");
}

// Ensure that the ready for sponsor label is up to date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ void cannotRebase(TestInfo testInfo) throws IOException {

// Get all messages up to date
TestBotRunner.runPeriodicItems(mergeBot);
assertTrue(pr.labels().contains("ready"));

// Push something conflicting to master
localRepo.checkout(masterHash, true);
Expand All @@ -581,7 +582,8 @@ void cannotRebase(TestInfo testInfo) throws IOException {
assertEquals(1, updated);

// The PR should be flagged as outdated
assertTrue(pr.labels().contains("outdated"));
assertTrue(pr.labels().contains("merge-conflict"));
assertFalse(pr.labels().contains("ready"));

// An instructional message should have been bosted
var help = pr.comments().stream()
Expand All @@ -608,7 +610,8 @@ void cannotRebase(TestInfo testInfo) throws IOException {
assertEquals(1, updated);

// The PR should not be flagged as outdated
assertFalse(pr.labels().contains("outdated"));
assertFalse(pr.labels().contains("merge-conflict"));
assertTrue(pr.labels().contains("ready"));
}
}

Expand Down
4 changes: 2 additions & 2 deletions cli/src/main/java/org/openjdk/skara/cli/pr/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ static String statusForPullRequest(PullRequest pr) {
return "READY";
} else if (labels.contains("rfr")) {
return "RFR";
} else if (labels.contains("outdated")) {
return "OUTDATED";
} else if (labels.contains("merge-conflict")) {
return "CONFLICT";
} else if (labels.contains("oca")) {
return "OCA";
} else {
Expand Down

0 comments on commit 8cbce58

Please sign in to comment.