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

created a GHA to list inactive members of website-write team #4545

Merged

Conversation

mattmalane
Copy link
Member

Fixes #4158

What changes did you make and why did you make them ?

  • Created a new file schedule-monthly.yml in the .github/workflows directory. This is a new GHA (Github Actions) workflow file containing one job named list-inactive-members that will run on the first on the month at 1 AM Pacific (8AM UTC). The decision was made to run the action on the 1st of every month instead of on the last of the month for every month. Doing so eliminated the need to account for creating cron schedules that run from the 28th - 31th every month and corresponding scripts to check if the current day was actually the last day of the month.

  • The list-inactive-members job created contains three GHA steps that correspond with their respective javascript file located within github-actions/trigger-schedule/list-inactive-members. The three javascript files are outlined below.

  1. github-actions/trigger-schedule/list-inactive-members/get-list.js is a newly created Javascript file that corresponds to the step named Get List located in the .github/workflows/schedule-monthly.yml file. This script calls the Github API in various ways and gets a list of website-write team members who do not have any active issues.

  2. github-actions/trigger-schedule/list-inactive-members/create-new-issue.js is a newly created Javascript file that corresponds to the step named Create New Issue located in the .github/workflows/schedule-monthly.yml file. This script takes the list of nonactive members created from get-list.js and creates a new issue within the hackforla repo that contains the list of nonactive members. The issue is then moved to the project board by creating a new project card linked to this issue. I could not find a way to programmatically move the issue to the project board without specifying a specific column; the issue is moved to the New Issue Approval column without using the existing automation.

  3. github-actions/trigger-schedule/list-inactive-members/comment-issue.js is a newly created Javascript file that corresponds to the step named Comment Issue located in the .github/workflows/schedule-monthly.yml file. This script comments on issue HfLA: Dev/PM Agenda and Notes #2607 so that dev leads and PMs can review the list of non active members during planning.

  • This GHA was tested using my own local project board and token. I am available to help if this action ends up breaking when testing it against the real project board. Let me know if anything is needed!

Screenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)

No visual Changes to the website.

@github-actions
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 mattmalane-gha-list-inactive-members-4158 gh-pages
git pull https://github.com/mattmalane/website.git gha-list-inactive-members-4158

@github-actions github-actions bot added role: back end/devOps Tasks for back-end developers Complexity: Large time sensitive Needs to be worked on by a particular timeframe Status: Updated No blockers and update is ready for review Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly Feature: Refactor GHA Refactoring GitHub actions to fit latest architectural norms size: 5pt Can be done in 19-30 hours labels Apr 18, 2023
@chrismenke45
Copy link
Member

Review ETA: 4/20 EOD
Availability: 8am-12pm M-F

@bootcamp-brian
Copy link
Member

Availability: Weekdays before 5pm
Review ETA: By the end of next week

Copy link
Member

@bootcamp-brian bootcamp-brian left a comment

Choose a reason for hiding this comment

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

@mattmalane First of all, thanks for the thorough documentation of what you worked on. It made the review process much easier.

When I started testing the github actions in my own repo, the blank "id:" on line 39 of the schedule-monthly.yml workflow file was preventing the workflow from running. Once I filled that in though, the actions ran as intended and created the new issue with the list of inactive members, added it to the project board, and linked it in a comment on the issue I designated for testing purposes. Nice job.

Also, I noticed that a "bug" label was added to the issue in addition to the ones requested in the issue which looks to be caused by line 36 in create-new-issue.js. Was that intentional?

Once these two small things are addressed, this should be good to merge from what I can see.
And great work on getting all the main functions of the github actions worked out by the way.

@mattmalane
Copy link
Member Author

@bootcamp-brian Hi Brian, thanks for you review!

I updated this PR with the requested changes.

  • added a value to the id field in the schedule-monthly.yml file

  • removed the "bug" label in create-new-issue.js (wasn't intentional, not sure why I added that haha)

@chrismenke45
Copy link
Member

Updated review ETA: 4/26 12pm

chrismenke45
chrismenke45 previously approved these changes Apr 26, 2023
Copy link
Member

@chrismenke45 chrismenke45 left a comment

Choose a reason for hiding this comment

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

@mattmalane Great job on this issue. It ran and worked on my forked repo. The idea to change the schedule to the first of every month instead of the last of every month was really smart.

.github/workflows/schedule-monthly.yml Outdated Show resolved Hide resolved
@bootcamp-brian
Copy link
Member

@bootcamp-brian Hi Brian, thanks for you review!

I updated this PR with the requested changes.

  • added a value to the id field in the schedule-monthly.yml file
  • removed the "bug" label in create-new-issue.js (wasn't intentional, not sure why I added that haha)

My best guess is maybe it was leftover from some copying/pasting lol.

@bootcamp-brian
Copy link
Member

@mattmalane Thanks for making the changes I requested. I did notice one more odd thing after Chris mentioned something to me. The first username on the list that gets generated, "cnk", doesn't seem to show up in the website-write team for some reason. All the other usernames I've tried show up when I search for them though. I'm not entirely sure why this is happening to be honest. This doesn't feel too important but probably a good idea to double check with the person who made the issue if anything needs to be done about this. And again, great work on this issue so far.

@mattmalane
Copy link
Member Author

@chrismenke45 Thanks for looking this over! I appreciate it.

@mattmalane
Copy link
Member Author

mattmalane commented Apr 27, 2023

@bootcamp-brian I took a look at the website write list team in the Github GUI and it looks like there are child teams of website-write. Not sure the the importance of them yet, but the name cnk shows up there.

@bootcamp-brian
Copy link
Member

@bootcamp-brian I took a look at the website write list team in the Github GUI and it looks like there are child teams of website-write. Not sure the the importance of them yet, but the name cnk shows up there.

Oh that makes sense. Thanks for clearing that up for me. In that case, your gha works great and should do exactly what the issue requested. Great work!

Copy link
Member

@bootcamp-brian bootcamp-brian left a comment

Choose a reason for hiding this comment

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

@mattmalane I just noticed that the PR is actually failing one of the checks. When I asked around about it, it was suggested to try changing the actions/checkout@v2 to actions/checkout@v3 because it might be a deprecation thing. Could you try that and see if it fixes the issue?

@blulady
Copy link
Member

blulady commented Apr 28, 2023

@mattmalane I just noticed that the PR is actually failing one of the checks. When I asked around about it, it was suggested to try changing the actions/checkout@v2 to actions/checkout@v3 because it might be a deprecation thing. Could you try that and see if it fixes the issue?

That's actually a thing that would be change in hfla's gha.

@bootcamp-brian
Copy link
Member

@mattmalane I just noticed that the PR is actually failing one of the checks. When I asked around about it, it was suggested to try changing the actions/checkout@v2 to actions/checkout@v3 because it might be a deprecation thing. Could you try that and see if it fixes the issue?

That's actually a thing that would be change in hfla's gha.

Okay, so the check failure is being caused by a problem with the existing gha and not something to do with what Matthew worked on?

@bootcamp-brian
Copy link
Member

@mattmalane So we managed to resolve the check failure. It wasn't caused by any of your code. I did, however, notice while going through your code again that you have trailing semicolons on some of your JavaScript code and not others where you would think there would be. Could you do a quick once over through your code and clean it up? Always good to get in the habit of keeping your code looking nice and consistent.

@mattmalane
Copy link
Member Author

@mattmalane So we managed to resolve the check failure. It wasn't caused by any of your code. I did, however, notice while going through your code again that you have trailing semicolons on some of your JavaScript code and not others where you would think there would be. Could you do a quick once over through your code and clean it up? Always good to get in the habit of keeping your code looking nice and consistent.

Awesome! Thanks for getting that resolved. I'll give the code a look over and polish it up right now.

@mattmalane
Copy link
Member Author

@bootcamp-brian I added trailing semicolons throughout, should be good to go!

Copy link
Member

@bootcamp-brian bootcamp-brian left a comment

Choose a reason for hiding this comment

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

Looks good! I'll go ahead and merge this now. Thanks for working with us on this issue and great job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: 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: 5pt Can be done in 19-30 hours Status: Updated No blockers and update is ready for review time sensitive Needs to be worked on by a particular timeframe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GHA to list inactive members
4 participants