-
-
Notifications
You must be signed in to change notification settings - Fork 776
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
Create JSON file and related functionality for replacing hard-coded labels #6442
Create JSON file and related functionality for replacing hard-coded labels #6442
Conversation
HfLA labels as of 3/7/24
Want to review this pull request? Take a look at this documentation for a step by step guide! From your project repository, check out a new branch and test the changes.
Note that CONTRIBUTING.md cannot previewed locally; rather it should be previewed at this URL:
|
Refactor labelRetrieveName()
Add 'deleted' trigger
@marioantonini I connected with Will about this issue and it looks like it's still in draft, so I'm going to remove us as reviewers for now. Also leaving this as a note to anyone else who sees this PR and considers picking it up. |
Add prepend of "NEW-" to new labelKeys
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
updated keyNames from devPM meeting
Tweaks to no update condition
update comment to ref hackforla-bot
to address CodeQL warning
Review ETA: 3 PM Thursday |
Updated review schedule! |
Hello @santisecco Thank you for your review so far. Please let me know if there is anything that you have questions about, questions, comments, or concerns. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @t-will-gillis everything looks great.
Tested the automation in my repo and labels are correctly updated, deleted and added.
I liked the idea of setting the labelID to '9999999999' when the label is deleted. I think it's safer and more efficient than deleting it from the JSON file.
Understood that retrieve-label-directory.js is not yet used but will be in the future, also the presence of the wishlist and that the Google sheets doc is updated using Google Apps Script.
Branches are correct. And your explanation of Why and What changes you made is clear and concise.
Thanks for working on this and answering my questions on the changes throughout the review process.
Final edits are for linking to the live 'Source of Truth' document as well as updating the JSON labels so that the file is current as of today. Bypassing final review since the previous review was full approval. |
Fixes #5205
What changes did you make?
label-directory.json
and located it in a new subfolderretrieve-label-directory.js
that returns the actual label display name value when a label key name is provided- note that this is not currently used. It is a necessary file for the next phase which updates the GHA filesupdate-label-directory.yml
that is triggered whenever one of the HfLA labels is edited or is added.update-label-directory.js
that determines whether the label is a name-change (such as by adding an emoji) or is a new label, then adds this change to the 'label directory' JSON,stefanzweifel/git-auto-commit-action@v5.0.1
update-label-directory.yml
#6968Additionally, there are Google Apps Scripts/ Worksheets associated with this:
Why did you make the changes (we will use this info to test)?
2 weeks inactive!!!
or💤 2 weeks inactive
or however we want to change the label, however many times.Screenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)
Create label: Log file from personal repo showing label creation
Create label
Edit label: Log file from personal repo showing label editing
Edit label
Delete label: Log file from personal repo showing label deletion
Delete label
Notes to PR Reviewers
You will need to have a functioning test environment on your local repo. If you have not done this yet, see Hack for LA's GitHub Actions to set up, especially Tips 6-8. Tip 8 describes how to copy all of HfLA's labels to your own repo. GHAs are quirky at first so feel free to ask questions.
In addition to the 'files changed' in the PR, there are additional changes that you should make to help with testing:
In the
update-label-directory.yml
file:Note that none of the labels in the
label-directory.json
file will match your repo because the IDs will be a different number. I.e. if you edit yourgood first issue
, the automation will see this as a new label- this is OK.To test this action, you can first create a new label. Go to "Issues" in your repo***, select "New Issue", and choose "Get Started" for any of the templates. Then on the right hand side select the gear icon for "Labels", then select "Edit labels" at the bottom, and finally "New label" to the upper right. Name the issue anything you want, but it might be easier to create a label beginning with an "a", eg.
A new label
or whatever. "Description" and "Color" can be anything you want. Select "Create label" and confirm your label is shown on the "Labels" page.(*** If you don't see "Issues" as a menu option, go to "Settings" and scroll down about halfway. Under "Features", make sure to check the box for "Issues".)
When you see that the label is created:
/_data/label-directory.json
. It should be at the end of the JSON, and it will begin with "NEW" + your title.Repeat the above steps to return to "Edit labels", select your new label, then make some change to the name. Add an emoji if you want. Confirm in that "Actions" has run and that the JSON file was updated.
Finally, repeat the above steps to delete the label, and confirm in "Actions". The JSON file will still list the label, but the labelId will be '9999999999'.
The tie-in can be seen here for Google Apps Script /Worksheet
Please feel free to make suggestions...
Wish List and Outstanding Items:
Completed:
Replace link to Apps Script and fix repoAdd + " (deleted)" to labelName when deletedHave timeline on the "Worksheet: GitHub Label Updates Log" automatically clear after certain number of daysVery important: Since the URL variable in the yml workflow will change every time we need to edit the Google Apps Script: We need the URL to be referenced rather than hard-coded. Should this use a doGet() call?Remove "show context"Should deleted labels be pulled into a separate object?Future (maybe):