Skip to content
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

GitHub Actions: Bot adding and removing "Status: Updated" and "To Update!" label #3341

Closed
5 tasks done
Zak234 opened this issue Jul 9, 2022 · 10 comments · Fixed by #4110
Closed
5 tasks done

GitHub Actions: Bot adding and removing "Status: Updated" and "To Update!" label #3341

Zak234 opened this issue Jul 9, 2022 · 10 comments · Fixed by #4110
Assignees
Labels
automation for manulal github board maintenance actions that are going to be automated Complexity: Large Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly role: back end/devOps Tasks for back-end developers size: 2pt Can be done in 7-12 hours Status: Updated No blockers and update is ready for review

Comments

@Zak234
Copy link
Contributor

Zak234 commented Jul 9, 2022

Overview

There is a bug with the Github bot in which it both adds and removes the "Status: Updated" label. This should be fixed to avoid confusion and to make sure that the proper labels are being applied.

Action Items

  • Please go through the wiki article on Hack for LA's GitHub Actions
  • Review the add-label.js file, to understand how the bot adds and removes labels from the issue.
  • Understand why the Github action bot adds and removes the "Status: Updated" and the "To Update!" label.
  • Change the code logic to fix this error

Checks

  • Test in your local environment that it works

Resources/Instructions

Relevant files:

Relevant Issues:
Status: Updated Bug:

To Update! Bug:

Never done GitHub actions? Start here!

Architecture Notes

The idea behind the refactor is to organize our GitHub Actions so that developers can easily maintain and understand them. Currently, we want our GitHub Actions to be structured like so based on this proposal:

  • Schedules (military time)
    - Schedule Friday 0700
    - Schedule Thursday 1100
    - Schedule Daily 1100
  • Linters
    - Lint SCSS
  • PR Trigger
    - Add Linked Issue Labels to Pull Request
    - Add Pull Request Instructions
  • Issue Trigger
    - Add Missing Labels To Issues
  • WR - PR Trigger
    - WR Add Linked Issue Labels to Pull Request
    - WR Add Pull Request Instructions
  • WR - Issue Trigger

Actions with the same triggers (excluding linters, which will be their own category) will live in the same github action file. Scheduled actions will live in the same file if they trigger on the same schedule (i.e. all files that trigger everyday at 11am will live in one file, while files that trigger on Friday at 7am will be on a separate file).

That said, this structure is not set in stone. If any part of it feels strange, or you have questions, feel free to bring it up with the team so we can evolve this format!

@Zak234 Zak234 added role: back end/devOps Tasks for back-end developers Complexity: Large Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly automation for manulal github board maintenance actions that are going to be automated size: 2pt Can be done in 7-12 hours labels Jul 9, 2022
@github-actions

This comment was marked as resolved.

@Zak234 Zak234 changed the title GitHub Actions: Bot adding and removing "Status: Updated" label GitHub Actions: Bot adding and removing "Status: Updated" and "To Update!" label Jul 13, 2022
@ExperimentsInHonesty ExperimentsInHonesty added this to New Issue Approval in Project Board via automation Sep 11, 2022
@ExperimentsInHonesty ExperimentsInHonesty added the ready for dev lead Issues that tech leads or merge team members need to follow up on label Nov 27, 2022
@ExperimentsInHonesty
Copy link
Member

This issue had not been added to the project board. It got added on Sept 11, but no additional action since then. Please review.

Extra details

@jdingeman jdingeman added Ready for Prioritization ready for product and removed ready for dev lead Issues that tech leads or merge team members need to follow up on labels Jan 22, 2023
@jdingeman
Copy link
Member

Initially thought that there was going to be a conflict between this and the other issue related to added and removed labels, but it looks like they work in different files. Adjusted bullet points for readability. Sending this back to add to the board.

@ExperimentsInHonesty ExperimentsInHonesty moved this from New Issue Approval to Prioritized backlog in Project Board Jan 22, 2023
@bzzz-coding bzzz-coding self-assigned this Feb 7, 2023
@github-actions
Copy link

github-actions bot commented Feb 7, 2023

Hi @bzzz-coding, 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 :)

@bzzz-coding
Copy link
Member

i. Availability: Tuesday and Thursday evenings
ii. ETA: 1/28/23

@bzzz-coding bzzz-coding moved this from Prioritized backlog to In progress (actively working) in Project Board Feb 7, 2023
@github-actions github-actions bot added the Status: Updated No blockers and update is ready for review label Feb 10, 2023
@github-actions github-actions bot added 2 weeks inactive An issue that has not been updated by an assignee for two weeks and removed Status: Updated No blockers and update is ready for review labels Feb 17, 2023
@github-actions

This comment was marked as outdated.

@bzzz-coding
Copy link
Member

bzzz-coding commented Feb 18, 2023

Progress:
I've been trying to understand the logic of adding/removing labels. Judging from the documentation,

  • if there has been a comment by the asignee or if the issue has been crosse-referenced within 3 days, use the 'Status: Updated' label;
  • else if there has been a comment by the asignee or if the issue has been crosse-referenced within 7 days, use the 'To Update!' label;
  • else if there has not been a comment by the asignee or if the issue has been crosse-referenced within 14 days, use the '2 weeks inactive' label;

Blockers:
However, the code seems to have more 'inner logic' that was not mentioned in the documentation, so I would like to get a corner case clarified:

  • if the issue was created within three days, but no comment by asignee or cross-referencing since then, what label should it have?

Lastly,I need help understanding what getTimeline() returns.
In add-label.js, there is a getTimeline() function that I assume is using the GitHub API https://docs.github.com/en/rest/issues/timeline?apiVersion=2022-11-28 and if so, should return an array of objects. However, in function isTimelineOutdated(), I see a for loop like this:
for await (let [index, moment] of timeline.entries()),
which makes me question what timeline's structure is like and how objects are nested and what properties they have.

Availability: Tuesday and Thursday evenings.
ETA: mid to late March, as I also need to figure out the best way to test GHA in my forked repo.

@bzzz-coding bzzz-coding added the Status: Help Wanted Internal assistance is required to make progress label Feb 18, 2023
@jdingeman jdingeman removed the 2 weeks inactive An issue that has not been updated by an assignee for two weeks label Feb 19, 2023
@jdingeman
Copy link
Member

jdingeman commented Feb 19, 2023

Hey @bzzz-coding, to answer your corner case, I don't think the github bot will post anything within three days of assignment and there's not really a label that is needed for it. If someone has self-assigned and they're actively working on it, then we don't necessarily need the issue to have a label on it. The github bot already reminds the assignee to put their ETA and availability after they've assigned it to themselves. If they didn't, I don't think it even checks it. But this might be a good thing to bring up if there is not already a GHA that checks this.

For the question regarding the getTimeline() function, it looks to me like they might be issue events. My guess is that index refers to, evidently, the index of the issue event, and the moment I imagine is the contents of the issue event. The use of .created_at is pointing me to the Response Schema of an HTTP status code 200 shown on that page.

@bzzz-coding bzzz-coding removed the Status: Help Wanted Internal assistance is required to make progress label Feb 22, 2023
@github-actions github-actions bot added Status: Updated No blockers and update is ready for review 2 weeks inactive An issue that has not been updated by an assignee for two weeks and removed Status: Updated No blockers and update is ready for review labels Feb 24, 2023
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

@bzzz-coding

Please add update using the below template (even if you have a pull request). Afterwards, remove the '2 weeks inactive' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the developer meeting discussion column and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel.

You are receiving this comment because your last comment was before Monday, February 27, 2023 at 11:17 PM PST.

@bzzz-coding
Copy link
Member

bzzz-coding commented Mar 4, 2023

Progress: Refactored isTimelineOutdated function and fixed some other inconsistent conditions.
Blockers: Had to infer what GitHub API returns -- need more testing.
Availability: Tuesday and Thursday evening, Saturday 3/4, and Sunday 3/5 in the morning.
ETA: Saturday 3/4/23

@bzzz-coding bzzz-coding removed the 2 weeks inactive An issue that has not been updated by an assignee for two weeks label Mar 4, 2023
@github-actions github-actions bot added the Status: Updated No blockers and update is ready for review label Mar 10, 2023
Project Board automation moved this from In progress (actively working) to QA Mar 18, 2023
@HackforLABot HackforLABot moved this from QA to Done in Project Board Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation for manulal github board maintenance actions that are going to be automated Complexity: Large Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly role: back end/devOps Tasks for back-end developers size: 2pt Can be done in 7-12 hours Status: Updated No blockers and update is ready for review
Projects
Project Board
  
Done
4 participants