Public: anyone can read this; the crew can change it.
A forge made with template X starts with X's files #7535
commented
Live triage (automatic, not written by a person): no pillar named, so it waits behind the Later gate; name a pillar to move it.
commented
Reviewed pull #8925 at its head: ticked A forge made with starter has a repo whose tree equals scaffoldFiles(...) for that name, and its first boot enables it as an app.; A forge made with blank or no template has exactly the repos it has on main today.; A retry of the same spawn makes no second repo and no second commit.; parent.json records the template id.; No parent secret, token or issue appears in the child's template repo..
Sign in to join this conversation.
Part of the epic "Choose the template when making a new forge". Waits for the API child. Independent of the UI child.
Today the template choice is only recorded. Make the child actually begin from it.
Build
src/spawn/template_birth.ts(new): given the chosen template and the child, commit its files into a new private repo in the child's organisation, once, in the same style asstartFresh(src/actions/spawn.ts:511): a retry finds the repo and leaves it.blank: unchanged (no repo; thefreshsentence still works as today).starter: the filesscaffoldFilesreturns, named for the spawner'sfreshsentence if given, elseapp.freshsentence together: the sentence becomes the app's description on the template's files; no second repo.parent.jsonrecordstemplate: {id, repo?, tip?}so the child knows where it came from.firstBoot(src/spawn/first-boot.ts) already turns a repo whose tip declares an app into an app; nothing new there.docs/SPAWN.md).spawnForgein a few lines; do not growsrc/actions/spawn.ts.Where to put code: new files only (named below). Do not grow
src/http/api.ts,src/web/pages/repo.tsorsrc/actions/spawn.tsbeyond a call-site of a few lines;src/http/api/forges.ts,src/spawn/door.tsandsrc/web/pages/new-forge.tsmay take small edits.Done when
starterhas a repo whose tree equalsscaffoldFiles(...)for that name, and its first boot enables it as an app.blankor no template has exactly the repos it has on main today.parent.jsonrecords the template id.Named tests (new
test/spawn-template-birth.test.ts):a forge made with starter has the starter's files,a forge made with blank is unchanged,a retry makes no second template repo,parent.json records the template,the template repo holds no parent secrets,first boot enables the template app. Existingtest/spawn.test.ts,test/spawn-first-boot.test.tsandtest/spawn-fresh-forks.test.tsstay green.