WIP
This commit is contained in:
parent
4833cb7b0e
commit
b0078dd224
1 changed files with 28 additions and 1 deletions
29
src/tasks.rs
29
src/tasks.rs
|
@ -1,7 +1,24 @@
|
||||||
use std::{env, process::Command};
|
use std::{collections::HashSet, env, process::Command};
|
||||||
|
|
||||||
use crate::{gitlab::GitLab, jira::Jira, result::Result};
|
use crate::{gitlab::GitLab, jira::Jira, result::Result};
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
|
pub struct MergeRequestRef {
|
||||||
|
url: String,
|
||||||
|
state: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
|
pub struct Task {
|
||||||
|
jira_key: String,
|
||||||
|
description: String,
|
||||||
|
merge_requests: Vec<MergeRequestRef>,
|
||||||
|
jira_priority: i64,
|
||||||
|
local_priority: i64,
|
||||||
|
status: String,
|
||||||
|
tags: HashSet<String>,
|
||||||
|
}
|
||||||
|
|
||||||
pub struct Tasks {
|
pub struct Tasks {
|
||||||
pub gitlab: GitLab,
|
pub gitlab: GitLab,
|
||||||
pub jira: Jira,
|
pub jira: Jira,
|
||||||
|
@ -29,4 +46,14 @@ impl Tasks {
|
||||||
|
|
||||||
Ok(Self { gitlab, jira })
|
Ok(Self { gitlab, jira })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn all(&self) -> Result<Vec<Task>> {}
|
||||||
|
|
||||||
|
/// fetches jira issues and compares to known local tasks
|
||||||
|
/// for use when sync'ing local tasks to remote state (jira, gitlab)
|
||||||
|
pub async fn desyncs(&self) -> Result<()> {
|
||||||
|
let issues = self.jira.assigned_open_issues().await?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue