Skip to content

WIP: watcher: add optional SQS subscription for crate index changes#3349

Draft
syphar wants to merge 78 commits into
rust-lang:mainfrom
syphar:crates-io-sqs
Draft

WIP: watcher: add optional SQS subscription for crate index changes#3349
syphar wants to merge 78 commits into
rust-lang:mainfrom
syphar:crates-io-sqs

Conversation

@syphar

@syphar syphar commented May 22, 2026

Copy link
Copy Markdown
Member

idea is:

  • infra has to provide the SQS FIFO queue, permissions for docs.rs, and credentials for crates.io
  • merge & release add docs_rs_crates_io subcrate for interaction / shared types #3357 , so crates.io can use the structs to start publishing the events
  • when we can finish up this PR, first let the SQS consumption just run in parallel (dry-run / log) to git index
  • if no errors / all fine, switch over to sqs

@syphar syphar self-assigned this May 22, 2026
@github-actions github-actions Bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label May 22, 2026
@syphar syphar changed the title watcher: add sqs sdk, add first draft for event payload structs WIP: watcher: add sqs sdk, add first draft for event payload structs May 22, 2026
syphar added 7 commits May 22, 2026 17:32
Wrap typed change payloads in a conventional event envelope with id, occurred_at, source, and schema_version.
Rename the current wire payload to ChangeV1 and make the event envelope generic for future schema versions.
Remove event source metadata and store occurred_at as an RFC 3339 OffsetDateTime.
Replace time::OffsetDateTime with chrono::DateTime<Utc> for RFC 3339 event timestamps.
syphar added 8 commits May 22, 2026 18:33
Treat duplicate version deletion events as a no-op so temporary event-based handling can safely replay them.
Add watcher config fields for an SQS queue URL and region to support an event-based path.
Use url::Url for the watcher SQS queue URL config so invalid values fail during config loading.
Update Cargo.lock after making docs_rs_watcher depend directly on url.
Remove the redundant schema_version field from the crates.io event envelope and keep versioning in the typed payloads.
@rustbot

This comment has been minimized.

Comment thread crates/lib/docs_rs_crates_io/src/events.rs
syphar added 30 commits July 2, 2026 00:59
Rename the SQS subscriber entrypoints to better reflect the transport, body-handling, and event-processing layers.
Supervise the SQS subscriber separately in mixed mode so SQS failures are logged and restarted without stopping the legacy registry watcher.
Add starter counters and histograms for SQS intake, failures, retries, processing time, event lag, and applied change types, and record them from the subscriber flow.
Add buckets around the one-minute visibility timeout so slow message handlers are easier to spot in metrics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants