Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(repository): update repository ID generation and remove unus… #3167

Merged
merged 5 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ee/tabby-schema/src/schema/repository/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
fn from(value: GitRepository) -> Self {
Self {
source_id: value.source_id(),
id: value.id,
id: ID::new(value.source_id()),

Check warning on line 113 in ee/tabby-schema/src/schema/repository/mod.rs

View check run for this annotation

Codecov / codecov/patch

ee/tabby-schema/src/schema/repository/mod.rs#L113

Added line #L113 was not covered by tests
name: value.name,
kind: RepositoryKind::Git,
dir: RepositoryConfig::resolve_dir(&value.git_url),
Expand Down
2 changes: 1 addition & 1 deletion ee/tabby-ui/lib/tabby/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const client = new Client({
GrepFile: () => null,
GrepTextOrBase64: () => null,
GrepSubMatch: () => null,
Repository: (data: any) => (data ? `${data.kind}_${data.id}` : null),
Repository: () => null,
wsxiaoys marked this conversation as resolved.
Show resolved Hide resolved
GitReference: () => null,
MessageAttachment: () => null,
MessageAttachmentCode: () => null,
Expand Down
7 changes: 4 additions & 3 deletions ee/tabby-webserver/src/service/repository/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
fn to_repository(kind: RepositoryKind, repo: ProvidedRepository) -> Repository {
Repository {
source_id: repo.source_id(),
id: repo.id,
id: ID::new(repo.source_id()),
name: repo.display_name,
kind,
dir: RepositoryConfig::resolve_dir(&repo.git_url),
Expand All @@ -254,9 +254,10 @@
}

fn repository_config_to_repository(index: usize, config: &RepositoryConfig) -> Result<Repository> {
let source_id = config_index_to_id(index);

Check warning on line 257 in ee/tabby-webserver/src/service/repository/mod.rs

View check run for this annotation

Codecov / codecov/patch

ee/tabby-webserver/src/service/repository/mod.rs#L257

Added line #L257 was not covered by tests
Ok(Repository {
id: ID::new(config_index_to_id(index)),
source_id: config_index_to_id(index),
id: ID::new(source_id.clone()),
source_id: source_id,

Check warning on line 260 in ee/tabby-webserver/src/service/repository/mod.rs

View check run for this annotation

Codecov / codecov/patch

ee/tabby-webserver/src/service/repository/mod.rs#L259-L260

Added lines #L259 - L260 were not covered by tests
name: config.display_name(),
kind: RepositoryKind::GitConfig,
dir: config.dir(),
Expand Down
Loading