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

Fix bug that prevents GHA "Schedule Monthly" from running #4788

Closed
10 tasks done
t-will-gillis opened this issue Jun 6, 2023 · 12 comments · Fixed by #5467 or #5967
Closed
10 tasks done

Fix bug that prevents GHA "Schedule Monthly" from running #4788

t-will-gillis opened this issue Jun 6, 2023 · 12 comments · Fixed by #5467 or #5967
Assignees
Labels
Bug Something isn't working Complexity: Extra Large Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly Feature: Refactor GHA Refactoring GitHub actions to fit latest architectural norms role: back end/devOps Tasks for back-end developers size: 8pt Can be done in 31-48 hours time sensitive Needs to be worked on by a particular timeframe

Comments

@t-will-gillis
Copy link
Member

t-will-gillis commented Jun 6, 2023

Prerequisites

  1. Be a member of Hack for LA. If you have not joined yet, please follow the steps on our Getting Started page and attend an onboarding session.
  2. Before you claim or start working on an issue, please make sure you have read our How to Contribute to Hack for LA Guide.

Overview

We need our GitHub Actions to run as expected on the schedule that we have set so that our workflow is not interrupted. The GHA "Schedule Monthly" has failed on the last two scheduled runs and the error needs to be addressed.

Details

When reviewing HfLA "Actions" logs on the repo, it can be seen that the GHA "Schedule Monthly" has attempted to run on schedule on the 1st of the month for the last three months. Both attempts have failed on the the job list-inactive-members on the step Get List.
A successful run of this GHA will result in an issue being generated on the HfLA Project Board similar to the following, as well as a notification comment being added to issue #2607.

Action Items

Suggested steps:

  • Compare the Action logs for the failed GHA on the HfLA repo with the similar logs on the personal repos for hints as to what might be causing the error(s).
  • Refactor the schedule-monthly-PREV.yml and js files and/or any other files or settings (such as the tokens) as needed. >NOTE: the file will be renamed schedule-monthly-PREV.yml after Fix bug that prevents GHA "Schedule Thursday 1100" from running #4768 is merged.
  • Create a demo Project Board and Personal Access Token for your repo- see HfLAs GitHub Actions doc esp. Tips 6 and 7.
    • Important note: be sure to give your secret token a different name than HfLA's token.
  • Create at least one new issue on your Project Board and remember the number.
  • Given the different behavior of the GHA running on a personal repo versus the HfLA repo, add a workflow_dispatch: to Line 6 of the schedule-monthly.yml so that the action can be triggered immediately on the live site, i.e.:
on:
  schedule:
    - cron: "0 8 1 * *"
  workflow_dispatch:
  • Done On_ the yml file, change line 11 - uses: actions/checkout@v2 to - uses: actions/checkout@v3 per Bump actions/checkout from 2 to 3 #4735
  • On the three js files, for testing only change any lines referring to const owner = "hackforla" to your own repo. (You will revert this before you open the PR.)
  • In comment-issue.js change let agendaAndNotesIssueNumber = 2607; to reference the issue you created. (You will revert this before you open the PR.)
  • Confirm with a test on your own repo. A successful test will create the 'Inactive Member' issue in your repo, and add the notification comment to the issue you designated.

Resources/Instructions

@t-will-gillis t-will-gillis added Bug Something isn't working role: back end/devOps Tasks for back-end developers Complexity: Large Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly Ready for Prioritization Feature: Refactor GHA Refactoring GitHub actions to fit latest architectural norms size: 3pt Can be done in 13-18 hours labels Jun 6, 2023
@ExperimentsInHonesty ExperimentsInHonesty added time sensitive Needs to be worked on by a particular timeframe and removed Ready for Prioritization labels Jun 11, 2023
@t-will-gillis t-will-gillis added the Draft Issue is still in the process of being created label Jul 3, 2023
@t-will-gillis

This comment was marked as outdated.

@t-will-gillis t-will-gillis added Bug Something isn't working and removed Bug Something isn't working Draft Issue is still in the process of being created labels Jul 5, 2023
@t-will-gillis t-will-gillis added the Draft Issue is still in the process of being created label Jul 23, 2023
@t-will-gillis t-will-gillis self-assigned this Sep 5, 2023
@github-actions

This comment was marked as resolved.

@t-will-gillis

This comment was marked as resolved.

@t-will-gillis
Copy link
Member Author

Progress: the planned features are mostly complete. Having a hang up with accessing an artifact that I want to transfer between GitHub Action jobs. The artifact is successfully uploaded via actions/upload-artifact@v3and I can confirm that it has the expected content. The following job is able to download the artifact via actions/download-artifact@v3 and returns a successful message. But I am thus far unable to access and therefore use the data.

If I keep the revised GHA as a single job, then we do not need the artifact because the data passes step to step. TBC

@t-will-gillis t-will-gillis added size: 5pt Can be done in 19-30 hours and removed size: 3pt Can be done in 13-18 hours Draft Issue is still in the process of being created labels Sep 7, 2023
@ExperimentsInHonesty
Copy link
Member

ExperimentsInHonesty commented Oct 1, 2023

DRAFT

Review of Inactive Website Team Members

Inactive Members

Developers: If your name is on the following list, our team bot has determined that you have been inactive with the Website team in the last 30 days. If we don't hear back from you in the upcoming weeks, we will unassign you from any issues you may be working on and remove you from the 'website-write' team.

cnk
angieyan
ykim25
vanyanv
ericvennemeyer
Jaretzbalba
matthewmpan
Joyce750526
sijiapitts
RyanGehris
DevRishiJain

Did we make a mistake?

The bot is checking for the following activity:

  • If you are assigned to an issue, that you have provided an update on the issue in the past 30 days. The updates are due weekly.
  • If your issue is a draft (in the new issue approval column) that you are adding to it within the last 30 days.
  • If you are reviewing PRs, that you have done some kind of activity in the past 30 days.

If you have been inactive in the last 30 days (using the above measurement), you can become active again, by doing one of the above actions.

If you were active during the last 30 days (using the above measurement), the bot did make a mistake, let us know, by responding in a comment (reopening this issue) with this message:

I am responding to Issue #[this issue].
The Hack for LA website bot made a mistake, I have been active!  
See my Issue # or PR #  review

After you have left the comment, please send us a Slack message to hfla-site channel with a link to your comment.

Temporary leave

If you have taken a temporary leave, and you have been authorized to keep your assignment to an issue.

  • Your issue is in the "Questions / Review" column, with the Ready for Dev Lead label and a note letting us know when you will be back. We generally try to encourage you to unassign yourself from the issue and allow us to return it to the prioritized backlog. However, exceptions are sometimes made.

Removed Members

Our team bot has determined that the following member(s) have not been active with the Website team for over 60 days, and therefore the member(s) have been removed from the 'website-write' team.

cnk

If this is a mistake or if you would like to return to the Hack for LA Website team, please respond in a comment with this message:

I am responding to Issue #[this issue].
I want to come back to the team!
Please add me back to the write team, I am ready to work on an issue now.

After you have left the comment, please send us a Slack message to hfla-site channel with a link to your comment.

@ExperimentsInHonesty
Copy link
Member

ExperimentsInHonesty commented Oct 1, 2023

@t-will-gillis I left a revised language that should be used in the issue (in the comment above). You will notice that

  • I didn't put the @ symbol in front of their names. You can't do that until we go live, because otherwise it messages them.
  • I have in the draft a "[this issue]" text. I don't know if it's possible, but if it is, possible to reference the issue number in the draft comment we are giving them, that would be good.

Notes

  • GHA should check all columns except for QA, Done, Questions / Review.
  • When checking PRs that it checks all reviewers activity and submitters activity
  • When checking issues with the DRAFT label, that it checks the Top comment (body) for changes.
  • Role label should be role: dev leads
  • Feature labels should be: feature: Administrative and Feature: Onboarding/Contributing
  • Can we add a milestone to the issue automatically (Team workflow)?
  • Can we add it to the project board automatically?
  • Can we close this issue as soon as it's created?
  • Please specify work flow when the user writes back to us. What we have to do at each juncture
    • When the bot makes a mistake on 30 inactive
    • When someone wants to come back after the 60 day removal

@t-will-gillis
Copy link
Member Author

t-will-gillis commented Oct 22, 2023

@ExperimentsInHonesty Please cross reference my repo's issue 359

@t-will-gillis I left a revised language that should be used in the issue (in the comment above). You will notice that

  • I didn't put the @ symbol in front of their names. You can't do that until we go live, because otherwise it messages them.
  • I have in the draft a "[this issue]" text. I don't know if it's possible, but if it is, possible to reference the issue number in the draft comment we are giving them, that would be good.
  • WG: I am leaving a space/ gap between the "@" and the person's name so that the person is not messaged until this goes live.
  • WG: Regarding the "this issue" number: currently, the data for the body of the issue (which includes the line that references "this issue") is being sent to "github.rest.issues.create()" first, and then the issue number is being assigned afterwards. So as written currently, we cant reference the issue number. But there may be one or two things I can try, such as commenting after the issue is created etc. UPDATE: I added a query to return all active issues in the repo, limiting the result to one which returns the last issue created. Then I am adding 1 to get the number of the next issue, i.e. the one about to be generated. Seems to be working!

Notes

  • GHA should check all columns except for QA, Done, Questions / Review.
    • WG: the GHA currently checks for all activity, any column. I think this is a good thing b/c otherwise the GHA might ignore recent contributions to an issue that was very recently closed????
  • When checking PRs that it checks all reviewers activity and submitters activity
    • WG: I ran a test for the previous 12 hours. I believe the GHA is picking up all reviewers and all submitters.
  • When checking issues with the DRAFT label, that it checks the Top comment (body) for changes.
    • WG: I made test comments to this issue to confirm: Currently the action does log that I edited the top comment, as well as edited this comment and added a new comment.
  • Role label should be role: dev leads
    • WG: Done
  • Feature labels should be: feature: Administrative and Feature: Onboarding/Contributing
    • WG: Done
  • Can we add a milestone to the issue automatically (Team workflow)?
    • WG: I have tried to add the milestone previously, but I haven't found a way to do this (yet).
      UPDATE: Woohoo! Yes, after a painful search I figured out the problem: the API wants an integer and not a string, and the correct integer is based on the order of when each workflow was created. The correct integer is 8- b/c coincidentally '.08 Team workflow' was the 8th milestone created.
  • Can we add it to the project board automatically?
    • WG:Yes- it automatically adds issue to the project board
  • Can we close this issue as soon as it's created?
    • WG:I have tried but haven't figured out a way to close the issue while it is being opened this yet.
  • Please specify work flow when the user writes back to us. What we have to do at each juncture
    • When the bot makes a mistake on 30 inactive
    • When someone wants to come back after the 60 day removal
      • WG: If the bot seems to be making more than one or two mistakes, I think at that point if we think it is a problem we would want to take it down to figure out what is going wrong. Otherwise, for the person who wants to come back after 60 days, wouldn't an Admin add them back? Does the person need to be re-onboarded?

WG: For an issue written many months ago that is being worked on now, it appears that the GHA might be including the original author in the group of "active contributors"....

t-will-gillis added a commit to t-will-gillis/website that referenced this issue Oct 22, 2023
t-will-gillis added a commit to t-will-gillis/website that referenced this issue Oct 22, 2023
t-will-gillis added a commit to t-will-gillis/website that referenced this issue Oct 22, 2023
update to template per Bonnie's comments hackforla#4788 (comment)
@roslynwythe

This comment was marked as resolved.

@t-will-gillis

This comment was marked as resolved.

@ExperimentsInHonesty
Copy link
Member

ExperimentsInHonesty commented Nov 14, 2023

  1. Can we close this issue as soon as it's created?
    • WG:I have tried but haven't figured out a way to close the issue while it is being opened this yet.
    • BW: second cron that runs after.
  2. Please specify work flow when the user writes back to us. What we have to do at each juncture
    • We decided (Roslyn, Will, Jessica, Bonnie) that if the text is any of the following it should reopen the issue and puts it in the questions and review column with a ready for dev lead label.
      • "The Hack for LA website bot made a mistake"
      • "I want to come back to the team"
  3. WG: For an issue written many months ago that is being worked on now, it appears that the GHA might be including the original author in the group of "active contributors"....
    • authors of issues should be counted as active if the issue was created within the time window.

@t-will-gillis
Copy link
Member Author

t-will-gillis commented Nov 18, 2023

Hello @ExperimentsInHonesty and @roslynwythe The following are done. We probably should discuss item 2...

Updates:

  1. Created wr-schedule-monthly.yml workflow that is triggered by a successful 'Schedule Monthly' run.

  2. Regarding exploring ways to reopen the issue upon an issue comment, then add label and move it.

    • I have an alternate schedule-monthly-reopen.yaml that depends on the dev commenting and then reopening the issue. Once they reopen the issue, then the issue moves to "Questions / In Review" and the ready for dev lead label is applied. I believe that having the dev select to "Reopen with comment" is preferable since this workflow will only be triggered when an issue is reopened.
    • The workflow that automatically reopens the issue is here: schedule-monthly-reopen.yml using "on: issue_comment":
      • reopens the issue if a comment is added that contains 'bot made a mistake' or 'want to come back',
      • adds the ready for dev lead label
      • moves it into the "Questions / In Review " column.
    • Again, I think the first workflow is preferable because although the latter GHA only runs under the specific condition, it will still be triggered whenever anyone makes any comment on any issue.
  3. Regarding whether activity extends to the authors of issues:

    • UPDATE 11/22/23: I have reworked the API call in contributors-data.js that should only select issue assignees.

    • I tested contributors-data.js checking activity over the past 27 hours- here are two issue-authors with activity:

      • Micah authored issue 5825. Issue 5876 is listed as a dependent, and itself was updated yesterday which registered as an update to the issue body, and credit for activity is given to Micah. I don't see an easy way to separate the activity- the activity itself is not credited to an 'author'. I.e. there does not seem to be a way to distinguish between Micah making an edit, or the bot or someone else making an edit (that I can see).
      • Similar with Justin.
    • This discrepancy is likely due to the choice of api calls on the original contributors-data.js- i.e. these need to be refined so that the original author is not included when someone else updates their issue.

  4. Added (to the Inactive Team Members Issue) a short description of what dev lead needs to do in case someone needs to be added back.

@t-will-gillis t-will-gillis added size: 8pt Can be done in 31-48 hours and removed size: 5pt Can be done in 19-30 hours labels Nov 30, 2023
@t-will-gillis
Copy link
Member Author

@roslynwythe @ExperimentsInHonesty

(from previous comment above)
2. continuing - In the 11/27 Monday meeting, we discussed the scenario where a member who did not have write access would not have permission to use the "Reopen with comment" option, thus this option would not work. We also discussed that the second option for triggering the original issue to reopen using "on: issue_comment" will mean that this GHA will start then stop for every comment made on every issue, and so this also would not work.

The alternate option that I believe will work is to have the member comment on the "Review Inactive Team Members" issue, and then open a new issue from the comment itself. This option works for any member regardless of write status. I was able to confirm this in practice by using the same method to open an issue through a 'dummy' account: #5939

When the member opens a new issue this way, the issue passes through existing GHAs, and with minor edits the GHAs can apply appropriate labels and move the issue to the "Questions / In Review" column.

The details with examples are described in #5467 under the section "11/29/23: Final Addendum".

roslynwythe pushed a commit that referenced this issue Dec 5, 2023
…788 (#5467)

* Update schedule-monthly.yml

Combining functionalities of prev. `schedule-monthly.yml` and `schedule-thu-1100.yml`

* Update contributors-data.js

Consolidate previous `schedule-monthly.yml` and `schedule-thu-1100.yml`

* Update create-new-issue.js

* Update comment-issue.js

Consolidate `schedule-monthly.yml` and `schedule-thu-1100.yml`

* Update create-new-issue.js

Address CodeQL notice

* Delete github-actions/trigger-schedule/list-inactive-members/get-list.js

No longer used

* Delete .github/workflows/schedule-monthly-PREV.yml

Consolidated functionality into revised `schedule-monthly.yml`

* Update create-new-issue.js

changed 'Website' team to 'website-write' team in the paragraph beginning "If this was a mistake..."

* Update create-new-issue.js

Remove `ready for product` label

* Update create-new-issue.js

Comments from Bonnie #4788 (comment)

* Update schedule-monthly.yml

Bump actions/setup-node@v3 --> @v4 per #5769

* Update contributors-data.js

Removing import references to 'true-github-contributors'- this is not actually used in this file.

* Update create-new-issue.js

Changes in response to Bonnnie's comments

* Update create-new-issue.js

Fixed `milestone` to be `8`, which is the HfLA milestone number corresponding to ".08 Team workflow".

Also, minor edits to the formatting of the message.

* Create schedule-monthly-PREV.yml

Fixing merge conflict:  The "to be deleted" file has changed. Adding file back with the changes, then will immediately delete it again.

* Delete .github/workflows/schedule-monthly-PREV.yml

* Create schedule-monthly-PREV.yml

Adding this file back in in order to address the merge conflict. Once this PR is merged, a follow up PR will delete this file.

* Update create-new-issue.js

Added notes to Dev Leads explaining process to reactivate members, and investigate if a bug is noticed

* Update contributors-data.js

Changed so that only issue assignees are returned when querying "/issues".

* Update contributors-data.js

minor tweaks

* Update schedule-monthly.yml

Update actions/github-script@v6 --> v7

* Create wr-schedule-monthly.yml

Workflow run to automatically close the issue created by the 'Schedule Monthly' workflow

* Update create-new-issue.js

* Create schedule-monthly-reopen.yml

* Update schedule-monthly-PREV.yml

updating actions/github-script@v6 --> v7 per #5899

* Update schedule-monthly.yml

Adding check to skip run on January 1st (since December is off for HfLA website)

* Update contributors-data.js

Adding checks to skip the January 1st run, and adjust to 3 months inactive only for the February 1st run

* Update wr-schedule-monthly.yml

Corrected the name of the GH_TOKEN

* Update schedule-monthly-reopen.yml

Corrected name of repo-token

* Update issue-trigger.yml

latest updates for Inactive Members

* Delete .github/workflows/schedule-monthly-reopen.yml

The reopening mechanism will be different; this workflow no longer needed

* Update check-labels.js

latest with new mechanism for inactive members to create issues

* Update create-new-issue.js

new mechanism for inactive members to send message

* Update create-new-issue.js

Demo video slowed down

* Update contributors-data.js

f. ER#4541: add check to see if inactive member on 'website' team prior to removal from 'website-write' team

* Update create-new-issue.js

uploaded new demo gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Complexity: Extra Large Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly Feature: Refactor GHA Refactoring GitHub actions to fit latest architectural norms role: back end/devOps Tasks for back-end developers size: 8pt Can be done in 31-48 hours time sensitive Needs to be worked on by a particular timeframe
Projects
3 participants