GHA add comments to prework issue 4820
Fixes #4820
What changes did you make?
-
The following event/activity types are set up to trigger the workflow
- issues:
opened,assigned,unassigned,closed as completed, orclosed as not planned- Updated
issue-trigger.ymlfile with new jobAdd-Comment-To-Prework-Issue
- Updated
- issue_comment:
created- Created
issue-comment-trigger.yamlfile and created new jobAdd-Comment-To-Prework-Issue
- Created
- pull_request:
opened,closed- Updated
pull-request-trigger.yamlfile with new jobAdd-Comment-To-Prework-Issue
- Updated
- pull_request_review:
submitted- Created
pull-request-review-trigger.yamlfile and created new jobAdd-Comment-To-Prework-Issue
- Created
- pull_request_review_comment:
created- Created
pull-request-review-comment-trigger.yamlfile and created new jobAdd-Comment-To-Prework-Issue
- Created
- issues:
-
Created
prework-issue-reusable-workflowfolder ingithub-actions -
Added files to
github-actions/utilsfolder -
Created
prework-issue-comment-reusable-workflow.yamlwith the following steps:- Determine the contributor generating the event/activity:
- Created
get-activity-detail.js
- Created
- Search for an issue with a "prework" label that is assigned to the contributor
- Created
get-prework-issue.jsandget-issue-by-label.js
- Created
- If the prework issue is closed, reopen it
- Created
update-prework-issue-status.jsandreopen-issue.js
- Created
- If the above issue is reopened, move it in the "In Progress" column
- Created
update-issue-project-card.js
- Created
- Add a comment to the prework issue describing the event/activity
- Created
add-prework-issue-comment.js
- Created
- Determine the contributor generating the event/activity:
Why did you make the changes (we will use this info to test)?
- To create a GitHub Action that will be triggered by GitHub issue, issue_comment, pull_request, pull_request_review and pull_request_review_comment events and will post comments to the developer's pre-work issue describing the developer's activities.
Notes
- Folder structure
- I tried to follow the HFLA Github Actions guide with creating the new folders
- The new triggers call a Reusable Workflow, all jobs to accomplish the required work are in this workflow.
- The files required by the
prework-issue-comment-reusable-workflow.yamlare located in thegithub-actions/prework-issue-reusable-workflowfolder
- For testing purposes, I added
permissions: issues: writebut I believe this is not required in this repo. I can remove once tested by the reviewer. - HFLA Project Board (number: 7) - In Progress Column value is hard coded.
- I decided to provide the ProjectCardId rather than use an additional step to query the API.
- For testing, you will need to update the ProjectCardId to your local project board and use the below query to fetch from the GraphQL API.
query{
repository(owner: "hackforla", name: "website") {
projects(first: 10) {
nodes {
name
number
id
columns(first: 10) {
__typename
nodes {
name
id
}
}
}
}
}
}
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.
git checkout -b partapparam-gha-add-comments-4820 gh-pages
git pull https://github.com/partapparam/website.git gha-add-comments-4820
Hey @marioantonini, when you have a moment please add your ETA and availability. Thanks!
Hey @marioantonini @jphamtv any update on this PR? I'm hoping to get some feedback and close it so I can work on more issues. Thank you!
@partapparam @jphamtv Totally missed this, will get to it today.
From our previous conversation on Slack: You might have seen the Sunset Notice on the Project Board. GitHub is discontinuing Projects (classic) and before August Hack for LA needs to migrate to the Projects Beta. After talking with Bonnie and the team, doing some testing, and checking the calendar, we have decided that the Website is going to migrate to the new Projects Beta on Monday, June 24th.
Sorry for the short notice- this is happening very quickly. Each of you have currently submitted a PR that involves GitHub Actions and wanted to let you know that we will need to hold off merging any new GHAs until after the migration. To make this interesting, also need to let you know that after migration, any of the existing API calls using a ‘column’ reference will no longer work because Projects Beta is not structured the same- the new term is ‘status’ and it is not interchangeable. Some other REST API endpoints that will be deprecated soon are here.
So for all of you, after migration your workflows will need to be tested using Projects Beta. If you already installed Projects (classic) on your repo you can migrate to Projects Beta for early testing. (FYI after migrating you can reopen Projects (classic)- but do that immediately if you want to keep it because that option disappeared for me after a day.)
For any workflows that currently involve moving an issue to or from a ‘column’, this should be doable using GraphQL, ProjectV2, and Status. (I have not done this yet- still learning!) And/or we can discuss other options.
Finally, one last thing I notice is that for all of you there are parts of your issue that overlap with the other two’s issues. As one example, all three of your issues include posting messages to a member’s “Pre-work Checklist”. Unfortunately, this should have been caught earlier so that each issue was worked on after the other was completed, so that you would not each have a different solution to the same problem. (I could also be wrong and maybe there will not be any conflicts.)
From 6/24 Slack Hey everyone- we have migrated to Projects Beta. As I mentioned before we made revisions to all workflows that previously involved 'columns' including removing all workflow jobs that used the alex-page automation since these no longer work. "Issue Trigger", "Pull Request Trigger", and "Schedule-Friday" plus related js files had the biggest changes.
Hey @partapparam I know you have put a lot of work into this, and after we went through the projects migration much has changed. Were you planning to work on this again? Is there anything we should talk about/ discuss? Please let me know - thanks!
Hey @t-will-gillis, this slipped my radar. I'll review and push the updates this week. Thanks!
@partapparam - Please add your availability and ETA to make the requested changes. Thanks!
Availability and ETA: Sunday, 9/15, 3-9 pm. ETA 9/22. Having some issues with this. I'll try and commit some updates to this on Sunday to get feedback.
Hey @partapparam, could you provide an updated ETA and your availability for this PR? If you need assistance, please add a comment with the 'Status: Help Wanted' label or reach out to the team on Slack. Thanks!
Param has unassigned themselves from the issue related to this PR. See https://github.com/hackforla/website/issues/4820#issuecomment-2381887331
@partapparam Thank you for the work that you put into this!