diff --git a/giterated-daemon/src/backend/git/mod.rs b/giterated-daemon/src/backend/git/mod.rs index 700c9a5..9dc3d1d 100644 --- a/giterated-daemon/src/backend/git/mod.rs +++ b/giterated-daemon/src/backend/git/mod.rs @@ -4,17 +4,17 @@ use async_trait::async_trait; use git2::BranchType; use giterated_models::instance::{Instance, RepositoryCreateRequest}; +use giterated_models::issue::{IssueInfoBasic, IssueTag}; use giterated_models::object::Object; use giterated_models::repository::{ - AccessList, Commit, DefaultBranch, Description, IssueLabel, Repository, RepositoryBranch, + AccessList, Commit, DefaultBranch, Description, Repository, RepositoryBranch, RepositoryBranchRequest, RepositoryBranchesRequest, RepositoryCommitBeforeRequest, RepositoryCommitFromIdRequest, RepositoryDiff, RepositoryDiffPatchRequest, RepositoryDiffRequest, RepositoryFile, RepositoryFileFromIdRequest, - RepositoryFileFromPathRequest, RepositoryFileInspectRequest, RepositoryIssue, - RepositoryIssueLabelsRequest, RepositoryIssuesCountRequest, RepositoryIssuesRequest, - RepositoryLastCommitOfFileRequest, RepositoryStatistics, RepositoryStatisticsRequest, - RepositoryTag, RepositoryTagRequest, RepositoryTagsRequest, RepositoryTreeEntry, - RepositoryVisibility, Visibility, + RepositoryFileFromPathRequest, RepositoryFileInspectRequest, RepositoryIssueTagsRequest, + RepositoryIssuesCountRequest, RepositoryIssuesRequest, RepositoryLastCommitOfFileRequest, + RepositoryStatistics, RepositoryStatisticsRequest, RepositoryTag, RepositoryTagRequest, + RepositoryTagsRequest, RepositoryTreeEntry, RepositoryVisibility, Visibility, }; use giterated_models::user::User; @@ -729,11 +729,11 @@ impl IssuesBackend for GitBackend { todo!() } - fn issue_labels( + fn issue_tags( &mut self, _requester: &Option, - _request: &RepositoryIssueLabelsRequest, - ) -> Result, Error> { + _request: &RepositoryIssueTagsRequest, + ) -> Result, Error> { todo!() } @@ -741,7 +741,7 @@ impl IssuesBackend for GitBackend { &mut self, _requester: &Option, _request: &RepositoryIssuesRequest, - ) -> Result, Error> { + ) -> Result, Error> { todo!() } } diff --git a/giterated-daemon/src/backend/mod.rs b/giterated-daemon/src/backend/mod.rs index 8770bde..b6aa0e6 100644 --- a/giterated-daemon/src/backend/mod.rs +++ b/giterated-daemon/src/backend/mod.rs @@ -6,6 +6,7 @@ pub mod user; use anyhow::Error; use async_trait::async_trait; +use giterated_models::issue::{IssueInfoBasic, IssueTag}; use giterated_models::object::Object; use giterated_stack::{AuthenticatedUser, GiteratedStack, OperationState, StackOperationState}; use serde_json::Value; @@ -18,14 +19,13 @@ use giterated_models::instance::{ }; use giterated_models::repository::{ - Commit, IssueLabel, Repository, RepositoryBranch, RepositoryBranchRequest, - RepositoryBranchesRequest, RepositoryCommitBeforeRequest, RepositoryCommitFromIdRequest, - RepositoryDiff, RepositoryDiffPatchRequest, RepositoryDiffRequest, RepositoryFile, - RepositoryFileFromIdRequest, RepositoryFileFromPathRequest, RepositoryFileInspectRequest, - RepositoryIssue, RepositoryIssueLabelsRequest, RepositoryIssuesCountRequest, - RepositoryIssuesRequest, RepositoryLastCommitOfFileRequest, RepositoryStatistics, - RepositoryStatisticsRequest, RepositorySummary, RepositoryTag, RepositoryTagRequest, - RepositoryTagsRequest, RepositoryTreeEntry, + Commit, Repository, RepositoryBranch, RepositoryBranchRequest, RepositoryBranchesRequest, + RepositoryCommitBeforeRequest, RepositoryCommitFromIdRequest, RepositoryDiff, + RepositoryDiffPatchRequest, RepositoryDiffRequest, RepositoryFile, RepositoryFileFromIdRequest, + RepositoryFileFromPathRequest, RepositoryFileInspectRequest, RepositoryIssueTagsRequest, + RepositoryIssuesCountRequest, RepositoryIssuesRequest, RepositoryLastCommitOfFileRequest, + RepositoryStatistics, RepositoryStatisticsRequest, RepositorySummary, RepositoryTag, + RepositoryTagRequest, RepositoryTagsRequest, RepositoryTreeEntry, }; use giterated_models::user::User; @@ -142,16 +142,16 @@ pub trait IssuesBackend { requester: &Option, request: &RepositoryIssuesCountRequest, ) -> Result; - fn issue_labels( + fn issue_tags( &mut self, requester: &Option, - request: &RepositoryIssueLabelsRequest, - ) -> Result, Error>; + request: &RepositoryIssueTagsRequest, + ) -> Result, Error>; fn issues( &mut self, requester: &Option, request: &RepositoryIssuesRequest, - ) -> Result, Error>; + ) -> Result, Error>; } #[async_trait::async_trait] diff --git a/giterated-models/src/repository/operations.rs b/giterated-models/src/repository/operations.rs index 7341874..b8349e3 100644 --- a/giterated-models/src/repository/operations.rs +++ b/giterated-models/src/repository/operations.rs @@ -2,15 +2,15 @@ use serde::{Deserialize, Serialize}; use crate::{ error::{OperationError, RepositoryError}, + issue::{IssueInfoBasic, IssueTag}, object::Object, object_backend::ObjectBackend, operation::GiteratedOperation, }; use super::{ - Commit, IssueLabel, Repository, RepositoryBranch, RepositoryBranchFilter, RepositoryDiff, - RepositoryFile, RepositoryIssue, RepositoryStatistics, RepositoryTag, RepositoryTreeEntry, - RepositoryView, + Commit, Repository, RepositoryBranch, RepositoryBranchFilter, RepositoryDiff, RepositoryFile, + RepositoryStatistics, RepositoryTag, RepositoryTreeEntry, RepositoryView, }; /// A request to get a repository's information. @@ -176,7 +176,7 @@ impl GiteratedOperation for RepositoryIssuesCountRequest { type Failure = RepositoryError; } -/// A request to get a repository's issues count. +/// A request to get a repository's issue tags. /// /// # Authentication /// - Instance Authentication @@ -186,14 +186,14 @@ impl GiteratedOperation for RepositoryIssuesCountRequest { /// - User Authorization /// - Potential User permissions checks #[derive(Clone, Debug, Serialize, Deserialize)] -pub struct RepositoryIssueLabelsRequest; +pub struct RepositoryIssueTagsRequest; -impl GiteratedOperation for RepositoryIssueLabelsRequest { - type Success = Vec; +impl GiteratedOperation for RepositoryIssueTagsRequest { + type Success = Vec; type Failure = RepositoryError; } -/// A request to get a repository's issue labels. +/// A request to get a repository's issues. /// /// # Authentication /// - Instance Authentication @@ -206,7 +206,7 @@ impl GiteratedOperation for RepositoryIssueLabelsRequest { pub struct RepositoryIssuesRequest; impl GiteratedOperation for RepositoryIssuesRequest { - type Success = Vec; + type Success = Vec; type Failure = RepositoryError; } @@ -532,18 +532,18 @@ impl + std::fmt::Debug> Object<'_, S // .await // } - pub async fn issue_labels( + pub async fn issue_tags( &mut self, operation_state: &S, - ) -> Result, OperationError> { - self.request::(RepositoryIssueLabelsRequest, operation_state) + ) -> Result, OperationError> { + self.request::(RepositoryIssueTagsRequest, operation_state) .await } pub async fn issues( &mut self, operation_state: &S, - ) -> Result, OperationError> { + ) -> Result, OperationError> { self.request::(RepositoryIssuesRequest, operation_state) .await }