GitHub Partial Recompute
Goal
When GitHub sends webhook events, Claustrum recomputes permissions only for impacted repositories instead of running a full workspace-wide recompute.
Supported Events
installation_repositoriesteammembershiprepositoryteam_addteam_remove
Event -> Affected Scope
-
installation_repositories- reads
repositories_added+repositories_removed - runs repo sync for only those repo names
- recomputes permissions for linked affected repos only
- reads
-
team/membership- extracts
team.id - finds affected repos from
github_repo_teams_cache - recomputes only those repos
- extracts
-
repository(action=renamed)- updates
github_repo_links.full_name - no permission recompute by default
- updates
-
team_add/team_remove- extracts repository + team
- invalidates repo/team caches
- recomputes affected repo only
Cache Invalidation
-
team-related events:
- delete
github_team_members_cachefor the team
- delete
-
repo-team related events:
- delete
github_repo_teams_cachefor affected repo ids
- delete
-
before partial recompute:
- delete
github_permission_cachefor affected repo ids
- delete
Debounce
To avoid burst recomputation, repeated recompute for the same workspace_id + repo_id is debounced with a short window (8 seconds).
Worker Flow
Operations Notes
- delivery dedupe is guaranteed by
delivery_idunique constraint - failed events retry up to 3 attempts
- signature failures return
401and are audited asgithub.webhook.signature_failed - webhook mode (
add_only/add_and_remove) controls how webhook-driven role updates are applied