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 10, 2024
1 parent 763609c commit 2761273
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
4 changes: 3 additions & 1 deletion ee/tabby-schema/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -512,13 +512,15 @@ type MessageAttachmentCodeScores {
type MessageAttachmentIssueDoc {
title: String!
link: String!
author: User
body: String!
closed: Boolean!
}

type MessageAttachmentPullDoc {
title: String!
link: String!
author: User
body: String!
patch: String!
merged: Boolean!
Expand Down Expand Up @@ -713,7 +715,7 @@ type Query {
userEvents(after: String, before: String, first: Int, last: Int, users: [ID!], start: DateTime!, end: DateTime!): UserEventConnection!
diskUsageStats: DiskUsageStats!
repositoryList: [Repository!]!
isAvaileableWorkspace(gitUrl: String!): Boolean!
resolveGitUrl(gitUrl: String!): Repository
contextInfo: ContextInfo!
integrations(ids: [ID!], kind: IntegrationKind, after: String, before: String, first: Int, last: Int): IntegrationConnection!
integratedRepositories(ids: [ID!], kind: IntegrationKind, active: Boolean, after: String, before: String, first: Int, last: Int): ProvidedRepositoryConnection!
Expand Down
25 changes: 9 additions & 16 deletions ee/tabby-schema/src/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,18 +544,20 @@ impl Query {
async fn resolve_git_url(ctx: &Context, git_url: String) -> Result<Option<Repository>> {
let user = check_user(ctx).await?;

let repositorys = ctx.locator
let repositorys = ctx
.locator
.repository()
.repository_list(Some(&user.policy))
.await.unwrap_or_default();
.await
.unwrap_or_default();

for repo in repositorys {
if repo.git_url == git_url {
return Ok(Some(repo));
}
}

return Ok(None);
Ok(None)
}

async fn context_info(ctx: &Context) -> Result<ContextInfo> {
Expand Down Expand Up @@ -1335,19 +1337,10 @@ fn from_validation_errors<S: ScalarValue>(error: ValidationErrors) -> FieldError

error.errors().iter().for_each(|(field, kind)| match kind {
validator::ValidationErrorsKind::Struct(e) => {
for (_, error) in e.0.iter() {
if let validator::ValidationErrorsKind::Field(field_errors) = error {
for error in field_errors {
let mut obj = Object::with_capacity(2);
obj.add_field("path", Value::scalar(field.to_string()));
obj.add_field(
"message",
Value::scalar(error.message.clone().unwrap_or_default().to_string()),
);
errors.push(obj.into());
}
}
}
let mut obj = Object::with_capacity(2);
obj.add_field("path", field.to_string().into());
obj.add_field("message", Value::scalar(e.to_string()));
errors.push(obj.into());
}
validator::ValidationErrorsKind::List(_) => {
warn!("List errors are not handled");
Expand Down

0 comments on commit 2761273

Please sign in to comment.