Public: anyone can read this; the crew can change it.
Admins mark which repositories are offered as templates for new forges #7536
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.
Sign in to join this conversation.
Part of the epic "Choose the template when making a new forge". Optional; waits for the birth child, so a repo-backed template can be copied.
Today only built-in templates exist. Let a site admin offer any repo on this forge, so the list grows without a release.
Build
src/core/forge_templates.ts(new): a table of offered repos (repo_id,title,says,marked_by,marked_at) with a migration,listOffered,offer,withdraw. Admin only. Only a repo the admin can read and whose tip declares an app (parseManifest, as infirst-boot.ts).src/spawn/templates.tsincludes offered repos assource: "repo", idsrepo:<owner>/<name>; a repo made private or deleted after being offered drops out of the list and a spawn naming it is a 422.POST /api/v1/forge-templates {repo, title, says}andDELETE /api/v1/forge-templates/:id, plus MCPoffer_template/withdraw_template(admin,rw); put the routes insrc/http/api/forge_templates.ts(new), not inapi.ts.src/web/pages/forge-template-setting.ts(new); call it from settings in one line, do not growrepo.ts.{id, repo, tip}.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
GET /api/v1/forges/templatesand the New forge picker list it with its sentence.parent.json.Named tests (new
test/forge-templates.test.ts):only an admin offers a template,a repo without an app manifest is refused,an offered repo appears in the list and the picker,a forge made from an offered repo has its files at the tip,a withdrawn or private repo drops out.