Skip to content

Enhanced Skills Activity GHA to use Skills Directory#8370

Open
xnealcarson wants to merge 45 commits intohackforla:gh-pagesfrom
xnealcarson:enhance-gha-skillsactivity-8316
Open

Enhanced Skills Activity GHA to use Skills Directory#8370
xnealcarson wants to merge 45 commits intohackforla:gh-pagesfrom
xnealcarson:enhance-gha-skillsactivity-8316

Conversation

@xnealcarson
Copy link
Member

@xnealcarson xnealcarson commented Oct 13, 2025

Fixes #8316

What changes did you make?

  • added most recent skillsIssueNums.csv to the github-actions/utils/_data folder, and converted the directory to JSON format (skills-directory.json).
  • Created a new module in utils that looks up in the directory and return the information (skills-directory.js).
  • added import module to post-to-skills.js for the skills directory
  • Refactored code in post-to-skills-issue.js to search the newly added skills directory before deferring to the querySkillsIssue() GitHub API, if necessary, upon which new info found using querySkillsIssue() will be saved to the skills directory
  • Tested changes by creating fake skills issue on my repo's project board (Skills Issue: Developer: Xavier Neal-Carson (Test) xnealcarson/website#17) and then creating subsequent test issue to ensure proper function of Skills Activity tracking (Test Issue for Refactored Skills Activity GHA xnealcarson/website#18)

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

  • We needed to reduce the number of unnecessary GitHub API calls that the "Member Activity Trigger" workflow makes when posting to a user's Skills Issue by providing a user directory. New info found

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)

No visual changes to the website

NOTE TO REVIEWERS

If you would like to test these changes for yourself:

  • Make sure your HACKFORLA_GRAPHQL_TOKEN is active
    • Change the default branch of your repo to a test branch
    • Change line in activity.trigger.yml to refer to your own repo.
    • Add a Skills Issue in your name to your project and assign it to yourself. Take note of the issue number and add it below.
    • The automation uses GraphQL queries to locate each user's Skills Issue and the bot comment. HfLA's project, status, and field ids are hard-coded in the file github-actions/utils/_data/status-field-ids.js, so you will need to tell the bot the number of your repo's Skills Issue by making the following edits:
      • In post-to-skills-issue.js, change:
                const isActiveMember = await checkTeamMembership(github, context, eventActor, TEAM);
        
        to:
                // const isActiveMember = await checkTeamMembership(github, context, eventActor, TEAM);
                const isActiveMember = true;
        
      • Change lines 39-44 in post-to-skills-issue.js to:
          // Get eventActor's Skills Issue number, nodeId, current statusId (all null if no Skills Issue found)
          // const skillsInfo = await querySkillsIssue(github, context, username, SKILLS_LABEL);
         const skillsIssueNum = _the number of the skills issue you created_ ;  
         const skillsIssueNodeId = null;
         const skillsStatusId = null;
         const isArchived = false;
        

@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 xnealcarson-enhance-gha-skillsactivity-8316 gh-pages
git pull https://github.com/xnealcarson/website.git enhance-gha-skillsactivity-8316

@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: 8pt Can be done in 31-48 hours Lang: GHA GitHub Actions Skill: enhance labels Oct 13, 2025
@ryanfkeller ryanfkeller self-requested a review October 14, 2025 21:00
@ryanfkeller
Copy link
Member

Hi @xnealcarson, I'll give this a review as well! ETA 10/17, generally able to be available 1-5p weekdays.

@ryanfkeller
Copy link
Member

ryanfkeller commented Oct 15, 2025

Hey @xnealcarson, thanks for taking this issue! It looks like you're on the right track, and also great job on the PR description -- it made it easy to understand what you've done here.

I noticed a couple things in my review:

  • In post-to-skills.js, I think you have some old code on line 55 that creates a syntax error on trying to re-define skillsInfo (and if it ran would result in an unneeded re-query for the skills issue). That line can probably just be deleted. Nitpick but the extra indentation on the following lines could probably also be removed.
  • In post-to-skills.js, I can see that we are using a query to search for the "activity comment" even when we got the issue number from the local JSON. Since I believe the JSON includes the comment ID under the "id" category, you should be able to just read/patch that comment directly and skip the search if there is a JSON entry. The query/search you have should definitely still be a fallback for when you don't have the issue info saved locally.
  • Since we do save the "activity comment" id in the skills-directory.json, we'll want to make sure to update that JSON with the ID when we have to create a new "activity comment".
  • We may not want to save the skillsIssueNums-*.csv in the _data directory, since it isn't used directly and with this flow in action, I expect the .json should be the source of truth.
  • (Edited, I missed some things in your description in my original comment, sorry!) Instead of changing the post-to-skills-issue.js to bypass isActiveMember and skillsInfo collection, would it be possible to instead modify our local copy of the _data sources so the full script flow is tested? We probably also want the test case of the skills issue not existing in _data as well so the query is executed. If you have examples of that, could you share the workflow run link?

Again, really nice work! Looking forward to seeing the next rev 🚀

Copy link
Member

@ryanfkeller ryanfkeller left a comment

Choose a reason for hiding this comment

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

Looking good, but a few things I think need attention! See my comment above.

@github-project-automation github-project-automation bot moved this from PR Needs review to PRs being reviewed in P: HfLA Website: Project Board Oct 15, 2025
fixed typo on change made to line 54 for testing purposes
removed `return` on line 94 to hit block that re-opens issue & added `else` that sets `commentIdToUse` to `null`
fixed typo on line 55
Took `updateSkillsDirectory()` out of `if (!skillsInfo)` loop and added `needsUpdate` flag to trigger `updateSkillsDirectory()` after the MARKER comment is found
updated `updateSkillsDirectory` function to update values in `skills-directory.json` with correctly formatted issue ids, per Will's feedback from 12/4
…function

added missing closing bracket back to if (!skillsInfo) function
added missing closing bracket for `if (!commentIdToUse) function

// Step 3: Save result to local directory if found
if (skillsInfo && skillsInfo.issueNum) {
needsUpdate = true

Check notice

Code scanning / CodeQL

Semicolon insertion Note

Avoid automated semicolon insertion (98% of all statements in
the enclosing function
have an explicit semicolon).
…nction

added missing closing bracket for last `else` within `updateSkillsDirectory` function
@t-will-gillis
Copy link
Member

Hey @xnealcarson hope you are enjoying the holiday break. I had a chance to look through the latest and have some comments:

  • For the PR commit, github.repository in activity-trigger.yml will need to be hackforla/website
  • Similarly in post-to-skills-issue.js near lines 178-179, the const isActiveMember = true; is only for testing and should be deleted, and the line above uncommented
  • Near line 58, the test value of 17 should be removed and the line above uncommented
  • For the REST API calls, for example lines 113-120, the formatting looks like how Prettier would format this. My feeling is that we should keep the formatting consistent with our other files- that is formatted the same as the API call lines 102-106
  • The major thing we talked previously is that I think that skills-directory.json should be cleared so that all new data written is correct. As far as committing the changes to the repo, it could be done similar with the stefanzweifel/git-auto-commit-action@v7.1.0 similar to schedule-monthly.yml and other workflows.
    • There are some minor quirks to going this route that I will mention so you don't need to be spinning your wheels. The first is that you will need to add the HACKFORLA_ADMIN_TOKEN after the actions/checkout@v6 step in the YML.
    • As I mentioned before, I feel like the original issue I wrote left out a lot of info. If you want to look at a way that I think comes pretty close to wrapping this up, you can take a look at this branch in my repo.

Thank again!

Cleared to ensure that new data is written using the correct formatting
Updated to add `stefanzweifel/git-auto-commit-action@v7.1.0`, to commit repo changes made when adding new data to `skills-directory.json`
edited formatting of REST API calls for format consistency
console.log(` ⮡ MARKER not found, creating new comment entry with MARKER...`);
const body = `${MARKER}\n## Activity Log: ${eventActor}\n### Repo: https://github.com/hackforla/website\n\n##### ⚠ Important note: The bot updates this comment automatically - do not edit\n\n${message}`;
try {
const { data: newComment } = await github.request('POST /repos/{owner}/{repo}/issues/{issue_number}/comments', {

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable newComment.
@xnealcarson
Copy link
Member Author

Hey @t-will-gillis and @ryanfkeller — apologies for the extended gap since my last check-in.

I believe the final edits I've made some weeks back have resolved the final snags in this issue. I ran a final test today and am including the screenshots below. The skills activity appears to be functioning correctly, however the bot is no longer updating the comment in my test skills issue — this started after clearing the skills directory and implementing stefanzweifel/git-auto-commit-action@v7.1.0, per Will's suggestion.

I'm not certain whether this is related to the aforementioned test values in post-to-skills-issue.js and activity-trigger.yml (which I have sinced changed back to the default values, after implementing my last test), or if something else is missing. Otherwise I think this might be finally ready to merge. Whenever you are both available to post any final feedback you might have offer I would greatly appreciate, and thanks again for your patience.
Test Issue #28 and Test Issue #29_Member Activity Trigger Checks
Test Issue #28 Member Activity Trigger_Details
Test Issue #29 Member Activity Trigger_Details
Test Skills Issue Activity Log Comment as of 3-22-2026

@xnealcarson xnealcarson requested a review from ryanfkeller March 22, 2026 15:13
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 Lang: GHA GitHub Actions role: back end/devOps Tasks for back-end developers size: 8pt Can be done in 31-48 hours Skill: enhance

Projects

Status: PRs being reviewed

Development

Successfully merging this pull request may close these issues.

Enhance GHA: "Skills Activity" use Skills Issue directory

4 participants