website
website copied to clipboard
GitHub Actions: Automate In Progress Issue Updates: Hide Old Comments
Dependency
- #2032
Overview
As developers, we will update the GitHub action job "Add-Update-Label-to-Issues-Weekly" so that duplicate or outdated "update" comments are hidden, in order to improve the readability of the issue history.
Details
If a bot "update" comment is older than commentByDays (currently 7), it is either going to be duplicated with another "update" comment (if it is more recent than an assignee comment) or it is outdated (because a more recent assignee comment exists). In either case the old bot "update" comment should be hidden.
Action Items
- [x] The job "Add-Update-Label-to-Issues-Weekly" is part of the workflow
schedule-fri-0700.ymland the script can be found in add-label.js. Understand the code, in particular the functionisTimelineOutdatedin which each timeline event (including comments) is examined - [ ] Add code that hides (as "outdated") bot "update" comments older than
commentByDays - [ ] Test using your copy of the Project Board, with your PAT, as described in Tip 6 and 7 of Hack for LA's GitHub Actions
Resources/Instructions
schedule-fri-0700.yml add-label.js Never done GitHub actions? Start here! Hack for LA's GitHub Actions Events that trigger workflows Workflow syntax for GitHub Actions GitHub GraphQL
Moved back into the ice box per this comment
This issue should only hide the duplicate bot messages, not all old bot messages.
@ExperimentsInHonesty please clairfy, is the intention to hide all old comments or just old bot comments?
@roslynwythe
I think the issue should be rewritten to just hide old, duplicate bot messages (e.g., hide multiple please update comments).
Here is my reasoning.
- The above can and should be easily hidden.
- Any comments that are manual, need to be reviewed manually to see if they are still relevant. Because we have no guarantee that the person who made the comment updated the top part, so the comment might still be needed.
@ExperimentsInHonesty if we want to avoid having multiple update comments, perhaps we should consider adding logic to the Add-Update-Label-to-Issues-Weekly job to prevent the addition of duplicate comments.
@ExperimentsInHonesty I revised the issue completely, with the strategy of deleting any bot "update" comment that is older than commentByDays (currently 7), as described in the Details section above.
Also from examining [add-label.js](https://github.com/hackforla/website/blob/gh-pages/github-actions/trigger-schedule/add-update-label-weekly/add-label.js I noticed that regardless of the date of the last assignee comment or assignment, the last line of the "update" comment is always "You are receiving this comment because your last comment was before ${cutoffTime} PST." where cutoffTime is 3 days prior to the date the comment was created. That doesn't seem ideal; I suggest that we either change that to 7 days prior to the current date or else do some additional coding to provide the actual date of the last comment.
Hi @Chrisklangley, thank you for taking up this issue! Hfla appreciates you :)
Do let fellow developers know about your:- i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?) ii. ETA: (When do you expect this issue to be completed?)
You're awesome!
P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)
Hi @iancooperman, thank you for taking up this issue! Hfla appreciates you :)
Do let fellow developers know about your:- i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?) ii. ETA: (When do you expect this issue to be completed?)
You're awesome!
P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)
- Availability - Thurs 2/29 5pm-9pm, Fri 3/1 5pm-9pm, Sat 3/2 N/A, Sun 3/3 1pm-8pm, Mon 3/4 5pm-9pm, Tues 3/5 5pm-9pm
- ETA - Tues 3/5
Progress: Testing environment for GitHub Actions is largely set up. See blockers. No progress on actual issue yet. Blockers: Setting up a good testing environment for the website's GitHub Actions has taken a lot longer than I thought it would. There were/are many unanticipated moving parts that need to be nailed down (e.g. Project Board column_id secret, lack of labels resulting in script errors) Availability: Tues-Fri - 5pm to 9pm ETA: Thurs, 3/7 EoD
Progress: I've written some code within isTimelineOutdated to retrieve the IDs of examined comments older than commentByDays in the hopes of then being able to hide them.
Blockers: After doing some research on the GitHub REST API/Octocat, I'm not sure if programmatically marking comments as outdated is possible.
Availability: Fri - 5pm to 9pm, Sat - 10am to 9pm
ETA: Sat, 3/9 EoD
Progress: No progress within the last few days. Brought up my blocker at the Tuesday dev meeting and am awaiting help from higher up:
Availability for the rest of this week: Wed - 7pm to 9pm, Thurs - N/A, Fri - 5pm to 9pm, Sat - 3pm to 9pm
@iancooperman One option might be to use the GitHub GraphQL API method https://docs.github.com/en/graphql/reference/mutations#minimizecomment instead of the GitHub REST API. Another option might be to delete the comments using the GitHub REST API, but I would have to discuss this with the PM/lead group before making that change and I'm not sure when we will meet, because Bonnie is traveling.
@iancooperman I asked our GHA expert @t-will-gillis about using GitHub GraphQL API method. We are not aware of any use of the GitHub GraphQL API in the HfLA codebase, but we are both eager to explore its use. Therefore I've increased this issue to Complexity: Large and would like to have you try to use the method linked in my previous comment. If that doesn't work out we can explore other options. Thank you for your work on this issue!
Availability: Sat 3/16 - 5pm to 9pm, Sun 3/17 - 10am to 8pm, Mon 3/18 to Fri 3/22 - 5pm to 9pm ETA: Thurs, 3/21 EoD
Progress: I'm getting familiar with GitHub's GraphQL API and GraphQL in general, and I have a plan for how to access it from within the code. Blockers: Other personal obligations have unfortunately caused me to be less available this week than I thought I'd be. However, I don't currently see this continuing in the near future. Availability: Fri - 5pm to 9pm, Sat - 10am to 9pm, Sun - 5pm to 9pm, Mon - 4pm to 8pm, Tues - 4pm to 8pm ETA: Tues, 3/26 EoD
Hey @iancooperman as Roslyn mentioned, I have not used GraphQL yet but it is something I want to know more about. If you are interested, I would be happy to work with you to figure it out- let me know
@t-will-gillis @iancooperman I have some familiarity with GraphQL, if we can find a time to meet during the week I'd be happy to knowledge share what I remember.
Progress: My code effectively minimizes outdated comments in the test issue I created for my website fork. Now, I just need to tweak some values for use in the actual website repository. On a side note, the lack of specificity in the minimization reason appears to be a bug in the GraphQL API.
ETA: Fri 3/29 EoD Availability: Wed 3/27 - 4pm to 8pm, Thurs 3/28 - 4pm to 5pm, Fri 3/29 - 4pm to 8pm
@djbradleyii Thanks for offering to help. I'll let you know if any more GraphQL-related blockers happen to come up.