Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Dec 16, 2024
1 parent e707706 commit 230262b
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 65 deletions.
1 change: 1 addition & 0 deletions ee/tabby-schema/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ type Thread {
}

type ThreadAssistantMessageAttachmentsCode {
codeSourceId: String!
hits: [MessageCodeSearchHit!]!
}

Expand Down
129 changes: 64 additions & 65 deletions ee/tabby-webserver/src/service/answer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,7 @@ mod tests {
answer::{
merge_code_snippets,
testutils::{
make_repository_service, FakeChatCompletionStream, FakeCodeSearch,
FakeCodeSearchFail, FakeCodeSearchFailNotReady, FakeContextService, FakeDocSearch,
make_repository_service, FakeChatCompletionStream, FakeCodeSearch, FakeContextService, FakeDocSearch,
},
trim_bullet, AnswerService,
},
Expand Down Expand Up @@ -865,13 +864,13 @@ mod tests {
let code: Arc<dyn CodeSearch> = Arc::new(FakeCodeSearch);
let doc: Arc<dyn DocSearch> = Arc::new(FakeDocSearch);
let context: Arc<dyn ContextService> = Arc::new(FakeContextService);
let mut serper = Some(Box::new(FakeDocSearch) as Box<dyn DocSearch>);
let serper = Some(Box::new(FakeDocSearch) as Box<dyn DocSearch>);
let config = make_answer_config();

let db = DbConn::new_in_memory().await.unwrap();
let repo = make_repository_service(db).await.unwrap();

let mut service = AnswerService::new(
let service = AnswerService::new(
&config,
auth.clone(),
chat.clone(),
Expand Down Expand Up @@ -908,67 +907,67 @@ mod tests {
}

/*
let code_query_input_not_access = make_code_query_input(Some("TEST"), Some(TEST_GIT_URL));
service
.collect_relevant_code(
&context_info_helper,
&code_query_input_not_access,
&code_search_params,
None,
policy.clone(),
)
.await;
let code_query_input_with_only_git = make_code_query_input(None, Some(TEST_GIT_URL));
service
.collect_relevant_code(
&context_info_helper,
&code_query_input_with_only_git,
&code_search_params,
None,
policy.clone(),
)
.await;
let code_query_input_with_only_git = make_code_query_input(None, None);
service
.collect_relevant_code(
&context_info_helper,
&code_query_input_with_only_git,
&code_search_params,
None,
policy.clone(),
)
.await;
let code_fail_not_ready = Arc::new(FakeCodeSearchFailNotReady);
serper = Some(Box::new(FakeDocSearch) as Box<dyn DocSearch>);
service = AnswerService::new(
&config,
auth.clone(),
chat.clone(),
code_fail_not_ready.clone(),
doc.clone(),
context.clone(),
serper,
repo.clone(),
);
let code_fail = Arc::new(FakeCodeSearchFail);
serper = Some(Box::new(FakeDocSearch) as Box<dyn DocSearch>);
service = AnswerService::new(
&config,
auth.clone(),
chat.clone(),
code_fail.clone(),
doc.clone(),
context.clone(),
serper,
repo.clone(),
);
*/
let code_query_input_not_access = make_code_query_input(Some("TEST"), Some(TEST_GIT_URL));
service
.collect_relevant_code(
&context_info_helper,
&code_query_input_not_access,
&code_search_params,
None,
policy.clone(),
)
.await;
let code_query_input_with_only_git = make_code_query_input(None, Some(TEST_GIT_URL));
service
.collect_relevant_code(
&context_info_helper,
&code_query_input_with_only_git,
&code_search_params,
None,
policy.clone(),
)
.await;
let code_query_input_with_only_git = make_code_query_input(None, None);
service
.collect_relevant_code(
&context_info_helper,
&code_query_input_with_only_git,
&code_search_params,
None,
policy.clone(),
)
.await;
let code_fail_not_ready = Arc::new(FakeCodeSearchFailNotReady);
serper = Some(Box::new(FakeDocSearch) as Box<dyn DocSearch>);
service = AnswerService::new(
&config,
auth.clone(),
chat.clone(),
code_fail_not_ready.clone(),
doc.clone(),
context.clone(),
serper,
repo.clone(),
);
let code_fail = Arc::new(FakeCodeSearchFail);
serper = Some(Box::new(FakeDocSearch) as Box<dyn DocSearch>);
service = AnswerService::new(
&config,
auth.clone(),
chat.clone(),
code_fail.clone(),
doc.clone(),
context.clone(),
serper,
repo.clone(),
);
*/
}

#[tokio::test]
Expand Down

0 comments on commit 230262b

Please sign in to comment.