Skip to main content

worktree_io/issue/
def.rs

1use std::path::PathBuf;
2
3/// A reference to an issue that identifies a workspace.
4#[derive(Debug, Clone, PartialEq, Eq)]
5pub enum IssueRef {
6    /// A GitHub issue identified by owner, repo, and number.
7    GitHub {
8        /// GitHub organization or user name.
9        owner: String,
10        /// Repository name.
11        repo: String,
12        /// Issue number.
13        number: u64,
14    },
15    /// A Linear issue identified by its UUID, paired with the GitHub repo that
16    /// hosts the code for that project.
17    Linear {
18        /// GitHub organization or user name that hosts the code.
19        owner: String,
20        /// Repository name.
21        repo: String,
22        /// Linear issue UUID.
23        id: String,
24    },
25    /// An Azure DevOps work item paired with an Azure Repos git repository.
26    AzureDevOps {
27        /// Azure DevOps organization name.
28        org: String,
29        /// Azure DevOps project name.
30        project: String,
31        /// Azure Repos git repository name.
32        repo: String,
33        /// Work item ID.
34        id: u64,
35    },
36    /// A Jira issue paired with a GitHub repo that hosts the code.
37    Jira {
38        /// Jira instance host (e.g. `acme.atlassian.net`).
39        host: String,
40        /// Jira issue key (e.g. `PROJ-42`).
41        issue_key: String,
42        /// GitHub organization or user name that hosts the code.
43        owner: String,
44        /// Repository name.
45        repo: String,
46    },
47    /// A GitLab issue identified by owner, repo, and number.
48    GitLab {
49        /// GitLab group or user name.
50        owner: String,
51        /// Repository name.
52        repo: String,
53        /// Issue number.
54        number: u64,
55    },
56    /// A bare repo opened without a specific issue — random branch name.
57    Adhoc {
58        /// GitHub organization or user name.
59        owner: String,
60        /// Repository name.
61        repo: String,
62        /// Auto-generated name (e.g. `bold_turing`).
63        name: String,
64    },
65    /// A local Centy issue — the repository itself is the source, no remote clone needed.
66    Local {
67        /// Absolute path to the local project repository.
68        project_path: PathBuf,
69        /// Human-readable issue number shown in the branch name.
70        display_number: u32,
71    },
72    /// A repo detected from the current directory's git remote — just repo + branch.
73    RemoteBranch {
74        /// Host segment for path routing (e.g. `"github"`, `"gitlab"`).
75        host: String,
76        /// Organization or user name.
77        owner: String,
78        /// Repository name.
79        repo: String,
80        /// Branch name to use for the worktree.
81        branch: String,
82    },
83}