website icon indicating copy to clipboard operation
website copied to clipboard

GHA add comments to prework issue 4820

Open partapparam opened this issue 1 year ago • 6 comments

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, or closed as not planned
      • Updated issue-trigger.yml file with new job Add-Comment-To-Prework-Issue
    • issue_comment: created
      • Created issue-comment-trigger.yaml file and created new job Add-Comment-To-Prework-Issue
    • pull_request: opened, closed
      • Updated pull-request-trigger.yaml file with new job Add-Comment-To-Prework-Issue
    • pull_request_review: submitted
      • Created pull-request-review-trigger.yaml file and created new job Add-Comment-To-Prework-Issue
    • pull_request_review_comment: created
      • Created pull-request-review-comment-trigger.yaml file and created new job Add-Comment-To-Prework-Issue
  • Created prework-issue-reusable-workflow folder in github-actions

  • Added files to github-actions/utils folder

  • Created prework-issue-comment-reusable-workflow.yaml with the following steps:

    • Determine the contributor generating the event/activity:
      • Created get-activity-detail.js
    • Search for an issue with a "prework" label that is assigned to the contributor
      • Created get-prework-issue.js and get-issue-by-label.js
    • If the prework issue is closed, reopen it
      • Created update-prework-issue-status.js and reopen-issue.js
    • If the above issue is reopened, move it in the "In Progress" column
      • Created update-issue-project-card.js
    • Add a comment to the prework issue describing the event/activity
      • Created add-prework-issue-comment.js

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.yaml are located in the github-actions/prework-issue-reusable-workflow folder
  • For testing purposes, I added permissions: issues: write but 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
           }
         }
       }
     }
   }
 }

partapparam avatar May 21 '24 18:05 partapparam

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

github-actions[bot] avatar May 21 '24 18:05 github-actions[bot]

Hey @marioantonini, when you have a moment please add your ETA and availability. Thanks!

jphamtv avatar May 30 '24 18:05 jphamtv

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 avatar Jun 10 '24 19:06 partapparam

@partapparam @jphamtv Totally missed this, will get to it today.

marioantonini avatar Jun 10 '24 19:06 marioantonini

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.)

t-will-gillis avatar Jul 02 '24 04:07 t-will-gillis

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.

t-will-gillis avatar Jul 02 '24 05:07 t-will-gillis

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!

t-will-gillis avatar Aug 18 '24 03:08 t-will-gillis

Hey @t-will-gillis, this slipped my radar. I'll review and push the updates this week. Thanks!

partapparam avatar Aug 19 '24 01:08 partapparam

@partapparam - Please add your availability and ETA to make the requested changes. Thanks!

Thinking-Panda avatar Sep 11 '24 02:09 Thinking-Panda

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.

partapparam avatar Sep 12 '24 00:09 partapparam

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!

jphamtv avatar Oct 03 '24 23:10 jphamtv

Param has unassigned themselves from the issue related to this PR. See https://github.com/hackforla/website/issues/4820#issuecomment-2381887331

JessicaLucindaCheng avatar Oct 07 '24 22:10 JessicaLucindaCheng

@partapparam Thank you for the work that you put into this!

t-will-gillis avatar Oct 10 '24 02:10 t-will-gillis