   project management from `:baumeister_core`. In particular, it translates
   between the project's plugins and the settable metadata from the Web UI.
   """
-  alias Baumeister.Observer.DelayPlugin
+  alias Baumeister.Observer.Delay
   alias Baumeister.Observer.GitPlugin
   alias Baumeister.Observer.NoopPlugin
   alias Baumeister.Observer.Take

  """
  @spec plugins(Project.t) :: [Baumeister.Observer.plugin_config_t]
  def plugins(%Project{plugins: "Git", url: repo_url, delay: delay}) do
    {:ok, [{GitPlugin, repo_url}, {DelayPlugin, delay}]}
  end
  def plugins(_) do
    {:ok, [{NoopPlugin, {"no_url:///", "command: false"}}, {Take, 5}]}
  end

  @doc """
  Deletes the given `project` from Baumeister core coordinator.

  """
  @spec add_project_to_coordinator(Project.t) :: :ok | {:error, any}
  def add_project_to_coordinator(project) do
    with {:ok, plugin_list} <- plugins(project) do
      Baumeister.add_project(project.name, project.url, plugin_list)
    end
  end
