Nudge Github PR reviewers with Slack API

This page summarizes the projects mentioned and recommended in the original post on dev.to

Scout Monitoring - Rennaisance engineers rejoice! 1 gem 5 min to app monitoring
5-minute onboarding. No sales team. Devs in the support channels. No DevOps team required. Get the free app insights every engineer deserves with Scout Monitoring.
www.scoutapm.com
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • repo

  • @match https://github.com//*/pull/* to run the script only when navigating to a PR page, such as https://github.com/Org/Repo/pull/4605

  • Puts Debuggerer

    Ruby library for improved puts debugging, automatically displaying bonus useful information such as source line number and source code.

  • // ==UserScript== // @name PR nudge // @namespace https://github.com/ // @version 1.0.0 // @description Nudge PR reviewers // @author You // @match https://github.com//*/pull/* // @icon https://www.google.com/s2/favicons?sz=64&domain=github.com // @grant GM_xmlhttpRequest // @connect slack.com // ==/UserScript== (function () { "use strict"; const GithubSlackMap = { strdr4605: "U**********", ... }; const PR_NUDGE_WEBHOOK = "https://hooks.slack.com/services/********/***********/************************"; const nudgeButton = document.createElement("button"); nudgeButton.innerText = "Nudge reviewers"; nudgeButton.className = "btn btn-sm js-details-target d-inline-block float-left float-none m-0 mr-md-0 js-title-edit-button"; const reviewersFormElement = document.getElementById( "reviewers-select-menu" ).parentElement; function getAllAwaiting() { const allReviewers = Array.from(reviewersFormElement.querySelectorAll("p")); const awaiting = allReviewers.filter((reviewerEl) => reviewerEl .querySelector("span[aria-label]") .getAttribute("aria-label") .startsWith("Awaiting") ); const awaitingNicknames = awaiting.map( (reviewerEl) => reviewerEl.querySelectorAll("a")[1].innerText ); return awaitingNicknames; } function slackMention(githugNickname) { return GithubSlackMap[githugNickname] ? `<@${GithubSlackMap[githugNickname]}>` : githugNickname; } function onNudgeBtnClick(e) { e.preventDefault(); const prLink = window.location.href; const prTitle = document.title.split(" by ")[0] || prLink; const awaitingReviewers = getAllAwaiting(); if (!awaitingReviewers.length) { return; } const dataObj = { text: `Hey ${awaitingReviewers.map( slackMention )},\nI really need your review on <${prLink}|${prTitle}>. πŸ₯ΊπŸ˜‡πŸ™πŸ˜Š`, }; GM_xmlhttpRequest({ fetch: true, method: "POST", url: PR_NUDGE_WEBHOOK, data: JSON.stringify(dataObj), responseType: "json", nocache: true, onload: (response) => console.log({ response }), onerror: (err) => console.error({ err }), }); } nudgeButton.addEventListener("click", onNudgeBtnClick); setTimeout(() => { reviewersFormElement.appendChild(nudgeButton); }, 1000); })();

  • Scout Monitoring

    Rennaisance engineers rejoice! 1 gem 5 min to app monitoring. 5-minute onboarding. No sales team. Devs in the support channels. No DevOps team required. Get the free app insights every engineer deserves with Scout Monitoring.

    Scout Monitoring logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • The Ultimate beginners guide to open source – part 2: ways to find open source projects to contribute to

    1 project | dev.to | 1 Jun 2024
  • Cargo Actions: An efficient tool for managing and creating GitHub Actions workflow templates

    2 projects | dev.to | 31 May 2024
  • Showcase Your GitHub Profile: Contribute to the "Cool GitHub Profile README" Repository!

    3 projects | dev.to | 27 May 2024
  • GitHub Basics: Creating Repository and Maintaining It

    1 project | dev.to | 27 May 2024
  • Where MonDev tools comes from

    1 project | dev.to | 27 May 2024