Skip to content

Resolve a {"repo": …} events notify under a store prefix - #105

Open
jilio wants to merge 1 commit into
tobi:mainfrom
jilio:fix/events-notify-prefix
Open

jilio wants to merge 1 commit into
tobi:mainfrom
jilio:fix/events-notify-prefix

Conversation

@jilio

@jilio jilio commented Oct 11, 2026 •

Copy link
Copy Markdown

Problem

POST /_events/notify with the plain {"repo": "o/r"} body builds the key repos/o/r/manifest.pb and resolves it like a bucket notification. manifest_repo requires that key to start with store.prefix. With a non-empty prefix it never does, so the notify is acked with an empty report (200 []). Events then wait for the sweep (default 5 min) and nothing says why. GCS, S3 and {"key": …} notifications are fine, because they carry the full, prefixed object key.

Fix

{"repo": …} now builds the key that repository's manifest has in this bucket, prefix included. Keys in bucket notifications and in {"key": …} stay bucket object keys. docs/EVENTS.md and the module doc now say which shape is which.

Tests

  • The test harness applies store.prefix the way walgit_store::from_config does for real backends. This changes nothing for the existing tests, which leave the prefix empty.
  • notify_wakes_the_bridge_under_a_store_prefix (tests/events.rs) runs a server under prefix tenant-a. It sends each of the four body shapes after a push and checks the bridge publishes. It also checks that an unprefixed key is acked and ignored. Before this change {"repo": "t/r"} answered [] and woke nothing.
  • manifest_object_names (bridge.rs unit test) resolves all four shapes under a non-empty prefix.

Checked on Linux (Rust 1.97.1, git 2.47.3, 2-CPU container, non-root). This branch alone passes fmt, clippy (walgit-server, all targets) and the events suite. just ci passes on a merge of this branch with my two other open fixes (#104, #106).

🤖 Generated with Claude Code

POST /_events/notify turns a plain {"repo": "o/r"} into the key
repos/o/r/manifest.pb and resolves it like a bucket notification, which
must start with store.prefix. With a non-empty prefix the key never
matches: the notify is acked with an empty report and the bridge waits
for its sweep (default 5 min), silently. Bucket notifications are fine:
they carry the prefixed object key.

Build the key the repository's manifest has in this bucket, prefix
included. Keys in bucket notifications and {"key": …} stay bucket object
keys; EVENTS.md now says so.

The test harness now applies store.prefix the way
walgit_store::from_config does for real backends, so a server test can
run under a prefix. notify_wakes_the_bridge_under_a_store_prefix sends
all four shapes to a prefixed server (before: {"repo": "t/r"} answered
[] and woke nothing); the bridge unit test resolves them under a prefix.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant