gitpoulpi_hosting/issue_flow.rs
1//! Host-driven flows (slice W4): what the host can make from an issue and
2//! what it already made for one. The types are provider-agnostic; the
3//! providers fill them (`gitlab_flow.rs`, `github_flow.rs`, `gitea/flow.rs`).
4
5use crate::model::PullRequestSummary;
6
7/// A branch to create on the host for an issue.
8#[derive(Debug, Clone, PartialEq, Eq, Default)]
9pub struct NewIssueBranch {
10 /// `owner/name`, `group/sub/proj`.
11 pub project: String,
12 /// The issue the branch is made for (GitHub links it to the issue).
13 pub issue_number: u64,
14 /// The new branch's name.
15 pub name: String,
16 /// The existing branch (name, not a remote-tracking spelling) it starts
17 /// from.
18 pub from: String,
19}
20
21/// What the host answers once the branch exists.
22#[derive(Debug, Clone, PartialEq, Eq, Default, serde::Serialize)]
23pub struct CreatedBranch {
24 pub name: String,
25 #[serde(skip_serializing_if = "Option::is_none")]
26 pub web_url: Option<String>,
27}
28
29/// What the host links to an issue itself (not by a naming convention).
30#[derive(Debug, Clone, PartialEq, Eq, Default)]
31pub struct IssueLinks {
32 /// Branches the host links to the issue (GitHub's linked branches).
33 pub branches: Vec<String>,
34 /// Merge / pull requests that mention or close the issue.
35 pub requests: Vec<PullRequestSummary>,
36}