migrate/supabase: accept the jobname/schedule/command pg_cron dump the docs prescribe (conformance M2) - #312
Merged
Merged
Conversation
…e docs prescribe, not only cron.schedule() (M2) docs/ai/19-migrate-supabase.md tells users to export pg_cron with a psql \copy of jobname/schedule/command, which emits TAB-separated rows. cronmap only read cron.schedule() calls, so following the manual literally produced a blocking cron_job gap and an empty jobs[]. build_jobs now runs a line pass first: a non-cron.schedule line that splits into exactly three TAB-separated fields is a dump row. Consumed rows are blanked, not removed, so the SQL pass keeps reporting the same cron.sql line numbers. Both forms funnel into one emit_job, so the schedule check, snake_casing and body gap are shared, and the cron.schedule() path is unchanged. A hand-added header row is skipped; an empty or \N jobname/schedule/command is a blocking cron_job gap rather than a guess.
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.
Docs↔codegen conformance sweep.
19-migrate-supabase.md:31promises pg_cron jobs arrive ascron.schedule()calls or a jobname/schedule/command dump, and gives the concrete\\copy (select jobname, schedule, command from cron.job) to stdoutrecipe — which emits TAB-separated rows. The migrator only parsed the SQL call form, so following the manual literally produced a blockingcron_jobgap and zerojobs[].Fix: a dump-row detector (TAB-only split into exactly 3 fields, not a
cron.schedule(line — exact because COPY TEXT escapes real tabs/newlines) feeding a sharedemit_job()lifted verbatim from the call path, so both forms share one schedule check. A hand-added header is skipped; an empty/\\Nfield is a blocking gap (never guess). Consumed rows are blanked, not removed, so the SQL pass keeps itscron.sql:Nline numbers.cron.schedule()output is byte-identical incl. line numbers. Verified against a live Postgres that the doc's recipe emits clean rows (noCOPY ntag), so the doc needs no change.Test:
the_prescribed_cron_job_dump_yields_the_same_job_as_the_cron_schedule_call. 586 lib tests pass. No version bump.