fix(ci): typecheck auto-synced Supabase types before pushing to main - #2888
Draft
posthog-eu[bot] wants to merge 1 commit into
Draft
fix(ci): typecheck auto-synced Supabase types before pushing to main#2888posthog-eu[bot] wants to merge 1 commit into
posthog-eu[bot] wants to merge 1 commit into
Conversation
The sync_schema_types job regenerated the generated Supabase types from the prod project and pushed them straight to main with [skip ci] and no verification. Because prod is often behind local migrations, a regeneration can drop columns the backend still references, breaking `bun typecheck` on plain main and blocking the next contributor's CI. Gate the job on its own output: install deps and run `bun typecheck` after `bun schemas` / `bun types` and before the commit, so drift that doesn't compile fails the job instead of landing. Drop the [skip ci] tag now that the commit is verified before it lands. Generated-By: PostHog Code Task-Id: 579264d3-898f-4371-af17-ca71aa62de32
|
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
sync_schema_typesjob regenerates Supabase types from prod and pushed them straight tomainwith[skip ci]and no typecheck — so drift that doesn't compile lands unverified and reddensmainfor the next contributor (who eats a lint/typecheck failure they didn't cause).devicestypes region on ≥5 occasions since March; one (454a345cc) brokebun typecheckon plainmainand needed a reactive cleanup PR (fix(types): restore device country code #2659).[skip ci]also means no deploy fires) — the cost is entirely on engineers blocked by a redmain.Fix — gate the job on its own output:
bun typecheckonly when drift is detected, before the commit — the defaultbash -eo pipefailshell fails the job (and skips the push) when the types don't compile.bun install --frozen-lockfilebecausetypecheckneeds deps.[skip ci]: the commit is now verified in-job before it lands.Note
tests.ymlusesbranches-ignore: [main, development]forpush, so it does not run on a direct push tomain. The reliable protection is therefore the in-job typecheck gate, not the[skip ci]removal. Dropping the tag newly triggers onlycodspeed.yml(push-to-main benchmarks) on the auto-sync commit; it does not re-trigger this workflow (all jobs already skipchore(auto-sync):commits) and no deploy fires (build_and_deploy.ymlruns on tags only).This does not fix the underlying drift (prod schema behind local migrations) — it stops that drift from landing unverified.
Test plan
mainand confirming the job fails rather than pushing when regenerated types don't compile.Screenshots
N/A — CI workflow change.
Checklist
bun run lint:backend && bun run lint.accordingly.
my tests
Created with PostHog Desktop from this inbox report.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.