-
-
Notifications
You must be signed in to change notification settings - Fork 844
Bug fixes for "Member Activity Trigger", address edge cases #8324
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
Open
t-will-gillis
wants to merge
15
commits into
hackforla:gh-pages
Choose a base branch
from
t-will-gillis:bug-fixes-activity-trigger-edge-8323
base: gh-pages
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Bug fixes for "Member Activity Trigger", address edge cases #8324
t-will-gillis
wants to merge
15
commits into
hackforla:gh-pages
from
t-will-gillis:bug-fixes-activity-trigger-edge-8323
+127
−79
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 tasks
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.
|
Hi @santiseccovidal I just made one fix- letting you know so you have the most recent version if you have started testing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug
Something isn't working
Complexity: Large
Feature: Onboarding/Contributing.md
role: back end/devOps
Tasks for back-end developers
size: 3pt
Can be done in 13-18 hours
time sensitive
Needs to be worked on by a particular timeframe
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #8323
What changes did you make?
activity-trigger.yml
, added logic togithub-token
so that it defaults togithub.token
whensecrets.HACKFORLA_GRAPHQL_TOKEN
is restricted for security reasons (i.e. "pull_request_review")activity-trigger.js
,EXCLUDED_ACTORS
is refactored to multi-lineassignee
was changed toeventObserver
. The new variable refers to the primary assignee when available, or to the issue author if not. Note also that the primary issue assignee iscontext.payload.issue.assignees[0].login;
for "issues.closed".else if (eventName === 'pull_request_review_comment') {
actionMap
to includepull_request_target
post-to-skills-issue.js
, added or revisedconsole.log()
smessage
includes the words "closed" or "assigned"mutate-issue-status.js
, addedreturn true;
post-issue-comment.js
added areturn true;
Why did you make the changes (we will use this info to test)?
pull_request_review
is the trigger the defined PAT is not available. To prevent the workflow error we need to explicitly define the default token. The odd expression is a simulated ternary operation: the simplegithub-token = ${{ secrets.HACKFORLA_GRAPHQL_TOKEN || github.token }}
evaluates to a Boolean, and does not define which token to use. The expression shown bypasses the strict Boolean and evaluates togithub-token = github.token
if the PAT is not accessible.console.log()
messages help with debuggingpost-to-skills-issue.js
to post aconsole.log()
, but does not affect other functions that are not expecting any return valueCodeQL 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
Please let us know that you have checked for CodeQL alerts. Please do not dismiss alerts.
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.:
Following are some changes for testing. You can make some of the simpler changes to see that the pieces appear to work correctly, but to go "all the way" with the testing (for example, testing Archived issues, trying to force CodeQL to fire, etc.) will be much more involved and might not be needed:
Make sure your
HACKFORLA_GRAPHQL_TOKEN
is activeChange the default branch of your repo
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 either tell the bot the number of your repo's Skills Issue:post-to-skills-issue.js
, change:post-to-skills-issue.js
to:github-actions/utils/_data/status-field-ids.js
to match your repo's values using GitHub Explorer (at least until Nov 1, 2025). Here is how to find that info:Extracting Status Field Ids from personal repo
Finding your projNum
Example output from Explorer
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.