Skip to content

Commit

Permalink
#585 reply for assigned Pull Request
Browse files Browse the repository at this point in the history
  • Loading branch information
amihaiemil committed Oct 10, 2020
1 parent 1667395 commit c329b7c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,23 @@ private void assignTask(final Project project,
LOG.debug("Elected @" + contributor.username() + ".");
final Task assigned = task.assign(contributor);
issue.assign(contributor.username());
issue.comments().post(
String.format(
final String reply;
if(issue.isPullRequest()) {
reply = String.format(
project.language().reply("pullRequestAssigned.comment"),
contributor.username(),
assigned.deadline(),
assigned.estimation()
);
} else {
reply = String.format(
project.language().reply("taskAssigned.comment"),
contributor.username(),
assigned.deadline(),
assigned.estimation()
)
);
);
}
issue.comments().post(reply);
LOG.debug(
"Task #" + issue.issueId() + " assigned to @"
+ contributor.username() + "."
Expand Down
7 changes: 7 additions & 0 deletions self-core-impl/src/test/resources/responses_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ taskAssigned.comment=@%s this is your task now, please go ahead. Deadline (when
Remember, you don't have to solve everything in this ticket - you can solve it partially\
and leave ``todo`` markers in the code, which will become future tasks.\n\n\
If you have any questions don't ask me, I'm not a technical person. Open new tickets instead.
pullRequestAssigned.comment=@%s please review this Pull Request. Deadline (when it should be merged or closed) \
is ``%s``.\n\n\
You should check if the requirements have been implemented (partially or in full), \
if there are unit tests covering the changes and if the CI build passes. \
Feel free to reject the PR or ask for changes if it's too big or not clear enough.\n\n\
Estimation here is ``%s minutes``, that's how much you will be paid. You will be \
paid even if this PR gets rejected.
resigned.comment=@%s ok, I'll find someone else to take care of it.
cannotResign.comment=@%s this task is not assigned to you at the moment.\
Only the task's assignee can ask for resignation.
Expand Down

0 comments on commit c329b7c

Please sign in to comment.