diff --git a/src/clj/commiteth/routes/webhooks.clj b/src/clj/commiteth/routes/webhooks.clj index 88b374d..dff53a7 100644 --- a/src/clj/commiteth/routes/webhooks.clj +++ b/src/clj/commiteth/routes/webhooks.clj @@ -7,6 +7,7 @@ [commiteth.bounties :as bounties] [commiteth.db [issues :as issues] + [bounties :as db-bounties] [pull-requests :as pull-requests] [repositories :as repositories] [users :as users]] @@ -133,19 +134,17 @@ ;; merged (cond open-or-edit? (do - (log/info "PR with reference to bounty issue" - (:issue_number issue) "opened") + (log/infof "issue %s: PR with reference to bounty issue opened" (:issue_number issue)) (pull-requests/save (merge pr-data {:state :opened :commit_sha head-sha}))) close? (if merged? - (do (log/info "PR with reference to bounty issue" - (:issue_number issue) "merged") + (do (log/infof "issue %s: PR with reference to bounty issue merged" (:issue_number issue)) (pull-requests/save (merge pr-data {:state :merged :commit_sha head-sha})) - (issues/update-commit-sha (:issue_id issue) head-sha)) - (do (log/info "PR with reference to bounty issue" - (:issue_number issue) "closed with no merge") + (issues/update-commit-sha (:issue_id issue) head-sha) + (db-bounties/update-winner-login (:issue_id issue) login)) + (do (log/infof "issue %s: PR with reference to bounty issue closed with no merge" (:issue_number issue)) (pull-requests/save (merge pr-data {:state :closed :commit_sha head-sha}))))))) diff --git a/src/clj/commiteth/scheduler.clj b/src/clj/commiteth/scheduler.clj index 54cf0c0..57aa61e 100644 --- a/src/clj/commiteth/scheduler.clj +++ b/src/clj/commiteth/scheduler.clj @@ -116,6 +116,9 @@ tokens :tokens winner-login :winner_login} (db-bounties/pending-bounties)] (try + ;; TODO(martin) delete this shortly after org-dashboard deploy + ;; as we're now setting `winner_login` when handling a new claims + ;; coming in via webhooks (see `commiteth.routes.webhooks/handle-claim`) (db-bounties/update-winner-login issue-id winner-login) (let [value (eth/get-balance-hex contract-address)] (if (empty? payout-address)