Skip to content

Conversation

@t-will-gillis
Copy link
Member

@t-will-gillis t-will-gillis commented Jun 10, 2025

Fixes #8174

What changes did you make?

  • Added get-open-assigned-issues.js
  • In get-contributors-data.js, split out inactiveWithOpenSkills from inactiveWithOpenIssue
  • In trim-inactive-members.js, followed inactiveWithOpenSkills split, added function call to getOpenAssignedIssues.js, simplified if/else statements, followed new variable nonTeamOpenIssue
  • In createNewIssue.js, added section to report nonTeamWIthOpen

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

  • The new utility function retrieves a list of all open issues with assignees, and then iterates through the list to find issues assigned to non-team members, as well as issues assigned to previously identified inactive members
  • This will help us reassign open issues that are not being worked on.

CodeQL Alerts

After the PR has been submitted and the resulting GitHub actions/checks have been completed, developers should check the PR for CodeQL alert annotations.

Check the PR's comments. If present on your PR, the CodeQL alert looks similar as shown

Screenshot 2024-10-28 154514

Please let us know that you have checked for CodeQL alerts. Please do not dismiss alerts.

  • I have checked this PR for CodeQL alerts and none were found.
  • I found CodeQL alert(s), and (select one):
    • I have resolved the CodeQL alert(s) as noted
    • I believe the CodeQL alert(s) is a false positive (Merge Team will evaluate)
    • I have followed the Instructions below, but I am still stuck (Merge Team will evaluate)
Instructions for resolving CodeQL alerts

If CodeQL alert/annotations appear, refer to How to Resolve CodeQL alerts.

In general, CodeQL alerts should be resolved prior to PR reviews and merging

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

Notes for Reviewers

  • Note that I can do a live demonstration instead of you needing to run this yourself. Otherwise,

  • You will need to have a functioning test environment on your local repo. In addition to the 'files changed' in the PR, there are additional changes that you should make to help with testing. If you do not make these edits, you might delete or mis-edit Hack for LA data, delete team members, generate false or junk notifications, and/or create junk issues on HfLA's live project board.

  • In schedule-monthly.yml, you will need to activate two personal tokens.

    • HACKFORLA_BOT_PA_TOKEN scopes: admin:org_hook, public_repo
    • HACKFORLA_ADMIN_TOKEN scopes: admin:org_hook, public_repo, write:org
  • In the same file, near line 12, replace 'hackforla' with your personal repo.

  • In get-contributors-data.js

    • Around line 82 replace with owner: 'hackforla',
    • Around line 83 replace with repo: '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.'
      // });
    }
    
  • In create-new-issue.js:

    • Around line 28 should be OK as written, but you can replace const owner = '<your name>'; NOT 'hackforla'
    • Around line 29 should be OK as written, but you can replace const repo = '<your repo name>';
    • Around line 10, replace with an issue number in your repo
    • IMPORTANT: Around line 46-47 replace with:
    let removedList = removeList.map(x => "@ " + x).join("\n");    // important to add space
    let notifiedList = notifyList.map(x => "@ " + x).join("\n");   // important to add space
    
    • Comment out ln 66, i.e.: // let milestone = parseInt(issueObject['milestone']);
    • Comment out ln 81, i.e.: // milestone,
  • In /utils/get-team-members.js:

    • Ln 16, replace with org: 'hackforla',
  • In /utils/add-team-member.js:

    • Ln 11, replace with org: 'hackforla',
    • Ln 18, replace with org: 'hackforla',
  • In /utils/get-timeline.js:

    • Ln 16, replace with owner: 'hackforla',
    • Ln 17, replace with repo: 'website',
  • In /utils/post-issue-comment.js:

    • Ln 9, replace with owner: ' <your name> ', NOT 'hackforla'
    • Ln 10, replace with repo: 'website',
  • In get-open-assigned-issues.js:

    • Ln 18, replace with owner: 'hackforla',

@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 t-will-gillis-augment-schedule-monthly-8174 gh-pages
git pull https://github.com/t-will-gillis/website.git augment-schedule-monthly-8174

@github-actions github-actions bot added role: back end/devOps Tasks for back-end developers Complexity: Large Feature: Refactor GHA Refactoring GitHub actions to fit latest architectural norms size: 3pt Can be done in 13-18 hours labels Jun 10, 2025
@santiseccovidal santiseccovidal self-requested a review June 15, 2025 17:46
correct capitalization of 'GitHub'
Copy link
Member

@santiseccovidal santiseccovidal left a comment

Choose a reason for hiding this comment

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

Hi @t-will-gillis everything looks great.
My repo's run. I run the changes in my own repo and it worked exactly as we discussed on Sunday.

Code changes are correct, the changes in the structures and I agree on the logic for locating users. Now that the variable holding users that cannot be removed yet is deleted the code changes are more clear.

@t-will-gillis t-will-gillis merged commit 9ebd208 into hackforla:gh-pages Jun 28, 2025
3 checks passed
@t-will-gillis t-will-gillis deleted the augment-schedule-monthly-8174 branch June 30, 2025 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complexity: Large 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.

Augment "Schedule Monthly" workflow

2 participants