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

WIP: front end and backend draft #3522

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

antimonyGu
Copy link
Contributor

@antimonyGu antimonyGu commented Dec 6, 2024

Test:

  • When repo is not indexed, return data.
    { "operation": { "key": -1177702502, "query": { "kind": "Document", "definitions": [ { "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ResolveGitUrl" }, "variableDefinitions": [ { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "gitUrl" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } } ], "selectionSet": { "kind": "SelectionSet", "selections": [ { "kind": "Field", "name": { "kind": "Name", "value": "resolveGitUrl" }, "arguments": [ { "kind": "Argument", "name": { "kind": "Name", "value": "gitUrl" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "gitUrl" } } } ], "selectionSet": { "kind": "SelectionSet", "selections": [ { "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sourceId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sourceKind" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sourceName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "kind" } }, { "kind": "Field", "name": { "kind": "Name", "value": "gitUrl" } }, { "kind": "Field", "name": { "kind": "Name", "value": "refs" }, "selectionSet": { "kind": "SelectionSet", "selections": [ { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "commit" } } ] } } ] } } ] } } ], "loc": { "start": 0, "end": 200, "source": { "body": "query ResolveGitUrl($gitUrl: String!) {\n resolveGitUrl(gitUrl: $gitUrl) {\n id\n sourceId\n sourceKind\n sourceName\n name\n kind\n gitUrl\n refs {\n name\n commit\n }\n }\n}", "name": "gql", "locationOffset": { "line": 1, "column": 1 } } }, "__key": 4284452584 }, "variables": { "gitUrl": "[email protected]:sourcegraph/cody.git" }, "kind": "query", "context": { "url": "/graphql", "requestPolicy": "cache-and-network", "suspense": false, "meta": { "cacheOutcome": "miss" } } }, "data": { "resolveGitUrl": null }, "hasNext": false, "stale": false }

  • When repo is indexed, return data.
    { "operation": { "key": -4499522075, "query": { "kind": "Document", "definitions": [ { "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ResolveGitUrl" }, "variableDefinitions": [ { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "gitUrl" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } } ], "selectionSet": { "kind": "SelectionSet", "selections": [ { "kind": "Field", "name": { "kind": "Name", "value": "resolveGitUrl" }, "arguments": [ { "kind": "Argument", "name": { "kind": "Name", "value": "gitUrl" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "gitUrl" } } } ], "selectionSet": { "kind": "SelectionSet", "selections": [ { "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sourceId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sourceKind" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sourceName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "kind" } }, { "kind": "Field", "name": { "kind": "Name", "value": "gitUrl" } }, { "kind": "Field", "name": { "kind": "Name", "value": "refs" }, "selectionSet": { "kind": "SelectionSet", "selections": [ { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "commit" } } ] } } ] } } ] } } ], "loc": { "start": 0, "end": 200, "source": { "body": "query ResolveGitUrl($gitUrl: String!) {\n resolveGitUrl(gitUrl: $gitUrl) {\n id\n sourceId\n sourceKind\n sourceName\n name\n kind\n gitUrl\n refs {\n name\n commit\n }\n }\n}", "name": "gql", "locationOffset": { "line": 1, "column": 1 } } }, "__key": 4284452584 }, "variables": { "gitUrl": "[email protected]:antimonyGu/tabby.git" }, "kind": "query", "context": { "url": "/graphql", "requestPolicy": "network-only", "suspense": false } }, "data": { "resolveGitUrl": { "id": "git:E16n1q", "sourceId": "git:E16n1q", "sourceKind": "GIT", "sourceName": "https://github.com/antimonyGu/tabby", "name": "my-tabby", "kind": "GIT", "gitUrl": "https://github.com/antimonyGu/tabby", "refs": [ { "name": "refs/heads/main", "commit": "3df11d1eb3c3d652ef715f644eb1f44730ff255f" }, { "name": "refs/tags/nightly", "commit": "3df11d1eb3c3d652ef715f644eb1f44730ff255f" } ] } }, "hasNext": false, "stale": false }

@antimonyGu antimonyGu marked this pull request as draft December 6, 2024 07:31
crates/tabby/src/routes/repo_check.rs Outdated Show resolved Hide resolved
ee/tabby-schema/src/schema/mod.rs Outdated Show resolved Hide resolved
@antimonyGu antimonyGu force-pushed the check-is-workspace-indexed branch 2 times, most recently from 9f46d77 to 763609c Compare December 10, 2024 22:03
ee/tabby-schema/src/schema/mod.rs Outdated Show resolved Hide resolved
ee/tabby-schema/src/schema/mod.rs Outdated Show resolved Hide resolved
@antimonyGu antimonyGu force-pushed the check-is-workspace-indexed branch from 04c17ec to 88c26a9 Compare December 11, 2024 02:48
@antimonyGu antimonyGu force-pushed the check-is-workspace-indexed branch from 48a8de6 to d8dc027 Compare December 12, 2024 01:12
@antimonyGu antimonyGu force-pushed the check-is-workspace-indexed branch from c53b738 to d16b1bd Compare December 12, 2024 03:06
@antimonyGu antimonyGu marked this pull request as ready for review December 12, 2024 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants