-
-
Notifications
You must be signed in to change notification settings - Fork 785
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
Check Developer's Complexity Allowance for Issue Assignments #6853
Check Developer's Complexity Allowance for Issue Assignments #6853
Conversation
- Refactor makeComment function - Add check complexity eligibility condition
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.
|
Hey @jphamtv You had put a ton of work into this before the projects migration fracked up everything... Were you planning to give this another go? |
Hi @t-will-gillis, thanks for checking in. Yes, I'll update and test later this week. I'll message you when it's ready for your review. |
Hey @t-will-gillis, I've updated and tested the code on my repo. It's now compatible with the new Projects V2 board and includes updates such as skipping the eligibility check for Admin or Merge team members. I've also revised the testing instructions, with specific changes to Step 8. Please let me know if you need clarification or have questions. |
Hey @jphamtv - whew, just like before this is a ton of work and the project migration did not help so thanks once again for tackling this. I am still reviewing but here are prelim comments. I have it running in my repo but still need to try a couple different scenarios to trigger the comments. This is going to be very annoying so I will apologize in advance. We have had a string of PRs that have similar functions, for example retrieving issue data and changing the issue’s status. These are pulled out into
To let you know, that is good info in your description and I edited the Hack for LA’s GitHub Actions (current revision) document to include your code for copying all of HfLA’s labels at once to one’s repo and for generating issues- new Tip 8. |
Hey @t-will-gillis,
Thanks for pointing out the new utils. I somehow missed them when updating the code after the migration. I've refactored
I appreciate you letting me know that
The Skills Issue will also work if it continues using the
Thank you for the feedback on my description, including my code in the wiki, and the recognition! I updated step 8 in the testing instructions above. Please let me know if you need anything else for this PR or if we need to discuss how to handle the |
Hey @jphamtv I have been testing this and wanted to give you an update. It took a lot of tweaking to get the conditions set up where the other conditions were not triggered first, but now have it so that the
So one or more of the issues in my repo (or possibly a PR?) is returning null values. Link here But I have not been able to track it down yet. I don’t know if this is a problem with the issues in my repo alone, or if something similar would occur in the live repo. If you have any good ideas, please let me know. Otherwise, it will take me a while to track down. |
@t-will-gillis - You might be getting the error because you have three Prework checklists assigned to yourself on your repo. Try assigning only one and see if you still get the error. |
@jphamtv Closed two of the three preworks (thank you), still had the issue. Did a little more digging and found that three of my very early issues were returning "null" on "assignee.id" even though of course I was assigned (under "assignees"). Whatefs I removed those three issues and the previous error is no longer happening. will continue... |
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.
Hey @jphamtv I was able to run a successful demo in my repo for the situation a.) not checking if admin or merge, b.) previously assigned closed issue Complexity: Small
with role: back end/devOps
, c.) attempting to open a second issue matching the same size and role of closed issue. Result was that the issue was unassigned, moved to “New Issue Approval”, labeled Ready for Prioritization
, and commented on with the specified comment. Furthermore, the “Skills Issue” was reopened and the same comment applied.
I also tried opening a good first issue
with two closed good first issue
s and got the same result. (I did not check the condition for role: back end/devOps
and role: front end
at the same time.)
Fantastic work on this- especially with all of the moving parts. Thanks for incorporating the modules, providing the code snippets, and for addressing the Projects migration and previous comments.
Fixes #4442
What changes did you make?
github-actions/trigger-issue/add-preliminary-comment/developer-complexity-reminder.md
github-actions/trigger-issue/add-preliminary-comment/check-complexity-eligibility.js
and created script that checks for complexity allowance and handles actions if issue exceeds complexity allowancegithub-actions/trigger-issue/preliminary-update-comment.js
file:checkComplexityEligibility
function moduleWhy did you make the changes (we will use this info to test)?
Information For Testing
Create a copy of the Project Board by following the directions outlined in Tip 6: Creating your own Project Board.
Create a personal access token that will allow the automation to work on your duplicated project board by following the directions outlined in Tip 7: Using Personal Access Tokens to test in your own Project Board.
Copy Hack for LA's website repo labels into your repo using GH CLI. This command will clone the labels from the source repository to your own repository. Install the tool, login, then use this command (replace "your-username/your-repo" with your repo's information):
To quickly create test issues on your repository's project board, use the GitHub CLI and run the script provided in this repository: https://github.com/jphamtv/create-issues-script
Follow the instructions in the script's README file to set it up and execute it.
Please note that the script skips checking for complexity when the creator of an issue assigns themselves to that issue. To properly test the complexity eligibility checks, you'll need to create a separate GitHub test account.
Use the test account to self-assign the Pre-work Checklist (Skills Issue) and other issues created by the script. This will ensure that the complexity eligibility checks are triggered correctly.
Update the secret token in
Ask-For-Preliminary-update
job in thegithub/workflows/issue-trigger.yml
fileIn
github-actions/utils/mutate-issue-status.js
file, change the ID numbers inWEBSITE_PROJECT_ID
andSTATUS_FIELD_ID
constants to match your repo Project Board's IDs. Ingithub-action/utils/_data/status-field-ids.js
file, change the ID values instatusValues
forNew_Issue_Approval
andIn_Progress
to match your repo Project Board's IDs. You can get your Project Board's info from the GitHub GraphQL Explorer using the following query:In
github-actions/trigger-issue/preliminary-update-comment.js
file, add the following to the top ofmemberOfAdminOrMergeTeam
function to mock the member status. Replace your_username and your_repository_name with your own information:In your fork of the website repository, go to "Settings" and change the default branch from gh-pages to this PR's branch.
Self-assign the Pre-work Checklist (Skills Issue) with your test account and then close the issue. It should automatically move to the QA column. This is to make sure it gets moved to the In Progress column after the script re-opens it.
Move issues to the Prioritized Backlog and self-assign issues to test the criteria described in the "Your script should check the following" Action Item.