Skip to content

Conversation

@katiejnete
Copy link
Member

@katiejnete katiejnete commented May 23, 2025

Fixes #7562

What changes did you make?

  • I refactored the minimizeIssueComments() to add an upper time limit when hiding bot-generated comments.
  • Instead of hiding all comments older than 7 days, the function now only hides comments older than 7 days but newer than 30 days.

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

  • The original workflow was making too many GraphQL requests by trying to minimize all comments older than 7 days, including very old ones that were already hidden.
  • This caused the workflow to hit GitHub's secondary rate limit and fail.
  • By limiting the comment minimization to a 7 to 30 day window, the number of API calls is reduced.

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
  • Workflow logs showing successful run

@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 katiejnete-refactor-minimizeissuecomments-avoid-limit-7562 gh-pages
git pull https://github.com/katiejnete/website.git refactor-minimizeissuecomments-avoid-limit-7562

@github-actions github-actions bot added role: back end/devOps Tasks for back-end developers Complexity: Medium Feature: Refactor GHA Refactoring GitHub actions to fit latest architectural norms size: 5pt Can be done in 19-30 hours Lang: GHA GitHub Actions labels May 23, 2025
@t-will-gillis t-will-gillis self-requested a review May 23, 2025 16:19
Copy link
Member

@t-will-gillis t-will-gillis left a comment

Choose a reason for hiding this comment

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

Hey @katiejnete Fantastic job-

  • The 'from' and 'to' branches are good
  • Linked to the original issue
  • The responses for "What changes did you make?" and "Why did you make the changes?" are great. You might get away with saying less, but at the same time this is a really good explanation of the reasoning behind this issue.
  • There are no CodeQL alerts
  • There is a workflow log showing that the workflow runs successfully after the edits

I have a couple of minor requests:

  • Although the issue (that I wrote, ha) says to place
     const upperLimitCutoffTime = new Date();
     upperLimitCutoffTime.setDate(upperLimitCutoffTime.getDate() - upperLimitDays);  
    
    after const fourteenDayCutoffTime, to follow the same pattern as the rest of this section could you move the above code so that it is after fourteenDayCutoffTime.setDate(fourteenDayCutoffTime.getDate() - inactiveUpdatedByDays); instead?
  • Another minor request, could you add a blank line to separate Line 35 const upperLimitDays = 30; // Bot-generated... and Line 36 const threeDayCutoffTime = new Date();? I think keeping a newline between these two sets looks cleaner...

Thanks for working on this, and fantastic job again!

@github-project-automation github-project-automation bot moved this from PR Needs review to PRs being reviewed in P: HfLA Website: Project Board May 23, 2025
@katiejnete
Copy link
Member Author

Thank you @t-will-gillis ! I've made the changes you've requested.

@katiejnete katiejnete requested a review from t-will-gillis May 23, 2025 23:48
Copy link
Member

@t-will-gillis t-will-gillis left a comment

Choose a reason for hiding this comment

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

Great- thanks @katiejnete!

@t-will-gillis t-will-gillis merged commit 370a34e into hackforla:gh-pages May 25, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complexity: Medium 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: 5pt Can be done in 19-30 hours

Projects

Development

Successfully merging this pull request may close these issues.

Refactor minimizeIssueComments() in "Schedule Friday" to avoid secondary rate limit

2 participants