Open DerekNonGeneric opened 4 months ago
๐ค this command does not export the complete set of labels:
i see a few good automations here:
right, they should split up into packs, like the blogpost says:
Sane Labelling Scheme
Weโre going to introduce three different types of labels to this particular repo. Those three types are status labels, type labels and priority labels.
status:
type:
priority:
/*
This script will export Github labels to an array.
This array can then be imported using the label importer script.
Instructions:
Go to the labels page for the repo you'd like to export from (https://github.com/user/repo/labels)
Paste this script in your console
Press Enter
Copy the resultant array into the importer script. (https://gist.github.com/AHilyard/5babebe06c30a48e07d949053e00bd5c)
*/
function hslToHex(h, s, l) {
l /= 100;
const a = s * Math.min(l, 1 - l) / 100;
const f = n => {
const k = (n + h / 30) % 12;
const color = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
return Math.round(255 * color).toString(16).padStart(2, '0'); // convert to Hex and prefix "0" if needed
};
return `${f(0)}${f(8)}${f(4)}`;
}
var labels = [];
[].slice.call(document.querySelectorAll(".js-label-link"))
.forEach(function(element) {
labels.push({
name: element.getAttribute("data-name"),
description: element.getAttribute("title"),
color: hslToHex(getComputedStyle(element).getPropertyValue("--label-h"),
getComputedStyle(element).getPropertyValue("--label-s"),
getComputedStyle(element).getPropertyValue("--label-l"))
.trim(),
})
});
console.log(JSON.stringify(labels, null, 2));
/*
This script will import Github labels from an array.
Optionally, existing labels can be removed prior to import.
Instructions:
Go to the labels page for the repo you'd like to import to (https://github.com/user/repo/labels)
Run the labels exporter script first, if you haven't. (https://gist.github.com/AHilyard/a5b9376d0326fd658a8064d5569791a4)
Modify this script by pasting your labels in where directed,
and optionally changing the "removeExisting" variable to true.
Press Enter
Done!
*/
function updateLabel(label) {
var flag = false;
[].slice
.call(document.querySelectorAll(".js-labels-list-item"))
.forEach(function (element) {
if (
element.querySelector(".js-label-link").textContent.trim() === label.name
) {
flag = true;
element.querySelector(".js-edit-label").click();
element.querySelector(".js-new-label-name-input").value = label.name;
element.querySelector(".js-new-label-description-input").value = label.description;
element.querySelector(".js-new-label-color-input").value = "#" + label.color;
element.querySelector(".js-edit-label-cancel ~ .btn-primary").click();
}
});
return flag;
}
function addNewLabel(label) {
document.querySelector(".js-new-label-name-input").value = label.name;
document.querySelector(".js-new-label-description-input").value = label.description;
document.querySelector(".js-new-label-color-input").value = "#" + label.color;
document.querySelector(".js-details-target ~ .btn-primary").disabled = false;
document.querySelector(".js-details-target ~ .btn-primary").click();
}
function addLabel(label) {
if (!updateLabel(label))
{
addNewLabel(label);
}
}
// Change this to true to remove all existing labels first.
var removeExisting = false;
// Remove all pre-existing labels.
if (removeExisting)
{
[].slice.call(document.querySelectorAll(".js-delete-label")).forEach(function (element) {
// Remove the confirmation dialogue first.
element.querySelector(".btn-link").removeAttribute("data-confirm");
element.querySelector(".btn-link").click();
});
}
// Paste your labels here
[]
.forEach(function (label) {
addLabel(label);
});
/*
Purpose: Import settings for GitHub Labels.
(c) James Perrin, MIT License, https://www.countrydawgg.com, | @jamesperrin
Importing Instructions:
1. Update the labels JSON object.
2. Open a web browser.
3. Navigate to the desired GitHub repository.
4. Navigate to Issues tab.
5. Navigate to Labels link.
6. Open the web browswer's Developer Tools
7. Navigate to the Console window.
8. Copy and Paste the below code snippets into the Console window.
Please visit the below link to download the export JavaScript script.
github-labels-export.js - https://gist.github.com/jamesperrin/c2bf6d32fbb8142682f6107e561b664d
*/
const labels = [
{ "name": "โฟ๏ธ Category: Accessibility", "color": "c5def5" },
{ "name": "๐๏ธ Category: Blog", "color": "c5def5" },
{ "name": "๐งซ Category: Boilerplate Generator", "color": "c5def5" },
{ "name": "๐ Category: Content", "color": "c5def5" },
{ "name": "๐ Category: CSS/Styling", "color": "c5def5" },
{ "name": "๐ Category: Documentation", "color": "c5def5" },
{ "name": "๐งช Category: Examples", "color": "c5def5" },
{ "name": "โ๏ธ Category: Functionality", "color": "c5def5" },
{ "name": "๐๏ธ Category: Infrastructure/Tooling/Builds/CI", "color": "c5def5" },
{ "name": "๐ Category: Localization", "color": "c5def5" },
{ "name": "๐ข Category: Marketing", "color": "c5def5" },
{ "name": "๐ Category: Playground", "color": "c5def5" },
{ "name": "๐ธ Category: User Experience (UX)", "color": "c5def5" },
{ "name": "๐จ Category: Tests", "color": "c5def5" },
{ "name": "๐ฅ Good First Issue (GFI)", "color": "c2e0c6" },
{ "name": "๐ฅ P0: Critical", "color": "e11d21" },
{ "name": "๐ P1: High", "color": "e06c6b" },
{ "name": "๐ P2: Medium", "color": "e99695" },
{ "name": "๐ P3: Low", "color": "f2c0bf" },
{ "name": "โ Status: Blocked", "color": "68ddb0" },
{ "name": "๐ง Status: Work In Progress (WIP)", "color": "fbca04" },
{ "name": "๐ฎ Status: Pending Triage", "color": "d93f0b" },
{ "name": "๐ Type: Bug", "color": "c3cc7f" },
{ "name": "โจ Type: Feature", "color": "c3cc7f" },
{ "name": "๐ง Type: Maintenance", "color": "fbca04" },
{ "name": "โจ Type: Enhancement", "color": "84b6eb" },
{ "name": "๐ง Type: Question", "color": "cc317c" },
{ "name": "๐ Type: New", "color": "c3cc7f" },
{ "name": "โป๏ธ Type: Refactor", "color": "c3cc7f" },
{ "name": "โฌ๏ธ Type: Update", "color": "c3cc7f" }
];
// Function to update an existing label
function updateLabel(label) {
let flag = false;
[].slice.call(document.querySelectorAll('.labels-list-item')).forEach((element) => {
if (element.querySelector('.label-link').textContent.trim() === label.name) {
flag = true;
element.querySelector('.js-edit-label').click();
element.querySelector('.js-new-label-name-input').value = label.name;
element.querySelector('.js-new-label-description-input').value = label.description;
element.querySelector('.js-new-label-color-input').value = `#${label.color}`;
element.querySelector('.js-edit-label-cancel ~ .btn-primary').click();
}
});
return flag;
}
// Function to add a new label
function addNewLabel(label) {
document.querySelector('.js-new-label-name-input').value = label.name;
document.querySelector('.js-new-label-description-input').value = label.description;
document.querySelector('.js-new-label-color-input').value = `#${label.color}`;
document.querySelector('.js-details-target ~ .btn-primary').disabled = false;
document.querySelector('.js-details-target ~ .btn-primary').click();
}
// Function to update or add a new label
function addLabel(label) {
if (!updateLabel(label)) {
addNewLabel(label);
}
}
labels.map((label) => {
addLabel(label);
});
well, it has been determined (over the last several years) that CLAs are no bueno:
so, i have just removed those labels
looking at what else sticks out / or is missing
wow, 2019 was a very different World!
here is the thing tho: we have TC39, WHATWG, etc. members that speak those languages even if they may be displaced at the moment, so altho i do not speak or understand many of those languages, having the translation available to them is not a problem to me at all
okay, i think we should remove all the multilingual labels for now, since this has not really become too much of concern yet (at least)
one can see the most up-to-date collection of labels here (wip):
something that is currently kinda in disarray is the color-coding (or lack thereof) of our labels (no method to our madness), but perhaps there should be:
Use color-coded labels to categorize issues by priority, status, or type
When you have a lot of issues to triage, it can be helpful to see at a glance which ones are the most important. By using color-coded labels, you can quickly scan through a list of issues and identify which ones need your attention first.
You can also use color-coding to indicate the status of an issue. For example, you could use a green label for โready to be worked onโ and a red label for โneeds more information.โ This is a great way to keep track of the progress of an issue and make sure that nothing falls through the cracks.
—https://climbtheladder.com/10-github-labels-best-practices/#p3
well, i should create a nice presentation for y'all like this:
https://github.com/nodejs/modules/issues/24#issuecomment-427657405
Refs: https://github.blog/2018-02-22-label-improvements-emoji-descriptions-and-more/
we have spiffy labels in some repos now, but they are not evenly distributed; we should prioritize keeping them nice and safe here w/ directions on how to apply them everywhere else:
syncing scripting: