website icon indicating copy to clipboard operation
website copied to clipboard

GitHub Actions: Automate In Progress Issue Updates: Hide Old Comments

Open Aveline-art opened this issue 4 years ago • 13 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.yml and the script can be found in add-label.js. Understand the code, in particular the functionisTimelineOutdated in 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

Aveline-art avatar Jul 19 '21 21:07 Aveline-art

Moved back into the ice box per this comment

Aveline-art avatar Jul 25 '21 20:07 Aveline-art

This issue should only hide the duplicate bot messages, not all old bot messages.

ExperimentsInHonesty avatar Mar 05 '23 21:03 ExperimentsInHonesty

@ExperimentsInHonesty please clairfy, is the intention to hide all old comments or just old bot comments?

roslynwythe avatar Oct 15 '23 06:10 roslynwythe

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

  1. The above can and should be easily hidden.
  2. 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 avatar Nov 08 '23 00:11 ExperimentsInHonesty

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

roslynwythe avatar Nov 12 '23 10:11 roslynwythe

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

roslynwythe avatar Dec 10 '23 10:12 roslynwythe

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

github-actions[bot] avatar Jan 30 '24 21:01 github-actions[bot]

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

github-actions[bot] avatar Feb 29 '24 02:02 github-actions[bot]

  1. 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
  2. ETA - Tues 3/5

iancooperman avatar Feb 29 '24 02:02 iancooperman

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

iancooperman avatar Mar 05 '24 04:03 iancooperman

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

iancooperman avatar Mar 08 '24 04:03 iancooperman

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 avatar Mar 13 '24 02:03 iancooperman

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

roslynwythe avatar Mar 14 '24 06:03 roslynwythe

@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!

roslynwythe avatar Mar 15 '24 00:03 roslynwythe

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

iancooperman avatar Mar 16 '24 05:03 iancooperman

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

iancooperman avatar Mar 22 '24 04:03 iancooperman

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 avatar Mar 24 '24 17:03 t-will-gillis

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

djbradleyii avatar Mar 25 '24 17:03 djbradleyii

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

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.

iancooperman avatar Mar 27 '24 03:03 iancooperman