md exports never delete R2 objects for moved or removed pages, so MCP docs search returns dead pages

Đang mở
#20,966 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript
Lĩnh vực
build-system, cloud

Hướng nghiên cứu

Start in scripts/generate-md-exports.mjs: uploadToCFR2 sets the bucket around line 96, existingFilesOnR2 is built at lines 697-715, and the only existing cleanup (lines 950-975) touches local cache files. Add a step that deletes R2 keys present in existingFilesOnR2 but not produced by the build, then plan a one-off cleanup of current stale keys. Done means a full build with R2 credentials leaves no bucket keys without a matching page. Confirm the AutoRAG data source with someone who has Cloudflare access first.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

scripts/generate-md-exports.mjs uploads each page's markdown to the sentry-docs R2 bucket (uploadToCFR2, bucket set at :96) and lists the bucket's existing keys to skip unchanged files (:697-715). It never deletes an R2 object whose page the build no longer produces; the only cleanup removes local cache files (:950-975).

The Sentry MCP search_docs tool searches the sentry-docs AutoRAG index (getsentry/toolkit packages/mcp-cloudflare/src/server/routes/search.ts:166), which likely reads this bucket. It keeps returning pages that redirect or are gone, often as the top result:

Search query Top result docs.sentry.io today
connect Sentry MCP server client setup ai/mcp.md 308 to https://mcp.sentry.dev/
connect Sentry MCP server client setup product/sentry-mcp.md 301 to https://mcp.sentry.dev/
explore metrics product/explore/metrics.md soft 404
uptime monitoring setup product/uptime-monitoring.md soft 404
seer issue fix product/ai-in-sentry/seer/issue-fix.md soft 404

Agents then fail to fetch those pages: in the last 14 days, failed get_doc calls include product/explore/metrics.md (40), ai/mcp.md (28) and product/sentry-mcp.md (19).

Suggested fix

After a full build with R2 credentials, delete R2 keys that the build didn't produce (keys in existingFilesOnR2 with no matching output file), and run a one-off cleanup of the current stale keys. The AutoRAG index then drops them on its next sync.

Not verified: that the AutoRAG index's data source is this bucket. Someone with Cloudflare access to the MCP account can confirm.

MCP-side tracking: getsentry/toolkit#2491

via automation evt_905b9c478746fd9deeb853f85ad7441b · Run ID dispatch_00354f1fee745b34eb351180b5db6308.

--

View Session [Sentry]

Ngôn ngữ chính
MDX
Star
451
Fork
1.7k
Merge trung bình
1 ngày 10 giờ
Pull request đã merge (30 ngày)
566

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của getsentry/sentry-docs

Tất cả issue của getsentry/sentry-docs

Issue tương tự

Thêm issue về Build System

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.