-
-
Notifications
You must be signed in to change notification settings - Fork 724
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
base: gh-pages
Are you sure you want to change the base?
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. |
Address CodeQL warning about non-declared "keyName" variable
Change `keyName` to `labelKey`
Update the URL to "SOT"
Update URL for SOT
Add prepend of "NEW-" to new labelKeys
Hello, I am having issues testing. I added the following on: jobs:
` I then created a label but no actions were triggered. if you can further explain more how to test it |
Hi @mSharifHub Thanks for the comment. Were you able to copy the new Project Board? I see that you have a message in the Slack channel asking about an error that occurred while you were setting it up. As long as the column names copy over, you should be OK and we can deal with "PR added to project" workflow omission separately. I am looking at your
Once "Issues" is active, the automation should begin to run at least (and might fail still). Let me know if you get to this point and then we can discuss. Thanks! |
I was trying to review the PR before commenting. I have configured the token. I have created a branch from the review branch and created a label under that branch on git but did see actions being called. |
Fixes #5205
Note: OK to review however: please do not Merge yet
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 staging so that all GHAs can be updatedupdate-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/[email protected]
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 & 7. 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- 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
. If your label starts with an "a", the JSON should be alphabetical.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" and the JSON file.
The tie-in can be seen here for Google Apps Script /Worksheet
Outstanding Items:
Add + " (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?