Skip to content
31 linesCodeBlameRaw

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

The artifacts service is services/artifacts, the Worker g1t-artifacts, bound as ARTIFACTS by the API, the site and the agents; its live rooms move to it with a Durable Object transfer from g1t-docs-service, and its database, bucket, indexes and queue keep their names. The git store's binding and settings are GITSTORE, its ops scripts gitstore-*, and workflow run artifacts keep their compatible API under run_artifacts modules. The deploy tool puts a Worker that has never deployed before the Workers in its stage that bind to it, and the deploy guide gives the cutover runbook.1import assert from "node:assert/strict";
2import { test } from "node:test";
3
4import { freeSlug, linkedPageIds, pageIdFrom, pageSlug, slugify, validSpaceSlug } from "./slugs.ts";
5
6const id = "pag_01jb2k7x9hfq0b3zj0f5s2m8ra";
7
8test("page slugs carry the id, so renames keep links working", () => {
9 assert.equal(pageSlug("Release checklist: v2!", id), `release-checklist-v2-${id}`);
10 assert.equal(pageSlug("", id), id);
11 assert.equal(pageIdFrom(`anything-${id}`), id);
12 assert.equal(pageIdFrom(id), id);
13 assert.equal(pageIdFrom("no-id-here"), null);
14});
15
16test("slugify drops accents and punctuation", () => {
17 assert.equal(slugify("Café Ops — Runbooks"), "cafe-ops-runbooks");
18});
19
20test("space slugs avoid taken and reserved names", () => {
21 assert.equal(freeSlug("Engineering", new Set()), "engineering");
22 assert.equal(freeSlug("Engineering", new Set(["engineering"])), "engineering-2");
23 assert.equal(freeSlug("Search", new Set()), "search-2");
24 assert.equal(validSpaceSlug("eng-docs"), "eng-docs");
25 assert.equal(validSpaceSlug("-bad"), null);
26 assert.equal(validSpaceSlug("trash"), null);
27});
28
29test("links to pages are found by their ids", () => {
30 assert.deepEqual(linkedPageIds(`See [the plan](/acme/-/docs/eng/plan-${id}) and [again](${id}).`), [id]);
31});