6b834f2cbc
When a build fails for a commit, create a todo for the author of the merge request that commit is the HEAD of. If the commit isn't the HEAD commit of any MR, don't do anything. If there already is a todo for that user and MR, don't do anything. Current limitations: - This isn't configurable by project. - The author of a merge request might not be the person who pushed the breaking commit.
26 lines
447 B
Ruby
26 lines
447 B
Ruby
FactoryGirl.define do
|
|
factory :todo do
|
|
project
|
|
author
|
|
user
|
|
target factory: :issue
|
|
action { Todo::ASSIGNED }
|
|
|
|
trait :assigned do
|
|
action { Todo::ASSIGNED }
|
|
end
|
|
|
|
trait :mentioned do
|
|
action { Todo::MENTIONED }
|
|
end
|
|
|
|
trait :on_commit do
|
|
commit_id RepoHelpers.sample_commit.id
|
|
target_type "Commit"
|
|
end
|
|
|
|
trait :build_failed do
|
|
action { Todo::BUILD_FAILED }
|
|
end
|
|
end
|
|
end
|