Skip to content

Templates: failed seed left marked up-to-date forever #150

Description

@dascalescuro

Symptom

scripts/prepare-templates.ts creates a tpl-* branch, then seeds it. If create succeeds and a later step fails (awaitConnectionString, resolveBranchDsn, or seedTemplate), the next deploy/run sees the branch name in listBranches() and logs it as up-to-date, skipping recreate/re-seed.

Learners who fork that template get an empty or broken sandbox for that lesson.

Red loop (logic already exercised)

  1. Create template name not in existing → createBranch succeeds → add name to Xata.
  2. Seed (or DSN) throws → script exits non-zero.
  3. Re-run: existing.has(name) → skip with (up-to-date).

Where

  • scripts/prepare-templates.ts (~lines 219–237) — existence check only; no “seeded successfully” marker / delete-on-failure

Suggested direction

On failure after create: delete the branch (or mark incomplete). On success-only: treat as up-to-date. Alternatively re-seed / verify seed before skipping.

Notes

Diagnosed with /diagnosing-bugs. Deploy impact if template prep fails mid-lesson after the branch already exists.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions