Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🏷️💽 distribute labels into packs geared to tackling missions/themes #716

Open
DerekNonGeneric opened this issue Feb 21, 2024 · 6 comments

Comments

@DerekNonGeneric

This comment was marked as resolved.

@DerekNonGeneric
Copy link
Member Author

DerekNonGeneric commented Feb 22, 2024

@OpenINFbot OpenINFbot changed the title 🎨✨ include spiffy labels in this repo for redistribution to others 🔧✨ include spiffy labels in this repo for redistribution to others Feb 22, 2024
@DerekNonGeneric
Copy link
Member Author

DerekNonGeneric commented Feb 23, 2024

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
Copy link
Member Author

DerekNonGeneric commented Feb 23, 2024

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
Copy link
Member Author

DerekNonGeneric commented Feb 25, 2024

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
Copy link
Member Author

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

nodejs/modules#24 (comment)

@OpenINFbot OpenINFbot changed the title 🔧✨ include spiffy labels in this repo for redistribution to others 🔧✨ gather serialized labels organized and sharable per project type Feb 28, 2024
@DerekNonGeneric DerekNonGeneric changed the title 🔧✨ gather serialized labels organized and sharable per project type 🔧✨ package serialized labels into packs as geared towards tackling missions/themes Feb 28, 2024
@DerekNonGeneric DerekNonGeneric changed the title 🔧✨ package serialized labels into packs as geared towards tackling missions/themes 🔧✨ package serialized labels into spec. packs geared to tackling missions/themes Feb 28, 2024
@DerekNonGeneric DerekNonGeneric changed the title 🔧✨ package serialized labels into spec. packs geared to tackling missions/themes 🔧✨ distribute labels into spec. packs geared to tackling missions/themes Feb 28, 2024
@DerekNonGeneric DerekNonGeneric changed the title 🔧✨ distribute labels into spec. packs geared to tackling missions/themes 🏷️💽 distribute labels into spec. packs geared to tackling missions/themes Feb 28, 2024
@DerekNonGeneric DerekNonGeneric changed the title 🏷️💽 distribute labels into spec. packs geared to tackling missions/themes 🏷️💽 distribute labels into packs geared to tackling missions/themes Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants