Skip to content

Automate Bot API drift detection and quality checks - #6

Merged
f1devbin merged 2 commits into
mainfrom
claude/jolly-shannon-ncgo4t
Nov 4, 2026
Merged

f1devbin merged 2 commits into
mainfrom
claude/jolly-shannon-ncgo4t

Conversation

@f1devbin

@f1devbin f1devbin commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Removes the biggest manual steps in maintaining the project.

Inefficiencies addressed

  1. Bot API updates were fully manual — no way to notice a new version; the version string was hardcoded in 20 places (15 locale strings, OG image, data.js, docs).
    • scripts/check-bot-api.mjs diffs the latest spec against src/assets/js/data.js (update types, admin rights, getMe flags, command scopes, setWebhook params, bot-settings methods). Unit-tested with a synthetic spec.
    • .github/workflows/bot-api-watch.yml runs it weekly and opens/updates an issue labelled bot-api-update.
    • Version now lives only in BOT_API_VERSION; locales use {botApiVersion}, images.mjs reads it. A test forbids hardcoding it again.
  2. Browser e2e test only ran locally — regressions like a JS syntax error or a CSP hash mismatch would reach production. CI now runs the Playwright e2e (mocked Bot API) on every PR.
  3. Performance/accessibility/SEO checked by hand in PageSpeed — CI now runs Lighthouse on 3 pages (accessibility ≥95 and best practices ≥90 are errors; performance/SEO warn). Reports are uploaded as artifacts.
  4. CI ran twice per PR commit (push + pull_request) — now only on pull_request, with concurrency cancel.
  5. No written procedure for updates — CLAUDE.md describes the exact steps for any agent session.

Testing

  • npm test: 34 pass (3 new)
  • node scripts/screenshots.mjs --no-shots: pass
  • node scripts/check-bot-api.mjs: up to date with Bot API 10.3
  • Lighthouse locally: accessibility / best practices / SEO 100 on all 3 pages

Generated by Claude Code

- scripts/check-bot-api.mjs compares the latest Bot API spec with data.js
  (update types, admin rights, getMe flags, scopes, setWebhook params,
  bot settings methods); unit-tested with a synthetic spec
- Weekly "Bot API watch" workflow opens/updates a bot-api-update issue
- CI on pull requests: unit tests, build, Playwright e2e with mocked API,
  Lighthouse audit; duplicate push runs removed
- Bot API version defined once in data.js; locales use {botApiVersion}
  and the OG image reads it too
- CLAUDE.md with the update procedure; README automation section

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ti9i15KJoZzEDMWsyiELNj
@f1devbin
f1devbin merged commit e44be23 into main Nov 4, 2026
3 checks passed
@f1devbin
f1devbin deleted the claude/jolly-shannon-ncgo4t branch November 4, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants