feat: resolve GitHub webhook user_id — replace default_user with repo-mapped identity#41
Merged
Merged
Conversation
…into staging_new
thedgarg31
added a commit
to thedgarg31/lpi-platform
that referenced
this pull request
Jun 26, 2026
…fe-Atlas#41) - Updated signal ingestion diagram to show 3 signal paths: GitHub webhook (auto, repo_db resolves user_id), manual POST, external sources - Updated end-to-end trace: step 2 now shows track-repo populating repo_db, step 4 shows webhook resolving user_id from repo_db instead of default_user - Updated GitHub Auth API table with repo_db explanation note - Webhook now fully wired: GitHub event -> activity_signals -> recommendations
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
GitHub webhook events (PR merged, PR reviewed, commit pushed) were being
received by
webhooks.pybut never saved to the database. The commented-outsave code had
"user_id": "default_user"hardcoded — there was no mechanismto know which platform user the incoming webhook belonged to.
Solution
Added a reverse mapping (
repo_db) ingithub_auth.pythat stores"owner/repo" → user_idwhenever a user registers a webhook via/track-repo.webhooks.pynow readsrepository.full_namefrom the incoming payload,looks up the real
user_idfrom that mapping, and saves the signal.Changes
github_auth.py— addedrepo_db: dict[str, str]; populated on/track-reposuccess (including 422 "already exists"); cleared on/disconnect-repowebhooks.py— un-commented and rewired the signal save block; importsrepo_db,store,Signal; skips silently (with warning log) if therepo is not registered; saves a proper
Signalobject with the realuser_idBehaviour
a console warning (no crash, no phantom data)
Known limitation
repo_db(andtoken_db) are in-memory. A server restart clears allregistered repos — users would need to re-register via
/track-repo.This is a pre-existing limitation of the architecture, not introduced here.