Community automations updates: bot and community review#50
Community automations updates: bot and community review#50MisRob wants to merge 3 commits intolearningequality:mainfrom
Conversation
- Don't send replies on its PR - Don't track its PR in contributions spreadsheet
about rtibblesbot review.
when community review invited.
| name: Handle pull request events | ||
| on: | ||
| pull_request_target: | ||
| types: [review_requested,labeled] |
There was a problem hiding this comment.
@rtibbles I tried to use the event-based handler structure for the two new workflows, rather than having separate call-.....yml for each workflow as you suggested, and it seems to work nice ~ thank you. It will definitely save us some time & headaches with maintaining the five repos that call it.
Even though if any new workflows based on pull request target event are added in the future, we may still need to update types: five times. Because not specifying types at all defaults to few default types that weren't sufficient for this use-case. Or we could specify all types right away, but that feelt rather unnecessary.. In any case, even with this small hiccup, it'll still be much easier!
There was a problem hiding this comment.
I don't have space to refactor all existing workflows right now to use this handler, but it's tracked in Notion, so I will eventually work my way towards it.
rtibbles
left a comment
There was a problem hiding this comment.
Generally looks good - still wish we could drive things via team membership, but as rtibblesbot is a bit of an edge case, it makes sense.
Claude (and other LLMs) always use old versions of Github Actions because that's the version in their training data :) Should update.
| description: 'GitHub App Private Key for authentication' | ||
| required: true | ||
| jobs: | ||
| review-requested: |
There was a problem hiding this comment.
I like this structure - I imagine we could make another layer of the workflows that triages between issue and pull request events, so we only ever have to deal with a single point of entry.
There was a problem hiding this comment.
Yes, with a small limitation #50 (comment) (you reviewed faster than I wrote it :)
| app-id: ${{ secrets.LE_BOT_APP_ID }} | ||
| private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }} | ||
| - name: Checkout .github repository | ||
| uses: actions/checkout@v4 |
| ref: main | ||
| token: ${{ steps.generate-token.outputs.token }} | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 |
| app-id: ${{ secrets.LE_BOT_APP_ID }} | ||
| private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }} | ||
| - name: Checkout .github repository | ||
| uses: actions/checkout@v4 |
| ref: main | ||
| token: ${{ steps.generate-token.outputs.token }} | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 |
@rtibbles I actually copy-pasted those versions myself when I was verifying, because they're used in other actions right now, but perhaps it's not best approach? Should we upgrade all of them at once, or should I just address those that I added? |
rtibblesbot
left a comment
There was a problem hiding this comment.
Clean set of additions — bot exclusion fix, two new info-message workflows, and community review docs. Well-structured with proper contributor gating on both new workflows.
CI passing. Screenshot confirms both messages render correctly.
- suggestion:
pull-request-label.js— consider duplicate comment prevention for the label scenario (label can be removed and re-added) - nitpick:
docs/community-review.md— mixed bullet style on last line
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
Reviewed the pull request diff checking for:
- Correctness: bugs, edge cases, undocumented behavior, resource leaks, hardcoded values
- Design: unnecessary complexity, naming, readability, comment accuracy, redundant state
- Architecture: duplicated concerns, minimal interfaces, composition over inheritance
- Testing: behavior-based assertions, mocks only at hard boundaries, accurate coverage
- Completeness: missing dependencies, unupdated usages, i18n, accessibility, security
- Principles: DRY (same reason to change), SRP, Rule of Three (no premature abstraction)
- Checked CI status and linked issue acceptance criteria
- For UI changes: inspected screenshots for layout, visual completeness, and consistency
| return; | ||
| } | ||
| const prNumber = context.payload.pull_request.number; | ||
| await sendBotMessage(prNumber, BOT_MESSAGE_COMMUNITY_REVIEW, { github, context }); |
There was a problem hiding this comment.
suggestion: Unlike review_requested, the labeled event can fire multiple times for the same label (remove label → re-add). This would post duplicate bot comments. Consider adding a hasRecentBotComment check like holiday-message.js does, or checking if a comment with this message already exists on the PR.
Not blocking since it's an edge case that requires manual label toggling, but worth considering.
There was a problem hiding this comment.
That's valid concern, but I don't think we need to introduce more complexity to take care of an action that we'll rarely, if ever, do.
There was a problem hiding this comment.
Fair enough — it's a rare edge case and not worth the added complexity. Withdrawing this suggestion.
| - Before posting your first review, **see the following resources**: | ||
| - [What makes a code review good or bad?](https://github.blog/developer-skills/github/how-to-review-code-effectively-a-github-staff-engineers-philosophy/#what-makes-a-code-review-good-or-bad) | ||
| - [How to give a good code review](https://github.blog/developer-skills/github/how-to-review-code-effectively-a-github-staff-engineers-philosophy/#how-to-give-a-good-code-review) | ||
| * If you notice any inappropriate behavior, contact us at [contributors@learningequality.org](mailto:contributors@learningequality.org). |
There was a problem hiding this comment.
nitpick: This line uses * while all other bullet points in the file use -.
Disclosure: I was assisted by Claude. Revisited, adjusted & tested whole diff.
Summary
Few smaller updates to community-related automations in response to
rtibblesbotand community reviews.Fixes
rtibblesbot to the list of bots so that it's not considered a contributorNew
rtibblesbotreview requestedcommunity-labeladdedReviewer guidance
test-actionsrepo.