Skip to content

fix(seeds): backfill application submission timestamps - #972

Merged
thinkclay merged 2 commits into
Scaffald:mainfrom
wbraithwaite-nvidia:fix/seed-application-submitted-at
Oct 5, 2026
Merged

thinkclay merged 2 commits into
Scaffald:mainfrom
wbraithwaite-nvidia:fix/seed-application-submitted-at

Conversation

@wbraithwaite-nvidia

Copy link
Copy Markdown

Summary

  • Add trailing 017_seed-application-submitted-at.sql seed.
  • Backfill seeded applications with the same COALESCE(score_calculated_at, created_at) rule as migration 359.
  • Keep the fix centralized so later application seed inserts are covered.

Verification

  • pnpm lint:migrations passed.
  • git diff --check passed.
  • Fresh pnpm supa db reset --yes passed after starting the local Supabase stack.
  • Local database query: submitted_at IS NULL count = 0.
  • Local database query: Unicorn submitted applications = 12.
  • Pre-push API gate: 163 passed, 0 failed.

The full pre-push hook also reported an Nx project-graph failure in the existing workspace; migration, API, and database reset checks passed.

Closes #966

@thinkclay

Copy link
Copy Markdown
Contributor

Reviewed. The change is correct and I'd merge it. Checked rather than assumed:

Two notes, neither blocking.

CI has validated nothing here. The head commit has exactly two check runs, both skipped, and its combined status is pending with zero statuses — that is what GitHub's UNSTABLE is reporting, not a failure. packages/supabase/seeds/** is in no workflow's path filter, so no stack was built and no test ran. That is worth fixing on its own: the api-tests job seeds its stack from exactly these files, so a broken seed would redden that suite, and today a seed-only change cannot trigger it. I'm adding packages/supabase/seeds/** to that filter in the #969 PR; once it lands, re-running the checks here will actually exercise this.

Your Nx project-graph failure is benign. That is the missing-node_modules artifact in a fresh worktree — the root prepare hook runs git submodule update, and nx cannot load its graph until pnpm install has run. It bit me twice today. Your migration/API/reset checks passing is the real signal.

I did not reproduce supa db reset locally: another session is using the shared stack and a reset would destroy its data. The live DB shows 16 applications with 0 null submitted_at, but that is equally consistent with the manual UPDATE described in #966, so I am not counting it as verification of this PR.

thinkclay added a commit that referenced this pull request Oct 5, 2026
…m cache (#969) (#973)

The gate was green in CI and red locally on the same commit. My own
diagnosis in #969 was wrong: the zod TS2353 at teams.router.ts:2478 was
always visible to CI and was what that file's baseline of 1 accounted
for. Nothing was hidden.

The flapping diagnostic is TS2589, "type instantiation is excessively
deep". It fires when the checker exhausts its instantiation budget, and
the budget left depends on what is already in the type cache — so the
answer depends on DENO_DIR warmth. Measured on 1a735c9, same worktree,
same minute, trpc only: warm 11 errors (824 TS2589 + 2478 TS2353), cold
10 (2478 only). Nothing else differed.

TS2589 is now excluded from the counted diagnostics and printed on its
own advisory line. A signal that cannot be reproduced cannot be
ratcheted; "may only come down" means nothing if the number depends on
cache state. The cost — a genuinely new deep instantiation no longer
fails this gate — is written into the script.

That exposed a second flapping file: api/routes/user-profiles.ts carries
one too, so api had been oscillating 333/334 independently of trpc.

The real bug underneath is fixed as well. z.date({ message }) is zod 4
syntax; every edge-function import map pins npm:[email protected], where the
unknown key is ignored, so that validation message never reached a
caller. invalid_type_error is the 3.x spelling. teams.router.ts drops to
zero and leaves the baseline.

Baseline tightened, never raised: user-profiles.ts 12 -> 11,
teams.router.ts removed. 378 total, down from 380.

Verified by running warm and with a fresh DENO_DIR on this branch: every
counted number identical, both exit 0, and the only difference between
the runs is the advisory line itself.

Also adds packages/supabase/seeds/** to the api-tests path filters. That
job seeds its stack from seeds/*.sql, so a broken seed reddens every
suite in it, yet a seed-only change could not trigger the workflow at
all — #972 got two skipped checks and a pending status, which reads as
"nothing to see" rather than "nothing ran". Same class of bug, one line.

Co-authored-by: Claude Opus 5 <[email protected]>
@thinkclay
thinkclay merged commit 06b683f into Scaffald:main Oct 5, 2026
14 of 15 checks passed
thinkclay added a commit that referenced this pull request Oct 5, 2026
…ng red (#986) (#990)

A pull request from a fork gets a read-only GITHUB_TOKEN regardless of
the `permissions: pull-requests: write` at the top of the workflow, so
`github.rest.issues.createComment` throws "Resource not accessible by
integration". With no guard and no continue-on-error that took the whole
benchmark job down, and with it REST API Tests — every fork PR red for a
step that only posts a comment.

#972 surfaced it: a four-line SQL seed from an outside contributor, its
own Run API Tests green, workflow red. Step outcomes for the same job on
a fork (#972) and a same-repo branch (#973) differ in exactly one place,
the comment step.

Skipped rather than tolerated. continue-on-error would also stop it
failing the build, but silently, and a step that cannot work on forks
should say so. Upload Benchmark Results keeps the figures either way.

Swept the other workflows for the same shape and this was the only one:
dependabot-automerge is pull_request_target (base-repo token),
apple-secret-rotate is workflow_dispatch, codecov already carries
fail_ci_if_error: false and posts through its own app, and the
lighthouse action is label-triggered with no githubToken.

Verified the expression against both context shapes GitHub will supply:
runs for a same-repo PR, skips for a fork. This branch is same-repo, so
its own run exercises only the runs path; the skip path gets its real
test on the next fork contribution, and the step being skipped is the
one that was failing.

Does not touch #987 — the benchmark this posts has never produced any
output, which needs its own decision.

Co-authored-by: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Seeded applications have no submitted_at, so the local employer pipeline is empty since #905

2 participants