Skip to content

Commit

Permalink
Add thumbs-up for normal/low priority
Browse files Browse the repository at this point in the history
Signed-off-by: stianst <[email protected]>
  • Loading branch information
stianst committed Feb 22, 2024
1 parent 1632278 commit 6ac990a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/main/java/org/keycloak/gh/bot/BugActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.kohsuke.github.GHMilestone;
import org.kohsuke.github.GHRepository;
import org.kohsuke.github.PagedIterator;
import org.kohsuke.github.ReactionContent;

import java.io.IOException;
import java.util.HashMap;
Expand Down Expand Up @@ -63,13 +64,15 @@ public class BugActions {
BugAction.create(Action.PRIORITY_NORMAL)
.priority(Priority.NORMAL)
.comment()
.thumbsUp()
.helpWanted()
.autoExpire()
.autoBump()
.removeMilestone(),
BugAction.create(Action.PRIORITY_LOW)
.priority(Priority.LOW)
.comment()
.thumbsUp()
.helpWanted()
.autoExpire()
.autoBump()
Expand Down Expand Up @@ -129,6 +132,10 @@ private void runAction(BugAction action, GHIssue issue) throws IOException {
labelsToAdd.add(Status.AUTO_BUMP.toLabel());
}

if (action.thumbsUp) {
issue.createReaction(ReactionContent.PLUS_ONE);
}

labelsToRemove.add(action.action.toLabel());

labelsToRemove.removeAll(labelsToAdd);
Expand Down Expand Up @@ -218,6 +225,8 @@ static final class BugAction {
boolean autoExpire = false;
boolean autoBump = false;

boolean thumbsUp = false;

public static BugAction create(Action action) {
return new BugAction(action);
}
Expand Down Expand Up @@ -276,6 +285,11 @@ BugAction autoBump() {
return this;
}

BugAction thumbsUp() {
this.thumbsUp = true;
return this;
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ action-INVALID=\
action-PRIORITY_NORMAL=\
Due to the amount of issues reported by the community we are not able to prioritise resolving this issue at the moment.\n\
\n\
If you are affected by this issue, upvote it by adding a :thumbsup: in the description. We would also welcome a \
If you are affected by this issue, upvote it by adding a :thumbsup: to the description. We would also welcome a \
contribution to fix the issue.

action-PRIORITY_LOW=\
Due to the amount of issues reported by the community we are not able to prioritise resolving this issue at the moment.\n\
\n\
If you are affected by this issue, upvote it by adding a :thumbsup: in the description. We would also welcome a \
If you are affected by this issue, upvote it by adding a :thumbsup: to the description. We would also welcome a \
contribution to fix the issue.

expired=\
Expand Down

0 comments on commit 6ac990a

Please sign in to comment.