diff --git a/lib/algora/integrations/github/poller/comments.ex b/lib/algora/integrations/github/poller/comments.ex index 4377e83a0..c64973d65 100644 --- a/lib/algora/integrations/github/poller/comments.ex +++ b/lib/algora/integrations/github/poller/comments.ex @@ -80,6 +80,11 @@ defmodule Algora.Github.Poller.Comments do {:reply, {state.repo_owner, state.repo_name}, state} end + @impl true + def handle_call(:is_paused, _from, state) do + {:reply, false, state} + end + defp schedule_poll do Process.send_after(self(), :poll, @poll_interval) end diff --git a/lib/algora/integrations/github/poller/supervisor.ex b/lib/algora/integrations/github/poller/supervisor.ex index 75c27beae..e4dc3f4d5 100644 --- a/lib/algora/integrations/github/poller/supervisor.ex +++ b/lib/algora/integrations/github/poller/supervisor.ex @@ -4,6 +4,8 @@ defmodule Algora.Github.Poller.Supervisor do alias Algora.Comments alias Algora.Github.Poller.Comments, as: CommentsPoller + alias Algora.Github.TokenPool + alias Algora.Workspace require Logger @@ -30,8 +32,16 @@ defmodule Algora.Github.Poller.Supervisor do end def add_repo(owner, name, opts \\ []) do - spec = {CommentsPoller, [repo_owner: owner, repo_name: name] ++ opts} - DynamicSupervisor.start_child(__MODULE__, spec) + token = TokenPool.get_token() + + case Workspace.ensure_repository(token, owner, name) do + {:ok, _repository} -> + spec = {CommentsPoller, [repo_owner: owner, repo_name: name] ++ opts} + DynamicSupervisor.start_child(__MODULE__, spec) + + error -> + error + end end def terminate_child(owner, name) do diff --git a/lib/algora_web/live/swift_bounties_live.ex b/lib/algora_web/live/swift_bounties_live.ex index a27935190..f71e1e994 100644 --- a/lib/algora_web/live/swift_bounties_live.ex +++ b/lib/algora_web/live/swift_bounties_live.ex @@ -4,8 +4,11 @@ defmodule AlgoraWeb.SwiftBountiesLive do import AlgoraWeb.Components.Bounties import AlgoraWeb.Components.Footer + import Ecto.Query alias Algora.Bounties + alias Algora.Repo + alias AlgoraWeb.Components.Logos def mount(_params, _session, socket) do if connected?(socket) do @@ -21,6 +24,7 @@ defmodule AlgoraWeb.SwiftBountiesLive do |> assign(:page_description, "Help grow the Swift ecosystem by funding the work we all depend on.") |> assign(:page_image, "#{AlgoraWeb.Endpoint.url()}/images/og/swift.png") |> assign_tickets() + |> assign_active_repos() end {:ok, socket} @@ -104,7 +108,7 @@ defmodule AlgoraWeb.SwiftBountiesLive do -
+ /bounty $1000
+
+
+ /tip $500 @username
+
+ + You can create bounties and send tips on any of the Swift repositories below once you've connected your GitHub account. +
+