Closed t-will-gillis closed 2 weeks ago
@t-will-gillis are you still working on this draft? If you are please assign this to yourself
Hi @t-will-gillis, 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 :)
The schedule-monthly.yml
and wr-schedule-monthly.yml
workflows together are intended to monitor the individual activities of each member of the 'website-write' team. Members that have been inactive (as described below) for over two months are removed from the 'website-write' team. Members that have been inactive for over one month (and shy of two months) are notified that the bot will removed their team membership in the next month if the member does not resume activity. Specific details and functionalities are described below.
Complexity: Small
size: 0.5pt
role: dev leads
Feature: Administrative
Feature: Onboarding/Contributing.md
HACKFORLA_ADMIN_TOKEN
( in schedule-monthly.yml )HACKFORLA_BOT_PA_TOKEN
( in wr-schedule-monthly.yml )fetchContributors()
queries GitHub for data about all user contributions to the 'hackforla/website' repo:
allContributorsSinceOneMonthAgo
) and within the last two months (second run, allContributorsSinceTwoMonthsAgo
) are recorded.inactiveWithOpenIssue
. readPreviousNotifyList()
retrieves the list of 'notified members' from the previous month previouslyNotified
.getTeamMembers()
records all current 'website-write' team members currentTeamMembers
.removeInactiveMembers()
iterates through the list of current team members and if the member does not show any activity within the last two months:
inactiveWithOpenIssue
and the issue is not a "Pre-work Checklist", their name and issue are added to cannotRemoveYet
. (We don't want to remove the person with an open assignment)previouslyNotified
list, they will not be removed in the current month. (We want to give people a notification prior to removing them from the 'website-write' team) closePrework()
.getTeamMembers()
runs a second time to update the list of updatedTeamMembers
.notifyInactiveMembers()
iterates through the list of updated team members and if the member does not show any activity within the last month:
stefanzweifel/git-auto-commit-action@v5.0.1
to commit the record of inactive-members.json
to the repo.schedule-monthly.yml
is successful and includes:
createIssue()
writes the lists of removed members and members to be notified to a template inactive-members.md postComment()
posts a comment to the Monday Dev Meeting Agenda issue #2607, informing that the workflow has run, linking to the issue that was created, and if applicable listing member with open issues (and issue number) post-issue-comment.js module moduleData auto-generated by worksheets in the "hackforla-bot@hackforla.org" account complement this workflow:
schedule-monthly.yml
, you will need to activate two personal tokens.
HACKFORLA_BOT_PA_TOKEN
scopes: admin:org_hook, public_repoHACKFORLA_ADMIN_TOKEN
scopes: admin:org_hook, repo, write:orgget-contributors-data.js
owner: 'hackforla',
repo: 'website',
(unless your repo is 'website')In 'trim-inactive-members.js`:
[ ] IMPORTANT: Disable lines 84-88 by replacing:
await github.request('DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}', {
org: context.repo.owner,
team_slug: team,
username: username,
});
}
with:
console.log('Would be removed: ' + username);
// await github.request('DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}', {
// org: context.repo.owner,
// team_slug: team,
// username: username,
// });
}
[ ] IMPORTANT: Disable entirely the closePrework()
function, starting around ln 110:
async function closePrework(member, issueNum){
console.log('skipping closePrework()');
// Close the assignee's "Pre-work Checklist" and add comment
// await github.request('PATCH /repos/{owner}/{repo}/issues/{issue_number}', {
// owner: org,
// repo: repo,
// issue_number: issueNum,
// state: 'closed'
// });
// console.log('Closing "Pre-work Checklist" issue number ' + issueNum + ' for ' + member);
// // Add comment to issue
// await github.request('POST /repos/{owner}/{repo}/issues/{issue_number}/comments', {
// owner: org,
// repo: repo,
// issue_number: issueNum,
// body: 'The Hack for LA Bot has closed this issue due to member inactivity.'
// });
}
create-new-issue.js
:
const owner = '<your name>';
NOT 'hackforla'const repo = '<your repo name>';
let removedList = removeList.map(x => "@ " + x).join("\n"); // important to add space
let notifiedList = notifyList.map(x => "@ " + x).join("\n"); // important to add space
// let milestone = parseInt(issueObject['milestone']);
// milestone,
/utils/get-team-members.js
:
org: 'hackforla',
/utils/add-team-member.js
:
org: 'hackforla',
org: 'hackforla',
/utils/get-timeline.js
:
owner: 'hackforla',
repo: 'website',
/utils/post-issue-comment.js
:
owner: ' <your name> ',
NOT 'hackforla'repo: 'website',
See above. Mostly complete, might need minor revisions.
Linked to How to Contribute to the Wiki
Closing as completed.
Dependency
Overview
Our Wiki pages need to have accurate and complete information to explain the GitHub Actions that the website uses. Therefore, we need to correct erroneous info and provide new documentation for the GHA
schedule-monthly.yml
.NOTE Everything below is DRAFT.
Action Items
schedule-monthly.yml
.schedule-monthly.yml
.~ SEE BELOWwr-schedule-monthly.yml
~ SEE BELOWUPDATE: See comments below
Resources/Instructions