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

.github: Add label generation tool and update labels #1389

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from

Conversation

arvganesh
Copy link

@arvganesh arvganesh commented Apr 20, 2024

Prerequisite checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran the checkpatch.uk on your commit series before opening this PR;
  • Updated relevant documentation.

Base target

  • Architecture(s): N/A
  • Platform(s): N/A
  • Application(s): N/A

Additional configuration

Added update_labels.py, a tool to automatically update the files in .github/labels with configuration of latest labels from Github.

It only has one external dependency, ruamel-yaml, which is a more powerful derivative of PyYAML for interacting with YAML files.

Description of changes

Update labels in .github/labels to match the current state of the repo.

To aid with this process in the future, I also wrote a tool (update_labels.py) to automate the majority of this process. It queries this endpoint in the GithubAPI, grabs the relevant data, and updates the YAML files in .github/labels.

GitHub-Fixes: #1283

@arvganesh arvganesh requested a review from a team as a code owner April 20, 2024 23:22
@github-actions github-actions bot added the lang/python Issues or PRs to do with Python label Apr 20, 2024
Copy link
Member

@craciunoiuc craciunoiuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @arvganesh

This initial version looks really good, left you some comments.

Can you squash you commits and leave only two:

  1. .github/scripts: Add label generation tool
  2. .github/labels: Update labels to track latest staging

You will also need to add commit message bodies for each to describe the changes. (in order for the checkpatch check to pass)

.github/update_labels.py Outdated Show resolved Hide resolved
.github/update_labels.py Outdated Show resolved Hide resolved
.github/update_labels.py Outdated Show resolved Hide resolved
@craciunoiuc
Copy link
Member

In a separate PR, if you want, we can also add a workflow that runs on pushes (or weekly) and checks if labels changed and updates them automatically.

@craciunoiuc craciunoiuc changed the title Update .github/labels and created code generation tool. .github: Add label generation tool and update labels Apr 22, 2024
@arvganesh arvganesh force-pushed the update_labels branch 3 times, most recently from b886451 to e49aceb Compare April 23, 2024 20:10
Copy link
Member

@nderjung nderjung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @arvganesh! Thanks for this contribution. We use an external tool called governctl to do the heavy lifting in terms of interacting with GitHub's API, performing operations specifically on the Unikraft core repository as well as organization-wide repositories and teams.

In order to prevent too many tools, scripts or programs dotted all over the place, I suggest looking at how label synchronization can be accomplished with this tool under a new subcommand governctl labels sync.

One thing to note is that these label config files are in fact meant to work in the opposite direction: their static declaration should dictate GitHub's state of labels (aka "Infrastructure as Code"). This means that labels should be updated from the repo and not the other way around.

I think this particular issue can be kept nearly as-is sans the introduction of the python script, changes to descriptions and changing the hex color values.

For direct changes to the labels, please:

  • Ensure all color attributes are quoted, lowercase and include a pound (#) symbol i.e.: "#1d76db" is better vs. 1D76DB. This prevents the diff from needless changes;
  • Only change the description if it is a better representation of what the label is intended;
  • Remove libx/posix-unisocket;

Thanks!

@razvand razvand self-assigned this Apr 28, 2024
@razvand razvand added this to the v0.17.0 (Calypso) milestone Apr 28, 2024
Using the code generation tool in .github/scripts, update labels in .github/labels to match the latest staging.

Signed-off-by: Arvind Ganesh <arvind.cganesh@gmail.com>
@arvganesh
Copy link
Author

Hi @nderjung. Thanks for getting back to me! Had a few follow-up questions:

Re: governctl labels sync, are you suggesting that I should look into adding the label generation code to governctl?

Re: The changes in this PR, there were many label files that were "created" (i.e labels were on GitHub but not in ./github/labels). Since you said the contents of .github/labels are the ground truth, should I revert any new label files that were created?

@nderjung
Copy link
Member

Re: governctl labels sync, are you suggesting that I should look into adding the label generation code to governctl?

Yes.

Re: The changes in this PR, there were many label files that were "created" (i.e labels were on GitHub but not in ./github/labels). Since you said the contents of .github/labels are the ground truth, should I revert any new label files that were created?

The new libraries we can keep. There are also changes which need to be reverted:

  • There are additions and deletions which represent re-ordering of libraries. E.g. bug/fix, lifecycle/stale, lifecycle/rotten, priority/low, etc. Please double check all entries and please keep their order.
  • A lot of descriptions are changed, I assume because they were taken what GitHub has. Having gone through the list, I think the best approach is to take the longer description. E.g. "Issues and PRs related to Linux Userspace platform" vs "Unikraft for Linux Userspace", the former is better.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/python Issues or PRs to do with Python
Projects
Status: 🏗 In Progress
Development

Successfully merging this pull request may close these issues.

.github/labels: Update list of labels to match current repository
4 participants