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

Maintenance and adjustment to "Schedule Monthly" workflow #7638

Merged

Conversation

t-will-gillis
Copy link
Member

@t-will-gillis t-will-gillis commented Oct 26, 2024

Fixes #7614

What changes did you make?

  • main edit 1: made edits to get-contributors-data.js so that in the month after HfLA's break, the oneMonthAgo variable remains at one month and is not adjusted for the time on break. Note the twoMonthsAgo does still account for the break month
  • main edit 2: made edits to several files in workflow to shift focus to the new title of the "Skills Issue", but continue with the legacy "Pre-work checklist" also
  • main edit 3: UPDATED 10/28/24: made edits to workflow to only count the created_at date of the member's comment, and exclude updated_at date which is typically when a comment is hidden and is typically not performed by the member
  • refactored trim-inactive-members.js because the variable currentTeamMembers is currently defined/ calculated in two places, unnecessarily. Also, streamlined the console.log() for creating separation lines

Why did you make the changes (we will use this info to test)?

  • for main edit 1, members that should be removed were retained for too long
  • for main edit 2, needed this change so that the workflow accounts for the new template "Skills Issue"
  • for main edit 3, UPDATED 10/28/24 made this change so that comments are considered based on created_at date rather than updated_at date
  • for last edits, done to remove unneeded code/ clean up

Screenshots of Proposed Changes To The Website (if any, please do not include screenshots of code changes)

  • No visual changes to website

Notes for PR reviewers

  • This PR does not require you to test the workflow, but if you would like to do so see the "Test Procedure" in the Wiki for "Schedule Monthly"

UPDATED 10/28/24:

Adjustments made to `oneMonthAgo` for Feb and Aug runs, also add "Skills Issue"
Change "Pre-work checklist" --> "Skills Issue"
Change "Pre-work Checklist" --> "Skills Issue", add REST API ref comments, remove excess calc for `currentTeamMembers`
Changing comment "Pre-work Checklist" --> "Skills Issue"
Copy link

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 t-will-gillis-maint-adj-sch-monthly-7614 gh-pages
git pull https://github.com/t-will-gillis/website.git maint-adj-sch-monthly-7614

@github-actions github-actions bot added role: back end/devOps Tasks for back-end developers Complexity: Small Take this type of issues after the successful merge of your second good first issue Feature: Refactor GHA Refactoring GitHub actions to fit latest architectural norms size: 3pt Can be done in 13-18 hours labels Oct 26, 2024
@t-will-gillis t-will-gillis added Complexity: Medium and removed Complexity: Small Take this type of issues after the successful merge of your second good first issue labels Oct 26, 2024
@codyyjxn codyyjxn self-requested a review October 26, 2024 22:56
codyyjxn
codyyjxn previously approved these changes Oct 26, 2024
Copy link
Member

@codyyjxn codyyjxn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @t-will-gillis this looks great!

  • The branch name is correctly
  • The issue is linked as well
  • The console.logs are changed to displayed correctly

This was done very well , great job!

@santisecco santisecco self-requested a review October 27, 2024 20:37
@santisecco
Copy link
Member

santisecco commented Oct 27, 2024

Note edit 10-28-24 - I realized the complexity is greater than I thought at first only looking at the "medium" label.
Review ETA: 2 PM 11/1/24
Availability: 12-3 PM Monday-Friday

Added third main update to consider comments if the `created_at` date is recent (in order to avoid a minimizing of a comment being considered as an update)
@t-will-gillis
Copy link
Member Author

t-will-gillis commented Oct 28, 2024

Hi @codyyjxn FYI There is a last minute addition (noted by UPDATED 10/28/24 in the description above)- this happens at lines 108-109 in the get-contributors-data.js. It is to cover a specific edge case that I found when checking something for Bonnie: when a user's comment gets minimized, the bot thinks that the comment is updated and the workflow counts this as member activity even though it is not. the edits ensure that only the initial user creation is counted.

Copy link
Member

@santisecco santisecco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Will thanks for working on this. I'm looking at the updates. All the changes look great. I noted down some stuff regarding how the workflow works.
The changes are great so I'll go ahead and approve them but still I had some questions regarding how the code works not the changes. The annotations made it very clear by the way but I want to be sure I understood it.
Feel free to correct any of the comments bellow.

Noted the change in variable twoMonthsAgo for the months of September and February. Following the fact December and July are breaks. The refactoring of console.log() look is better.

Then I also saw the fact we needed to update the code for the new skills issue. That's the reason for the update from "Pre-work" to "Skills issue". Still the code works for "Pre-work checklist".

Looking into the way the code functions. We first get the data of the contributor's activity with get-contributors-data.js and then we use that data to remove or notify inactive members using trim-inactive-member.js

The APIs return different values. We perform different checks to add the contributor to allContributorsSince.

I still have to look at trim-inactive-member.js in more detail. So the following might be answered there:
I have a question regarding the checks in ´get-contributors-data.js. The "else/if" statements in the fetchContributors function.
If a user appears as contributorInfo.author or contributorInfo.user then can their work be outdated? If so how is that checked?
I guess for both of them that is checked since the API call is since at maximum 2 months ago. For contributorInfo.user we check for contributorInfo.created_at > date so we are ok there.

@t-will-gillis
Copy link
Member Author

t-will-gillis commented Nov 2, 2024

Hey @santisecco thanks for the review and comments. For your question:

I still have to look at trim-inactive-member.js in more detail. So the following might be answered there:
I have a question regarding the checks in get-contributors-data.js. The "else/if" statements in the fetchContributors function.
If a user appears as contributorInfo.author or contributorInfo.user then can their work be outdated? If so how is that checked?
I guess for both of them that is checked since the API call is since at maximum 2 months ago. For contributorInfo.user we check for contributorInfo.created_at > date so we are ok there.

The fetchContributors() function is a little bit difficult so to try to simplify: The goal is to see which members have contributed within either the last one month and or the last two months and compare this to the team list. But we can't really see what each individual is doing so instead we accumulate all commit, comment, and assignee activity at two months and at one month for the HfLA organization (this is the since: date part of the API request). fetchContributors() is extracting the user names from all of this data across the organization. trimContributors() then is taking the list of current team members and for each person checking if their name is on the list of contributing anything no more than two months ago. If the team member's name was not seen, the member is removed. After this first run through, we generate an updated member list and repeat to see whether the remaining team members have had activity in the last month. If not, these members are notified b/c their activity is between one and two months old.

To your question then, if an author or a user (or an assignee) name appears on the list, it is because they had activity since the date (one month or two months ago).

I don't know if that helped or not- hope it did. Let me know if you have questions or want to talk about anything else

@t-will-gillis
Copy link
Member Author

Hey @codyyjxn I am merging this since you Approved this previously

@t-will-gillis t-will-gillis merged commit 7fd360d into hackforla:gh-pages Nov 2, 2024
3 checks passed
@t-will-gillis t-will-gillis deleted the maint-adj-sch-monthly-7614 branch November 2, 2024 22:32
@santisecco
Copy link
Member

santisecco commented Nov 3, 2024

Thanks @t-will-gillis I'll look at it in more detail and ask you for anything else 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Medium Feature: Refactor GHA Refactoring GitHub actions to fit latest architectural norms role: back end/devOps Tasks for back-end developers size: 3pt Can be done in 13-18 hours
Projects
Development

Successfully merging this pull request may close these issues.

Maintenance and adjustments to "Schedule Monthly" workflow
3 participants