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.

Commit

Work items name a deleted origin repository instead of a blank link

The move kept 42 of flagon-io's items from a repository deleted before work items, with no path left to keep: the item page showed an empty link to / and the chips an empty name. They now say a deleted repository, with nothing to open or unlink, on the site and the phone. The work service's wrangler.jsonc names the migration where it moved.

G1T-Session:
ses_01m560bz6eeqc8v1hrrha03pap
syntaqxcommitted Parent4a47b56Browse files
6 files+20−70/6 viewed
+2−1
155155 <Badge label="Not landed" tone="warn" />
156156 ) : null
157157 }
158− onPress={() => setPicked(repo)}
158+ // A deleted repository has nothing to open or unlink.
159+ onPress={repo.path ? () => setPicked(repo) : undefined}
159160 />
160161 {repo.pulls.map((pull) => (
161162 <View key={`${pull.repo}#${pull.number}`} style={{ paddingLeft: space.xl }}>
+2−0
4848
4949 /** A repository's name in a chip: just the name when it is in the item's workspace. */
5050 export function repoName(path: string, workspace: string): string {
51+ // A repository deleted before work items had no path left to keep.
52+ if (!path) return "deleted repository";
5153 const [owner, name] = path.split("/", 2);
5254 return name && owner.toLowerCase() === workspace.toLowerCase() ? name : path;
5355 }
+1−1
4949 return (
5050 <span className={cn("inline-flex min-w-0 items-center gap-1", className)}>
5151 {shown.map((repo) => (
52− <Hint key={repo.repoId} label={`${repo.path}: ${ROLE_LABELS[repo.role].toLowerCase()}${repo.landed ? ", landed" : ""}`}>
52+ <Hint key={repo.repoId} label={`${repo.path || "A deleted repository"}: ${ROLE_LABELS[repo.role].toLowerCase()}${repo.landed ? ", landed" : ""}`}>
5353 <span
5454 className={cn(
5555 "inline-flex max-w-32 min-w-0 items-center gap-1 rounded-md border px-1.5 py-px font-mono text-[0.6875rem] leading-4",
+5−0
172172 }
173173
174174 /** A repository's name in its workspace: `web` for `acme/web` in `acme`, the whole path elsewhere. */
175+/** What a link to a repository that is gone, with no path kept, is called. */
176+export const DELETED_REPO = "deleted repository";
177+
175178 export function shortPath(path: string, workspace: string): string {
179+ // A repository deleted before work items had no path left to keep.
180+ if (!path) return DELETED_REPO;
176181 const [namespace, name] = path.split("/");
177182 return name && namespace?.toLowerCase() === workspace.toLowerCase() ? name : path;
178183 }
+9−4
341341 return (
342342 <li className="px-3 py-3 sm:px-4">
343343 <div className="flex min-w-0 items-center gap-2">
344− <Link to={`/${repo.path}`} className="min-w-0 truncate font-mono text-sm font-medium hover:text-accent">
345− {repo.path}
346− </Link>
344+ {repo.path ? (
345+ <Link to={`/${repo.path}`} className="min-w-0 truncate font-mono text-sm font-medium hover:text-accent">
346+ {repo.path}
347+ </Link>
348+ ) : (
349+ // Deleted before work items: nothing to link to, and no name kept.
350+ <span className="min-w-0 truncate text-sm text-muted">A deleted repository</span>
351+ )}
347352 <RoleBadge role={repo.role} />
348353 {repo.legacyNumber != null && (
349− <Hint label={`It was ${repo.path}#${repo.legacyNumber} before work items, and that still leads here.`}>
354+ <Hint label={repo.path ? `It was ${repo.path}#${repo.legacyNumber} before work items, and that still leads here.` : `It was #${repo.legacyNumber} there before work items.`}>
350355 <span className="shrink-0 text-xs text-faint">was #{repo.legacyNumber}</span>
351356 </Hint>
352357 )}
+1−1
88 "placement": { "mode": "off" },
99 "main": "build/index.js",
1010 // Moves repositories' issues into their workspaces' work items, a page
11− // at a time, until done (src/work_migration.rs); `migrate_work_items`
11+ // at a time, until done (src/items/migration.rs); `migrate_work_items`
1212 // runs the same step at once.
1313 "triggers": { "crons": ["*/5 * * * *"] },
1414 "build": { "command": "node ../../scripts/build-rust-worker.mjs" },

Comments

Sign in to comment.