Add comment-triggered activity collection to payjoin-bot#1503
Merged
DanGould merged 4 commits intopayjoin:masterfrom Apr 27, 2026
Merged
Add comment-triggered activity collection to payjoin-bot#1503DanGould merged 4 commits intopayjoin:masterfrom
DanGould merged 4 commits intopayjoin:masterfrom
Conversation
Move shared GitHub API helpers and activity-gathering functions into a new .github/scripts/standup_lib.py so the upcoming on-comment trigger can reuse them without duplicating logic. Behavior of the weekly Monday post is unchanged: format_contributor _comment defaults to include_last_week=True, preserving the user header, @-mention, and "Last Week" link block. The new include_last_week=False path is reserved for the on-demand /check-in reply added in a follow-up commit.
New .github/scripts/respond_to_standup_comment.py replies to a contributor's `/check-in` comment in a Weekly Check-in Discussion with the same auto-gathered activity summary used by the Monday post. Behavior: * Confirms the precise `(?im)(^|\s)/check-in\b` match on the comment body, exits silently otherwise. * Loop guard: skips comments authored by payjoin-bot. * Per-week cap: queries existing comments + replies and exits silently if payjoin-bot already posted a body starting with `### Shipped` in reply to a comment by this author. Error replies do not count, so a failed first attempt allows retry. * Activity window is `discussion.createdAt - 7 days`, matching the Monday window for that Discussion regardless of when the /check-in comment was made. * Posts via `addDiscussionComment` with `replyToId=COMMENT_ID` so the reply nests under the trigger. * On failure, best-effort posts a short error reply (not the success marker) and re-raises so CI shows red.
Trigger respond_to_standup_comment.py whenever a discussion comment is created in the Check-ins category under a `Weekly Check-in:` Discussion, the comment is not authored by payjoin-bot, and the body contains `/check-in`. The script applies the precise regex, loop guard, and per-week cap. Uses the existing STANDUP_BOT_TOKEN (with fallback to STANDUP_TOKEN) — no new secrets or scopes required.
Discussion replies are one level deep — `addDiscussionComment`'s `replyToId` only accepts a top-level comment ID, so a `/check-in` posted as a reply (nested) would either fail at the API or post in an unexpected place. Guard at the workflow `if:` so the job never starts: nested comments carry a non-null `parent_id` in the payload. The script's per-week cap and post logic stay simple and only ever see top-level triggers.
Collaborator
Coverage Report for CI Build 24925352513Coverage remained the same at 84.953%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
caarloshenriq
approved these changes
Apr 25, 2026
Contributor
caarloshenriq
left a comment
There was a problem hiding this comment.
tACK
ran the /check-in command in your fork's discussion and it correctly listed all my contributions from this week
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes the asymmetry where only a pre-defined list of contributors get a pre-made activity thread on
Monday but newcomers and async-only contributors had to self-post
manually with no auto-gathered activity.
Tested in a discussion on my branch with this discussion comment.
Very much completely claude coded.
This is what the robots ran to verify:
python -m py_compileon the three Python filesformat_contributor_commentbetweenthe pre-refactor baseline and the new lib — Monday default path
is byte-identical (via dry-run)
(?im)(^|\s)/check-in\baccepts standalone /line-anchored / case variants; rejects
foo/check-in/barandnot-a/check-in/check-in; bot self-comment; wrongcategory; same user after prior success (cap consumed); same
user after prior failure (
### Shippedabsent → retry allowed)Post-merge acceptance:
/check-infrom a non-listed account in the nextWeekly Check-in Discussion → bot replies within ~2 min,
threaded under the trigger
/check-inagain from same account → no response/check-infrom a different account → response/check-inin a non-Check-in Discussion → workflowdoes not run
job is red; re-comment
/check-in→ bot retries successfullyPull Request Checklist
Please confirm the following before requesting review:
AI
in the body of this PR.