OpenINF / .github

A โœจspecialโœจ repository: org-level default metadata & community health files for use across all OpenINF projects on GitHub
https://github.com/OpenINF/.github#readme
3 stars 1 forks source link

๐Ÿท๏ธ๐Ÿ’ฝ distribute labels into packs geared to tackling missions/themes #716

Open DerekNonGeneric opened 4 months ago

DerekNonGeneric commented 4 months ago

labels

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:

DerekNonGeneric commented 4 months ago

https://cli.github.com/manual/gh_label

๐Ÿค” this command does not export the complete set of labels:

image

DerekNonGeneric commented 4 months ago

i see a few good automations here:

DerekNonGeneric commented 4 months ago

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);
});
DerekNonGeneric commented 4 months ago

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

DerekNonGeneric commented 4 months ago

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

DerekNonGeneric commented 4 months ago

well, i should create a nice presentation for y'all like this:

https://github.com/nodejs/modules/issues/24#issuecomment-427657405