Technical prereqs for big org-wide label sync #60
Technical prereqs for big org-wide label sync #60
Conversation
2727973
to
b51ca13
Compare
Hi @kdmccormick! I noticed we no longer have the "Need tests run" label - Tim and I use it for OSPR triage so it's clear to whoever is running the tests, which PRs need it. Any chance we could get it back? We have a status column for an OSPR that needs a CLA or tests enabled, but without the actual test label, we'd have to click in each OSPR to see if tests needs to be run. "needs test run" | Author’s first PR to a repository, awaiting test authorization from AximThis means an author has not contributed to a particular repo before and needs authorization to be able to run tests on the PR. Currently, test authorization is handled by Axim. |
@mphilbrick211 This specific PR, with its limited set of labels, exists only to address some technical prerequisites to label syncing. It will not remove any of the labels you folks use for OSPRs 😄 We'll be explicitly adding the |
Thanks @kdmccormick! The label is not currently available for us to use - do you know when we'll have access to it again? |
@mphilbrick211 @kdmccormick As of this morning, This is a screenshot from openedx/frontend-app-learning#981. So it looks like the issue has been fixed or, if you're still seeing it @mphilbrick211, it might be repo-specific? |
@mphilbrick211 It is likely that the I recommend adding it manually for now. I hope to have all the OSPR labels added consistently & automatically by the end of May. |
Thanks, @kdmccormick - though, Tim and I aren't able to create labels. |
Just saw @itsjeyd's comment - the label appears for me in most of the larger repos, but not in ones like "openedx/openedx-event-sink-clickhouse". So, @kdmccormick it looks like this project will fix that :) |
@mphilbrick211 I think by "adding it manually", @kdmccormick might have been referring to posting a comment of the form I just tested this on openedx-unsupported/openedx-event-sink-clickhouse#2 and it worked fine: -- Side note: This is how I've been adding the |
b51ca13
to
99f477c
Compare
When handling an HTTP 409 for empty git repos, this: e.fp.read() was yielding an empty bytestring. This caused us to pass through the empty-repo handling code and crash with the HTTP 409. Instead, we just do this: str(e) and compare against that output, which is nearly as good.
cbc2b37
to
a5ca8b9
Compare
The --check/-c option allows the name of a check class to be passed in, case-insensitively: python -m migrate.repo_checks -c requiretriageteamaccess -c requireclacheck Additionally, we improve the output in a few ways: * bold the repo names * make skipped checks cyan to distinguish them from steps * print out checks that will be run at the beginning * print check class names instead of class repr's Finally, we add usage instructions to the module docstring.
We are preparing make the EnsureLabels checks the one-and-only authoritative place for org-level labels. As part of this, we're extracting the list of labels out of the Python script and into a YAML file. For repos that are already up-to-date with repo_checks, this change should be a no-op. Additionally, this cleans up the EnsureLabels code a bit so that it'll be easier to add label-description support in the next commit. Part of: https://openedx.atlassian.net/wiki/spaces/COMM/pages/3695214629/openedx+org-wide+labels#1.-Proposal%3A-Store-labels-in-one-central-place
repo_checks currently normalizes label names and colors. With this commit, it will also normalize the label description. In interest of minimizing the effect of running the EnsureLabels check: For labels that generally have already-established descriptions, we use those. For labels that don't, we just use !!null for now, with the plan of adding descriptions in the near future. Part of: https://openedx.atlassian.net/wiki/spaces/COMM/pages/3695214629/openedx+org-wide+labels#2.-Proposal%3A-List-of-starter-labels
a5ca8b9
to
cab173e
Compare
Fixes openedx-unsupported#60 I had tested the --dry-run but not the --no-dry-run code path. Just needed to update the arguments to the create_issue API call. For good measure, I also update both create_ and update_ API calls to use only kwargs.
Other than a minor hiccup, fixed by #62, this applied successfully 🚀 |
Fixes #60 I had tested the `--dry-run` but not the `--no-dry-run` code path. To fix, we just update the arguments to the `create_issue` API call. For good measure, we update both the `create_issue` and `update_issue` API calls to use only kwargs.
This is just a technical implementation PR. The list of labels here is not the full list. To see the full list of labels we plan to add, please see: #61
Background
This implements 1. Proposal: Store labels in one central place, following the "Store the labels in a new
labels.jsonlabels.yml file in the same directory as repo_checks.py" option.It also spruces up repo_checks a bit in order to run the check which creates/updates the labels. Notably, we introduce the
--check
option, and rename--target
to--repo
.Next up after this PR would be:
Description
Changes are broken up by commit. See the commit log.
Testing & Applying
I did a dry run of this using:
python -m migrate.repo_checks -c ensurelabels
.The beginning of the output, with colors:
Full output: https://gist.github.com/kdmccormick/708fc262ac751ca4728a4d7bc208e93b
Only a handful of repos (the very newest ones) would have labels created by this. Some repos will have label descriptions updated. The majority of repos will have no changes.