Skip to content

Fix API reference and env var documentation drift against source code#63

Merged
MinecraftFuns merged 3 commits intomainfrom
copilot/improve-docs-onboarding-guide
Feb 28, 2026
Merged

Fix API reference and env var documentation drift against source code#63
MinecraftFuns merged 3 commits intomainfrom
copilot/improve-docs-onboarding-guide

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 27, 2026

README documented offset-based pagination, 301 redirects, and unconditional timing headers — none of which match the actual implementation. Several API endpoints and env vars were also missing from docs.

Fixes

  • Pagination: GET /api/urls?limit=50&offset=0 → cursor-based (limit + cursor params, per ListQuery in src/api/handlers.rs)
  • Redirect code: → 301 Redirect→ 308 Permanent Redirect (default from RedirectMode::default() in src/config/mod.rs)
  • Dead link: Removed reference to nonexistent README.old.md
  • Timing headers: Documented as always-on, but gated behind ENABLE_TIMING_HEADERS env var (src/main.rs:726). Added missing X-Lynx-Timing-Handler-Ms.
  • Missing endpoints: Added GET /api/auth/mode, GET /api/user/info, GET /api/analytics/{code}, GET /api/analytics/{code}/aggregate, GET /api/urls/search
  • Missing env vars: Added REDIRECT_STATUS_CODE and ENABLE_TIMING_HEADERS to README config table and .env.example
  • Workflows README: AUTH_MODE listed none and oauth only — added cloudflare

Drift prevention

New scripts/check-docs-drift.sh that verifies:

  1. All .route() paths from src/api/routes.rs and src/redirect/routes.rs appear in README
  2. All std::env::var() names from src/config/mod.rs and src/main.rs appear in README or .env.example
  3. No stale 301-as-default or offset-pagination claims
bash scripts/check-docs-drift.sh
# ✅ All documentation drift checks passed.

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 2 commits February 28, 2026 00:13
…ssing endpoints and env vars

- Fix wrong pagination params (offset→cursor) in README API examples
- Fix wrong redirect status code (301→308 default, configurable)
- Remove broken README.old.md link
- Add all missing API endpoints to README (auth/mode, user/info, analytics, search)
- Document ENABLE_TIMING_HEADERS condition for timing headers
- Add X-Lynx-Timing-Handler-Ms to timing headers list
- Add REDIRECT_STATUS_CODE and ENABLE_TIMING_HEADERS to README config table
- Add ENABLE_TIMING_HEADERS to .env.example
- Fix AUTH_MODE in workflows README (add cloudflare)
- Add drift-prevention script scripts/check-docs-drift.sh
- Add .jules/atlas.md journal

Co-authored-by: MinecraftFuns <25814618+MinecraftFuns@users.noreply.github.com>
Co-authored-by: MinecraftFuns <25814618+MinecraftFuns@users.noreply.github.com>
Copilot AI changed the title [WIP] Update onboarding documentation for new contributors Fix API reference and env var documentation drift against source code Feb 28, 2026
@MinecraftFuns MinecraftFuns marked this pull request as ready for review February 28, 2026 01:16
@MinecraftFuns MinecraftFuns merged commit 54ee914 into main Feb 28, 2026
6 checks passed
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