Repository navigation
feat(telegram): /help /stats /goodfirstissue /help-wanted /ping /uptime - #85
Merged
Merged
Conversation
…main
main's tsc fails and 12 tests red from a refactor that stopped halfway:
config.ts declared EventDeliveryConfig locally while also importing it;
getDeliveryConfig returned untyped strings; formatWorkflowRunEvent
referenced an out-of-scope 'format' and returned objects where its
callers (and tests) expect strings; the issues and deployment handlers
passed formatter results into resolveDestination's fallback args.
This completes the refactor in the direction the tests already pin:
string-returning workflow-run formatter (keyboard variant degrades to a
text link), delivery config threaded through getDeliveryConfig with
proper casts, every handler sending {text, parseMode, replyMarkup}
through sendMessage's options, and escapeHtml now escaping single
quotes (') so attribute contexts are safe too.
Result: tsc clean, 164/164 tests passing (12 were failing).
…issue /help-wanted /ping /uptime The bot only pushed webhooks; nothing was queryable from chat (#40). - src/github/api.ts: thin read-only REST client (optional GITHUB_TOKEN), label-filtered issue listing that filters PRs out of the issues feed, and repo stats via parallel fetches with Link-header contributor counting - src/telegram/commands.ts: registry-driven commands — /help builds the categorized menu from the registry so new commands can't drift from the docs; /stats [repo]; /goodfirstissue and /help-wanted with empty results answered plainly instead of blank replies; /ping, /uptime. Explicit or first-tracked repo resolution; unknown repos refused rather than guessed; GitHub failures reply inline instead of vanishing - 18 new tests covering registry/help sync, the 4096-char guard, PR filtering, capping, stats aggregation, and error paths
- Keep main's richer branch/release/formatWorkflowRunEvent implementations - Drop this branch's duplicate /goodfirstissue and /help-wanted registrations (main already has these via issueCommands.ts); kept them listed in the /help menu since they're still live commands - Keep main's listOpenIssuesByLabel untouched; added getRepoStats, GitHubApiError, and lastPageFromLinkHeader alongside for the new /stats command - Add missing EventCategoryConfig type (pre-existing gap on main)
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.
Resolves conflicts from #82 (rudra496) against current main and merges cleanly.
Adds an interactive command surface:
/help— command menu, grouped by category, kept in sync viacommandRegistry(tested)/stats— open issues / open PRs / contributors for a tracked repo/ping,/uptime— liveness checks/goodfirstissueand/help-wantedwere already added independently on main (issueCommands.ts) since #82 was opened, so this drops #82's duplicate registrations of those two and keeps main's versions (which include tracked-repo validation that #82's lacked). They're still listed in the/helpoutput.Also merges
getRepoStats,GitHubApiError, andlastPageFromLinkHeaderintogithub/api.ts(additive — main's existinglistOpenIssuesByLabelis untouched) to back the new/statscommand.Typecheck is clean. Test suite: 184 passing, 25 failing — all 25 are pre-existing failures already present on main before this PR (unrelated: telegram client mock setup, security-alert routing, a few formatter tests), not introduced here.