See it run
Evidence across the bugs reviewers miss.
Real review output from Postil's own repositories. Every card links to the public pull request it came from.
Migration safety
A unique index that would fail against production duplicates
A migration adds a unique index to close a race condition the PR is fixing. The race could already have produced duplicate rows that make the new index fail.
Excerpt of the reviewed commit diff
@@ -0,0 +1,3 @@+CREATE INDEX "installations_org_idx" ON "installations" USING btree ("org_id");--> statement-breakpoint+CREATE INDEX "org_members_user_idx" ON "org_members" USING btree ("user_id");--> statement-breakpoint+CREATE UNIQUE INDEX "organizations_github_org_id_idx" ON "organizations" USING btree ("github_org_id");\ No newline at end of fileWhat Postil did
The migration adding a unique index on organizations.github_org_id risks failing in production if duplicate rows already exist from the pre-fix race condition. Verify the production dataset is clean or add a deduplication step before the CREATE UNIQUE INDEX.
Add deduplication before unique index migration
The new CREATE UNIQUE INDEX on organizations.github_org_id will fail if the database already contains duplicate non-null values. The PR description explicitly states that concurrent installation webhooks could have created duplicate organization rows for the same GitHub org before this fix. Run SELECT github_org_id, COUNT(*) FROM organizations WHERE github_org_id IS NOT NULL GROUP BY github_org_id HAVING COUNT(*) > 1; against the production database; if any rows are returned, merge the duplicates and update referencing foreign keys before this migration is applied.