feat(integrations): Create ExternalActor from public GH email opportunistically#116737
Conversation
4568de3 to
8e54a6b
Compare
|
This PR has a migration; here is the generated SQL for for --
-- Add field public_email_queried_at to commitauthor
--
ALTER TABLE "sentry_commitauthor" ADD COLUMN "public_email_queried_at" timestamp with time zone NULL; |
| # (e.g. GitHub) in an attempt to create an ExternalActor mapping. Null means | ||
| # never queried. Used to rate-limit these expensive lookups so we only retry | ||
| # stale authors. See sentry.integrations.github.tasks.query_commit_author_public_emails. | ||
| public_email_queried_at = models.DateTimeField(null=True) |
There was a problem hiding this comment.
Does it make sense to give this a hardcoded default date (maybe Jan 01, 2026) so that we can mark this column as not null? It will be overwritten once we start performing these checks, so might be worthwhile to avoid a null
There was a problem hiding this comment.
I'd say sure, but I think the cost of backfilling a default for 5411672 rows (yikes!) makes it not worth it. There may be many rows where we never set this--I think a LOT of CommitAuthors are extremely old and no longer generating commits we care about, so they'll never be checked.
There was a problem hiding this comment.
I guess it depends if we care if the older rows just have the sentinel value forever. We don't really need to perform the backfill if we just set a static default for existing rows
wedamija
left a comment
There was a problem hiding this comment.
lgtm, I'll leave it up to you about whether you want to try and make the column not-nullable
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ef8ec067411564643ee1d0b5105a55c9feca7de1. Configure here.
ef8ec06 to
bd15d5f
Compare
|
This PR has a migration; here is the generated SQL for for --
-- Add field public_email_queried_at to commitauthor
--
ALTER TABLE "sentry_commitauthor" ADD COLUMN "public_email_queried_at" timestamp with time zone NULL; |
bd15d5f to
c064345
Compare

Add
CommitAuthor.public_email_queried_atto track if/when we've checked a given author's GH profile for a public email address.For
CommitAuthors pushing new commits (whether they're new or old), if we haven't checked their GH profile in the past 30 days, check and create anExternalActormapping if their public email maps to a Sentry user in the given org.