Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t.sh
19 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.

status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas1/**
2 * A workspace renamed: its projects move to the slug it has now. Each
3 * statement takes the current slug and one stale slug, and changes nothing
4 * once the rows have moved, so a repeated or late delivery is harmless.
5 */
6
7export type Statement = { sql: string; params: string[] };
8
9export function renameStatements(stale: string[], current: string): Statement[] {
10 return stale.flatMap((old) => [
11 // A project of the same slug made under the new name in the moment
12 // before this ran keeps its place; the older one stays put and is
13 // reported.
14 { sql: "UPDATE OR IGNORE projects SET workspace = ? WHERE workspace = ?", params: [current, old] },
15 { sql: "UPDATE projects SET repo_namespace = ? WHERE repo_namespace = ?", params: [current, old] },
16 { sql: "UPDATE OR IGNORE backfilled SET workspace = ? WHERE workspace = ?", params: [current, old] },
17 { sql: "DELETE FROM backfilled WHERE workspace = ?", params: [old] },
18 ]);
19}

This file's history is long; its oldest lines are credited to the oldest commit read.