-
Puts Debuggerer
Ruby library for improved puts debugging, automatically displaying bonus useful information such as source line number and source code.
-
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.
@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
// ==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); })();
Related posts
-
The Ultimate beginners guide to open source β part 2: ways to find open source projects to contribute to
-
Cargo Actions: An efficient tool for managing and creating GitHub Actions workflow templates
-
Showcase Your GitHub Profile: Contribute to the "Cool GitHub Profile README" Repository!
-
GitHub Basics: Creating Repository and Maintaining It
-
Where MonDev tools comes from