Skip to content

Conversation

@t-will-gillis
Copy link
Member

@t-will-gillis t-will-gillis commented Jul 22, 2025

Fixes #4820

What changes did you make?

  • Deleted activity-history-post.yml.
  • Created activity-trigger.yml
  • Created activity-trigger.js
  • Created post-to-skills-issue.js
  • Edited add-label.js
  • No changes to: query-issue-info.js
  • Created query-skills-issue.js

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

  • activity-history-post.yml was a temporary, one-use file that should have been deleted previously
  • activity-trigger.yml is the trigger file for the "Member Activity Trigger" workflow. Triggers are anytime an issue is opened, closed, reopened, assigned or unassigned; or if an issue comment is created; or if a PR is opened, closed, or reopened, or a PR review is submitted; or a PR review comment is created.
  • activity-trigger.js determines who is the eventActor for the event, categorizes the event action, pulls the correct event url, pulls the createdAt time and converts this into localTime so it is readable, then composes the message that will be added to the dev's skills issue.
  • activity-trigger.js also checks whether the comment, assignment, etc. was performed on a Skills Issue. If so, the event is ignored so that there is not a comment about a comment.
  • post-to-skills-issue.js finds the eventActor/usernames Skills Issue if available, then extracts all comments to find the one that has the MARKER text or create a new comment if needed, then checks whether the username is an Active Member, and if so confirms that their Skills Issue is open and that the issue's status is "In progress (actively working)".
  • add-labels.js is edited so that "Schedule Friday" checks for the new label Skills Issue Completed and excludes those issues from the update checks. It also intercepts the bot from closing the "Activity Record" comment.
  • query-skills-issue.js searches repo for the issues with an assignees name and the Complexity: Prework label

UPDATE 8/18/25: Additional edits from weekly lead meeting:

  • activity-trigger.yml added for loop to give the workflow the ability to record to two locations for some singular events: "issue.closed" and "pull_request.closed", will now record the username of the issue assignee/ pr author, as well as the actor (usually Merge Team) who actually merged or closed the issue or pr, if different
  • activity-trigger.js added logic for the above
  • post-to-skills-issue.js edited the Activity Log title to include the repo name

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 to reviewers

If you are already set up for GHAs, that is have a local Project Board, know about the tokens and labels, etc.:

  • The only changes for testing:

    • Make sure your HACKFORLA_GRAPHQL_TOKEN is active
    • Change the default branch of your repo / select t-will-gillis-gha-add-comments-skills-issue-4820
    • Change line 19 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 either tell the bot the number of your repo's Skills Issue:
      • 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 = ;
      const skillsIssueNodeId = null;
      const skillsStatusId = null;
      ```
      • Conversely, you could change the values in github-actions/utils/_data/status-field-ids.js to match your repo's values using GitHub Explorer (at least until Nov 1, 2025) but that is a lot more involved. Here is how to find that info:

        Extracting Status Field Ids from personal repo
        query findStatusSubfieldId($login: String!, $projNum: Int!, $fieldName: String!) {
          user(login: $login) {
            projectV2(number: $projNum) {
              id
              field(name: $fieldName) { 
                ... on ProjectV2SingleSelectField { 	
                  id 
                  options { 
                    id
                    name
                  } 
                }
              }
            }
          }
        }  
        
        variables:
        {
          "login":"<your username>",
          "projNum":"<find on projects page>"
          "fieldName": "Status"
        }
        Finding your projNum Screenshot 2025-08-25 102151
        Example output from Explorer Screenshot 2025-08-25 102920
  • After, you should be able to quickly test that a message is being posted to your temporary Skills Issue whenever you open, close, assign, and unassign issues, add a comment, and open and close PRs.

@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-gha-add-comments-skills-4820 gh-pages
git pull https://github.com/t-will-gillis/website.git gha-add-comments-skills-4820

t-will-gillis and others added 3 commits August 20, 2025 11:34
@mugdhchauhan mugdhchauhan self-requested a review August 26, 2025 20:00
mugdhchauhan
mugdhchauhan previously approved these changes Aug 26, 2025
Copy link
Member

@mugdhchauhan mugdhchauhan 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

Thanks for helping me with testing.

Looks like it's all working well.

Nice one, I approve! 🎉

state: skillsIssueState,
});
} catch (err) {
console.error(`Failed to update issue #${skillsIssueNum} state:`, err)

Check notice

Code scanning / CodeQL

Semicolon insertion Note

Avoid automated semicolon insertion (97% of all statements in
the enclosing function
have an explicit semicolon).
@t-will-gillis t-will-gillis merged commit 8998f3a into hackforla:gh-pages Aug 31, 2025
3 checks passed
@t-will-gillis t-will-gillis deleted the gha-add-comments-skills-4820 branch August 31, 2025 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

Create GHA to add comments to prework issues documenting issues events

2 participants