From c7112399672c32dd1769e6ca8e5221df627ee75d Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Fri, 26 Apr 2024 14:23:53 -0700 Subject: [PATCH] further simplify naming --- .../repository/{git_repository.rs => git.rs} | 0 .../{github_repository.rs => github.rs} | 0 .../{gitlab_repository.rs => gitlab.rs} | 0 ee/tabby-webserver/src/schema/repository/mod.rs | 16 ++++++---------- .../repository/{git_repository.rs => git.rs} | 0 .../{github_repository.rs => github.rs} | 2 +- .../{gitlab_repository.rs => gitlab.rs} | 2 +- ee/tabby-webserver/src/service/repository/mod.rs | 10 +++++----- 8 files changed, 13 insertions(+), 17 deletions(-) rename ee/tabby-webserver/src/schema/repository/{git_repository.rs => git.rs} (100%) rename ee/tabby-webserver/src/schema/repository/{github_repository.rs => github.rs} (100%) rename ee/tabby-webserver/src/schema/repository/{gitlab_repository.rs => gitlab.rs} (100%) rename ee/tabby-webserver/src/service/repository/{git_repository.rs => git.rs} (100%) rename ee/tabby-webserver/src/service/repository/{github_repository.rs => github.rs} (99%) rename ee/tabby-webserver/src/service/repository/{gitlab_repository.rs => gitlab.rs} (99%) diff --git a/ee/tabby-webserver/src/schema/repository/git_repository.rs b/ee/tabby-webserver/src/schema/repository/git.rs similarity index 100% rename from ee/tabby-webserver/src/schema/repository/git_repository.rs rename to ee/tabby-webserver/src/schema/repository/git.rs diff --git a/ee/tabby-webserver/src/schema/repository/github_repository.rs b/ee/tabby-webserver/src/schema/repository/github.rs similarity index 100% rename from ee/tabby-webserver/src/schema/repository/github_repository.rs rename to ee/tabby-webserver/src/schema/repository/github.rs diff --git a/ee/tabby-webserver/src/schema/repository/gitlab_repository.rs b/ee/tabby-webserver/src/schema/repository/gitlab.rs similarity index 100% rename from ee/tabby-webserver/src/schema/repository/gitlab_repository.rs rename to ee/tabby-webserver/src/schema/repository/gitlab.rs diff --git a/ee/tabby-webserver/src/schema/repository/mod.rs b/ee/tabby-webserver/src/schema/repository/mod.rs index dccd3b91b715..84ab79a2d044 100644 --- a/ee/tabby-webserver/src/schema/repository/mod.rs +++ b/ee/tabby-webserver/src/schema/repository/mod.rs @@ -1,21 +1,17 @@ mod types; pub use types::*; -mod git_repository; -pub use git_repository::{CreateGitRepositoryInput, GitRepository, GitRepositoryService}; +mod git; +pub use git::{CreateGitRepositoryInput, GitRepository, GitRepositoryService}; -mod github_repository; -pub use github_repository::{ - GithubProvidedRepository, GithubRepositoryProvider, GithubRepositoryService, -}; +mod github; +pub use github::{GithubProvidedRepository, GithubRepositoryProvider, GithubRepositoryService}; -mod gitlab_repository; +mod gitlab; use std::{path::PathBuf, sync::Arc}; use async_trait::async_trait; -pub use gitlab_repository::{ - GitlabProvidedRepository, GitlabRepositoryProvider, GitlabRepositoryService, -}; +pub use gitlab::{GitlabProvidedRepository, GitlabRepositoryProvider, GitlabRepositoryService}; use juniper::{GraphQLEnum, GraphQLObject, ID}; use serde::Deserialize; use tabby_common::config::{RepositoryAccess, RepositoryConfig}; diff --git a/ee/tabby-webserver/src/service/repository/git_repository.rs b/ee/tabby-webserver/src/service/repository/git.rs similarity index 100% rename from ee/tabby-webserver/src/service/repository/git_repository.rs rename to ee/tabby-webserver/src/service/repository/git.rs diff --git a/ee/tabby-webserver/src/service/repository/github_repository.rs b/ee/tabby-webserver/src/service/repository/github.rs similarity index 99% rename from ee/tabby-webserver/src/service/repository/github_repository.rs rename to ee/tabby-webserver/src/service/repository/github.rs index 43c7ca5e8a77..4c79d32e3e33 100644 --- a/ee/tabby-webserver/src/service/repository/github_repository.rs +++ b/ee/tabby-webserver/src/service/repository/github.rs @@ -289,7 +289,7 @@ mod tests { #[tokio::test] async fn test_github_repository_provider_crud() { let db = DbConn::new_in_memory().await.unwrap(); - let service = super::create(db.clone()); + let service = github::create(db.clone()); let id = service .create_provider("id".into(), "secret".into()) diff --git a/ee/tabby-webserver/src/service/repository/gitlab_repository.rs b/ee/tabby-webserver/src/service/repository/gitlab.rs similarity index 99% rename from ee/tabby-webserver/src/service/repository/gitlab_repository.rs rename to ee/tabby-webserver/src/service/repository/gitlab.rs index dac9089a4b68..b57a159916f1 100644 --- a/ee/tabby-webserver/src/service/repository/gitlab_repository.rs +++ b/ee/tabby-webserver/src/service/repository/gitlab.rs @@ -292,7 +292,7 @@ mod tests { #[tokio::test] async fn test_gitlab_repository_provider_crud() { let db = DbConn::new_in_memory().await.unwrap(); - let service = super::create(db.clone()); + let service = gitlab::create(db.clone()); let id = service .create_provider("id".into(), "secret".into()) diff --git a/ee/tabby-webserver/src/service/repository/mod.rs b/ee/tabby-webserver/src/service/repository/mod.rs index 047c7223af0e..4813a91e9c6d 100644 --- a/ee/tabby-webserver/src/service/repository/mod.rs +++ b/ee/tabby-webserver/src/service/repository/mod.rs @@ -1,6 +1,6 @@ -mod git_repository; -mod github_repository; -mod gitlab_repository; +mod git; +mod github; +mod gitlab; use std::sync::Arc; @@ -26,8 +26,8 @@ struct RepositoryServiceImpl { pub fn create(db: DbConn) -> Arc { Arc::new(RepositoryServiceImpl { git: Arc::new(db.clone()), - github: Arc::new(github_repository::create(db.clone())), - gitlab: Arc::new(gitlab_repository::create(db.clone())), + github: Arc::new(github::create(db.clone())), + gitlab: Arc::new(gitlab::create(db.clone())), }) }