Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Merge #590
Browse files Browse the repository at this point in the history
590: Updating message when review is already running r=notriddle a=mimimalizam

This PR replaces message `Not awaiting review` with `Already running a review` for Atemptor and Batcher messages when another review is in progress. It should resolve #568. Please let me know if there is anything else left to be changed. Also if suggested Batcher change is excess, I can remove it :) .  

Co-authored-by: Milana <milana.stojadinov@gmail.com>
  • Loading branch information
bors[bot] and mimimalizam committed Feb 3, 2019
2 parents ff50167 + 2369ecf commit 2399321
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/worker/attemptor.ex
Expand Up @@ -85,7 +85,7 @@ defmodule BorsNG.Worker.Attemptor do
# There is already a running attempt
project
|> get_repo_conn()
|> send_message(patch, :not_awaiting_review)
|> send_message(patch, :already_running_review)
end
end

Expand Down Expand Up @@ -295,7 +295,7 @@ defmodule BorsNG.Worker.Attemptor do
defp maybe_start_next_attempt(:running, _project) do
:ok
end

defp maybe_start_next_attempt(_state, project) do
case Repo.one(Attempt.all_for_project(project.id, :waiting)) do
nil -> :ok
Expand Down
2 changes: 1 addition & 1 deletion lib/worker/batcher.ex
Expand Up @@ -107,7 +107,7 @@ defmodule BorsNG.Worker.Batcher do
project = Repo.get!(Project, patch.project_id)
project
|> get_repo_conn()
|> send_message([patch], :not_awaiting_review)
|> send_message([patch], :already_running_review)
patch ->
# Patch exists and is awaiting review
# This will cause the PR to start after the patch's scheduled delay
Expand Down
4 changes: 2 additions & 2 deletions lib/worker/batcher/message.ex
Expand Up @@ -43,8 +43,8 @@ defmodule BorsNG.Worker.Batcher.Message do
def generate_message({:preflight, :ci_skip}) do
"Has [ci skip], bors build will time out"
end
def generate_message(:not_awaiting_review) do
"Not awaiting review"
def generate_message(:already_running_review) do
"Already running a review"
end
def generate_message({:config, message}) do
"# Configuration problem\n#{message}"
Expand Down
2 changes: 1 addition & 1 deletion test/attemptor_test.exs
Expand Up @@ -54,7 +54,7 @@ defmodule BorsNG.Worker.AttemptorTest do
branches: %{},
commits: %{},
comments: %{
1 => ["## try\n\nNot awaiting review"]
1 => ["## try\n\nAlready running a review"]
},
statuses: %{},
files: %{}
Expand Down
2 changes: 1 addition & 1 deletion test/batcher/batcher_test.exs
Expand Up @@ -242,7 +242,7 @@ defmodule BorsNG.Worker.BatcherTest do
branches: %{},
commits: %{},
comments: %{
1 => ["Not awaiting review"]
1 => ["Already running a review"]
},
statuses: %{},
files: %{}
Expand Down

0 comments on commit 2399321

Please sign in to comment.