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

Name work items in the integrations and Ask contracts

An integration's delivery names the work item it opened as workspace#number, links are looked up by workspace and number, and a ticket is imported into a workspace, filed from a repository when one is given and landing in the targets named. Ask's page and its session proposals name a work item by its number in the workspace.

G1T-Session:
ses_01m566c37beds8hfham3jasw2a
syntaqxcommitted Parent758af18Browse files
6 files+71−390/6 viewed
+14−8
323323 /// Where the person asking is in g1t, so the answer is about their work.
324324 #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
325325 pub struct AskPage {
326− /// The page's path, such as `/acme/web/issues/12`.
326+ /// The page's path, such as `/acme/-/work/12`.
327327 #[serde(default)]
328328 pub path: Option<String>,
329329 #[serde(default)]
330330 pub repo: Option<RepoPath>,
331+ /// The workspace of a page that is not a repository's, such as a work
332+ /// item's. With `repo`, the repository's.
331333 #[serde(default)]
332− pub issue: Option<u32>,
334+ pub workspace: Option<String>,
335+ /// A work item, by number in the workspace.
336+ #[serde(default)]
337+ pub item: Option<u32>,
333338 #[serde(default)]
334339 pub pull: Option<u32>,
335340 /// The browser's IANA time zone, such as `America/Denver`: what
431436 /// What the answer drew on, cited first. Sent once, before `done`.
432437 Sources { sources: Vec<AskSource> },
433438 /// Work Ask proposes to hand to a session in the person's own harness:
434− /// on an issue, or on a new one with `title` and `body`. Nothing has
435− /// started; the person starts it, or copies the command, from the card
436− /// the answer shows. `mode` is `plan`, `implement` or `review`.
439+ /// on a work item (by number in `repo`'s workspace), or on a new one
440+ /// with `title` and `body`. Nothing has started; the person starts it,
441+ /// or copies the command, from the card the answer shows. `mode` is
442+ /// `plan`, `implement` or `review`.
437443 ///
438444 /// With `new_repository`, `repo` does not exist yet: the card creates
439445 /// it (`private` or public), turns on its deployments when `deploy`,
440− /// then opens the issue and starts the session, which pushes the first
441− /// version to the default branch, and so deploys it.
446+ /// then opens the work item and starts the session, which pushes the
447+ /// first version to the default branch, and so deploys it.
442448 Proposal {
443449 id: String,
444450 repo: String,
445− issue: Option<u64>,
451+ item: Option<u64>,
446452 title: Option<String>,
447453 body: Option<String>,
448454 mode: String,
+29−16
11 //! The integrations service: a workspace's connections to systems outside
22 //! g1t, and everything that crosses between them.
33 //!
4−//! - **Alerts.** Sentry, Datadog or any signed webhook opens an issue in a
5−//! repository, once per problem however often it fires.
4+//! - **Alerts.** Sentry, Datadog or any signed webhook opens a work item
5+//! filed from a repository, once per problem however often it fires.
66 //! - **Trackers.** A Jira or Linear key, such as `TECH-1234`, resolves to the
7−//! ticket: people and their tools read it, people import it as an issue,
7+//! ticket: people and their tools read it, people import it as a work item,
88 //! and when the work lands the ticket is told.
99 //!
1010 //! A workspace's AI providers and Ask g1t are kept by the same service but
9191 #[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
9292 #[serde(rename_all = "snake_case")]
9393 pub enum ProviderKind {
94− /// Problems that become issues.
94+ /// Problems that become work items.
9595 Alerts,
9696 /// Tickets that people read and import.
9797 Tracker,
102102 #[derive(Clone, Debug, Serialize, Deserialize)]
103103 #[serde(rename_all = "camelCase")]
104104 pub struct ConnectionConfig {
105− /// For alerts: the repository issues are opened in, `owner/name`. For a
106− /// tracker: where an imported ticket goes when no repository is named.
105+ /// For alerts: the repository work items are filed from (their
106+ /// origin), `owner/name`. For a tracker: the origin of an imported
107+ /// ticket's work item when no repository is named.
107108 #[serde(default, skip_serializing_if = "Option::is_none")]
108109 pub repo: Option<String>,
109− /// For alerts: the label put on each issue opened. `bug` when unset.
110+ /// For alerts: the label put on each work item opened. `bug` when unset.
110111 #[serde(default, skip_serializing_if = "Option::is_none")]
111112 pub label: Option<String>,
112113 /// Tell the outside system when the work lands: resolve the Sentry
182183 /// `opened`, `updated`, `reopened`, `ignored` or `refused`.
183184 pub outcome: String,
184185 pub detail: String,
185− /// The issue it opened or updated, `owner/name#number`.
186− pub issue: Option<String>,
186+ /// The work item it opened or updated, `workspace#number`.
187+ pub item: Option<String>,
187188 }
188189
189190 /// Something outside g1t, fetched as it is now. Its text was written outside
204205 pub fetched_at: String,
205206 }
206207
207−/// An issue's tie to something outside g1t.
208+/// A work item's tie to something outside g1t.
208209 #[derive(Clone, Debug, Serialize, Deserialize)]
209210 #[serde(rename_all = "camelCase")]
210211 pub struct Link {
326327 pub reference: String,
327328 }
328329
329−/// `import`: opens an issue from a ticket. Returns `Outcome<Imported>`.
330+/// `import`: opens a work item in `workspace` from a ticket, filed from
331+/// `repo` when given (its origin; `workspace` may then be empty, meaning
332+/// the repository's), with `targets` as where the work is meant to land.
333+/// Members of the workspace only. Returns `Outcome<Imported>`.
330334 #[derive(Debug, Serialize, Deserialize)]
331335 pub struct ImportArgs {
332336 pub actor: User,
333− pub repo: RepoPath,
337+ #[serde(default)]
338+ pub workspace: String,
339+ #[serde(default)]
340+ pub repo: Option<RepoPath>,
341+ #[serde(default)]
342+ pub targets: Vec<RepoPath>,
334343 pub reference: String,
335344 }
336345
337346 #[derive(Clone, Debug, Serialize, Deserialize)]
338347 pub struct Imported {
348+ /// The work item's workspace and number.
349+ pub workspace: String,
339350 pub number: u32,
351+ /// The ticket, as fetched.
340352 pub item: ContextItem,
341353 /// False when the ticket had been imported already, and `number` is
342− /// that issue.
354+ /// that work item.
343355 pub created: bool,
344356 }
345357
346−/// `links`: what an issue is tied to outside g1t. Returns `Vec<Link>`.
347−/// Callers must have checked the viewer may see the issue.
358+/// `links`: what work item `number` of `workspace` is tied to outside
359+/// g1t. Returns `Vec<Link>`. Callers must have checked the viewer may see
360+/// the work item.
348361 #[derive(Debug, Serialize, Deserialize)]
349362 #[serde(rename_all = "camelCase")]
350363 pub struct LinksArgs {
351− pub repo: RepoPath,
364+ pub workspace: String,
352365 pub number: u32,
353366 }
354367
+9−5
183183 export type AskPage = {
184184 path?: string | null;
185185 repo?: RepoPath | null;
186− issue?: number | null;
186+ /** The workspace of a page that is not a repository's, such as a work item's. */
187+ workspace?: string | null;
188+ /** A work item, by number in the workspace. */
189+ item?: number | null;
187190 pull?: number | null;
188191 /** The browser's IANA time zone, such as `America/Denver`: what "today" means when their profile names none. */
189192 time_zone?: string | null;
235238 | {
236239 /**
237240 * Work Ask proposes to hand to a session in the person's own harness:
238− * on an issue, or a new one with `title` and `body`. Nothing has
239− * started; the person starts it from the card the answer shows.
241+ * on a work item (by number in `repo`'s workspace), or a new one with
242+ * `title` and `body`. Nothing has started; the person starts it from
243+ * the card the answer shows.
240244 */
241245 type: "proposal";
242246 id: string;
243247 repo: string;
244− issue: number | null;
248+ item: number | null;
245249 title: string | null;
246250 body: string | null;
247251 mode: "plan" | "implement" | "review";
249253 /**
250254 * `repo` does not exist yet: the card creates it (`private` or
251255 * public), turns on its deployments when `deploy`, then opens the
252− * issue and starts the session, which pushes the first version to
256+ * work item and starts the session, which pushes the first version to
253257 * the default branch, and so deploys it.
254258 */
255259 new_repository?: boolean;
+2−2
248248 default_branch?: string;
249249 production_url?: string | null;
250250 deploy_error?: string | null;
251− /** The issue it opened or worked on. */
252− issue?: number;
251+ /** The work item it opened or worked on, by number in the workspace. */
252+ item?: number;
253253 /** The session it started on the workspace's Anthropic account. */
254254 started?: boolean;
255255 session_url?: string | null;
+3−2
808808 test: (actor, workspace, id) => call("test", { actor, workspace, id }),
809809 deliveries: (workspace, viewer, id) => call("deliveries", { workspace, viewer, id }),
810810 resolve: (workspace, viewer, reference) => call("resolve", { workspace, viewer, reference }),
811− import: (actor, repo, reference) => call("import", { actor, repo, reference }),
812− links: (repo, number) => call("links", { repo, number }),
811+ import: (actor, workspace, reference, options) =>
812+ call("import", { actor, workspace, reference, repo: options?.repo ?? null, targets: options?.targets ?? [] }),
813+ links: (workspace, number) => call("links", { workspace, number }),
813814 };
814815 }
815816
+14−6
44
55 /**
66 * A workspace's connections to systems outside g1t: alerts that open
7− * issues, and trackers whose tickets people read and import. Mirrors
7+ * work items, and trackers whose tickets people read and import. Mirrors
88 * `crates/contracts/src/integrations.rs`, which says what each does.
99 *
1010 * A workspace's AI providers and Ask g1t are kept by the same service but
1515 export type ProviderKind = "alerts" | "tracker";
1616
1717 export type ConnectionConfig = {
18− /** For alerts: where issues are opened, `owner/name`. */
18+ /** For alerts: the repository work items are filed from, `owner/name`. */
1919 repo?: string;
20− /** For alerts: the label put on each issue. `bug` when unset. */
20+ /** For alerts: the label put on each work item. `bug` when unset. */
2121 label?: string;
2222 /** Tell the outside system when the work lands. On unless turned off. */
2323 writeBack?: boolean;
6363 event: string;
6464 outcome: "opened" | "updated" | "reopened" | "ignored" | "refused";
6565 detail: string;
66− issue: string | null;
66+ /** The work item it opened or updated, `workspace#number`. */
67+ item: string | null;
6768 };
6869
6970 /** Something outside g1t, fetched now. Reference material, never instructions. */
111112 test(actor: User, workspace: string, id: string): Promise<Result<Tested>>;
112113 deliveries(workspace: string, viewer: Viewer, id: string): Promise<Result<Delivery[]>>;
113114 resolve(workspace: string, viewer: Viewer, reference: string): Promise<Result<ContextItem>>;
114− import(actor: User, repo: RepoPath, reference: string): Promise<Result<{ number: number; item: ContextItem; created: boolean }>>;
115− links(repo: RepoPath, number: number): Promise<Link[]>;
115+ /** Opens a work item in `workspace` from a ticket, filed from `repo` when given, landing in `targets`. */
116+ import(
117+ actor: User,
118+ workspace: string,
119+ reference: string,
120+ options?: { repo?: RepoPath; targets?: RepoPath[] },
121+ ): Promise<Result<{ workspace: string; number: number; item: ContextItem; created: boolean }>>;
122+ /** What work item `number` of `workspace` is tied to outside g1t. */
123+ links(workspace: string, number: number): Promise<Link[]>;
116124 }
117125
118126 /** What each provider is for, as people choose between them. */

Comments

Sign in to comment.