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

Updating message when review is already running #590

Merged
merged 3 commits into from
Feb 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/worker/attemptor.ex
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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