Seed: skill name conflict on create is a skip, not fatal - #283
Merged
Conversation
Reproduces the live incident: a half-seeded tenant re-running `workbench seed` hit "409 already exists" on skill creation and aborted the whole run, even though the hub's own error advice was to re-run the same command. A step that already succeeded must never kill a re-run.
plantDefaultSkills checked for an existing skill by name before creating one, but never handled a 409 from the create call itself — so a row the lookup missed (an inherited/other-scope row, or a race with a concurrent seed pass) turned "already exists" into a fatal CliError instead of a skip. Every other seed step (grants, workflow assets, catalog rows) already treats a name-conflict 409 as already-done; skills now match.
Document the skill-conflict skip alongside the existing seed reconciliation properties, and explain why a failed publish can no longer strand a dangling package-registry asset, plus how re-seeding repairs a tenant whose asset survives from before that ordering shipped.
6 tasks
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
Fixes the seed-idempotency half of tonight's outage: a half-seeded
tenant re-running
workbench seedhit409 already existsondefault-skill creation and aborted the whole run, even though the
hub's own error advice was to re-run the same command. Every other
seed step (grants, workflow assets, deployments, catalog rows) already
treated a name-conflict
409as "already done" —plantDefaultSkillswas the one holdout.
plantDefaultSkills(packages/hub-client/src/seed.ts) now skips ona
409from the create call, matching the pattern every other stepuses.
and fails against the pre-fix code.
docs/seed-reconciliation.mdgains a section for defaultskills, plus a section explaining why
publishCorbitsToolsRegistrycan no longer strand a dangling
package-registryasset goingforward (the freshness check already runs before the asset is
created), and why re-running
workbench seedrepairs a tenant whoseasset survives from before that ordering shipped — a repo with no
commits answers an empty tarball list, so a re-run republishes
everything and writes the first commit.
Not in this PR
Filed as follow-ups on CL-6575:
workbench seedagainst the live broken tenant(
tnt_4799af5615d7fa0eb995c224bc99253a) to confirm the repodirectory gets created — I don't have admin credentials for the
running dev stack.
SessionLaunchError's raw message into something aperson reads as true, rather than "Myra didn't reply" — needs its
own investigation into where launch failures actually surface in
the product.
ordering structurally (currently only confirmed by reading git
history).
Test plan
bun testinpackages/hub-client— 164 passtsc --noEmitinpackages/hub-client— cleaneslinton touched files — cleanbun testinpackages/tool-registry-publish— 61 pass (unchanged)bun testinpackages/cli— 27 pass (unchanged)CL-6575