Skip to content

Commit

Permalink
further simplify naming
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys committed Apr 26, 2024
1 parent e2cc2e9 commit c711239
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 17 deletions.
16 changes: 6 additions & 10 deletions ee/tabby-webserver/src/schema/repository/mod.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
10 changes: 5 additions & 5 deletions ee/tabby-webserver/src/service/repository/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mod git_repository;
mod github_repository;
mod gitlab_repository;
mod git;
mod github;
mod gitlab;

use std::sync::Arc;

Expand All @@ -26,8 +26,8 @@ struct RepositoryServiceImpl {
pub fn create(db: DbConn) -> Arc<dyn RepositoryService> {
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())),
})
}

Expand Down

0 comments on commit c711239

Please sign in to comment.