feat(telegram): /linkrepo, /unlinkrepo and /repos commands (5/5) - #16
Merged
Merged
Conversation
/linkrepo and /unlinkrepo are admin-only and must run inside the forum topic that should receive the repo's alerts; linking is limited to the team's claimed org and re-linking moves the repo. /repos lists the team's links for any member and caps the reply below Telegram's 4096-char limit.
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.
Summary
Last PR of the
github-alertschain. It adds the commands that link a repo to a forum topic. After this merges, alerts reach Telegram for linked repos./linkrepo owner/repo:/datachannel.from topic A to topic B./unlinkrepo owner/repo: admin-only, inside a topic./repos:...and N more.errorReplies. Anything unlisted, such as a D1 failure, still reaches the 500 boundary.Size exception: about 520 lines. Production code is about 180 of them and tests about 200; the rest is apply-progress notes.
Review
Full review with four lenses, since these commands gate who can link what. No blocker or critical findings. The risk lens found nothing: the admin, member and claimed-org checks are enforced in the domain use cases, and names are lowercased before comparison. The warnings were fixed:
/reposhad no length cap. Past 4096 characters the reply throws, the error is unrecognized, the route answers 500, and Telegram retries the update forever. A 300-link test produced 7,689 characters and failed first./reposwith zero links./linkrepoand/unlinkreponow have separate handlers with a small shared helper, instead of one loop that branched on the command name.A scoped fix-delta validator approved the correction, including the removal of an
errorRepliesentry thatunlinkRepocan never throw.Test plan
npx vitest run: 334/334 passnpx tsc --noEmit: no errorsAfter merge
Operator steps still pending: 6.1 (
GITHUB_WEBHOOK_SECRET) and 6.2 (org webhook). Then run/linkrepoinside a topic to start receiving alerts.