8000 List the index dumps at /api/v1/search/dumps by daoudclarke · Pull Request #571 · mwmbl/mwmbl · GitHub
[go: up one dir, main page]

Skip to content

List the index dumps at /api/v1/search/dumps - #571

Merged
daoudclarke merged 1 commit into
mainfrom
claude/sharp-sagan-87oq8f
Oct 31, 2026
Merged

daoudclarke merged 1 commit into
mainfrom
claude/sharp-sagan-87oq8f

Conversation

@daoudclarke
Copy link
Copy Markdown
Contributor

Stacked on #537. Merge that first; this PR then retargets to main.

What changed

  • GET /api/v1/search/dumps (no auth): lists the finished index dumps, newest first.
    • Each entry has its manifest fields (size, SHA-256, page size and count, start and finish times), the compressed size, and public URLs for the dump and its manifest.
    • The URLs come from the new MWMBL_DUMP_PUBLIC_URL: B2's friendly URL for the bucket, or a CDN's in front of it.
  • list_dumps (mwmbl/indexer/dump.py): a dump counts as finished only once its manifest exists, so uploads that failed part-way are left out.
  • Caching: the listing is cached for an hour, so a page view doesn't cost a B2 request.
  • Client for the listing: it runs inside a web request, so it uses its own B2 client with short timeouts and 2 attempts. The dump's transfer client makes 10 attempts with 60s timeouts, which would tie up a worker while B2 is down.
  • Docs: docs/index-dumps.md covers the new variable and the endpoint.

Why

So the front end can publish the dumps for download, as part of releasing the index under an open licence.

How it was verified

  • make check passes. make test passes: 1689 passed, 10 skipped (run before the timeout change). After the timeout change, the dump, page API and OpenAPI tests pass.
  • New tests, against moto:
    • The listing returns finished dumps newest first, leaves out an unfinished one, and gives the correct URLs and sizes.
    • The endpoint returns the listing and serves it from the cache.
  • Subagent review covering correctness, security and trust and safety. Its one medium finding, the long B2 timeouts on the request path, is fixed here. Low finding left as is: when the cache expires, concurrent requests each refresh it. With about three dumps that costs only a few B2 requests.


Generated by Claude Code

@codecov
codecov Bot commented Oct 30, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@daoudclarke
daoudclarke force-pushed the claude/epic-johnson-ppm1oz branch from 6722bc6 to a49d0ff Compare October 31, 2026 09:01
@daoudclarke
daoudclarke force-pushed the claude/epic-johnson-ppm1oz branch from a49d0ff to 98c4374 Compare October 31, 2026 11:20
Base automatically changed from claude/epic-johnson-ppm1oz to main October 31, 2026 13:29
Adds list_dumps, which lists the finished dumps (those with a manifest) newest
first with their public URLs from MWMBL_DUMP_PUBLIC_URL, and a cached, unauthenticated
endpoint that serves it. The listing uses its own B2 client with short timeouts, since
it runs inside a web request.

No functional changes to the crawler.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DTbu4mh9Ywh6ya17exUSDV
@daoudclarke
daoudclarke force-pushed the claude/sharp-sagan-87oq8f branch from 02b8edb to 85e4036 Compare October 31, 2026 14:40
@daoudclarke
daoudclarke merged commit f175c66 into main Oct 31, 2026
7 checks passed
@daoudclarke
daoudclarke deleted the claude/sharp-sagan-87oq8f branch October 31, 2026 14:51
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

0