History

Improve source type projection and inspection performance

Rhys Sullivan committed 7 months ago

Commit 747f7a31 parent 20557f610 files · +1075 −144Browse files

Showing the changes to apps (1 of 10 files). Show all

Unified · Split

apps/executor/src/server/server.real-ingestion.test.ts+32−0
@@ -157,6 +157,38 @@ describe("local-executor-server real ingestion", () => { · 156 unmodified lines
157157 expect(connected.source.status).toBe("connected");
158158 expect(connected.source.namespace).toBe("linear");
159159
160+ const inspection = yield* client.sources.inspection({
161+ path: {
162+ workspaceId: installation.workspaceId,
163+ sourceId: connected.source.id,
164+ },
165+ });
166+
167+ expect(inspection.source.kind).toBe("graphql");
168+ expect(inspection.toolCount).toBeGreaterThan(100);
169+ expect(
170+ inspection.tools.every((tool) => tool.inputTypePreview === undefined),
171+ ).toBe(true);
172+ expect(
173+ inspection.tools.every((tool) => tool.outputTypePreview === undefined),
174+ ).toBe(true);
175+
176+ const toolDetail = yield* client.sources.inspectionTool({
177+ path: {
178+ workspaceId: installation.workspaceId,
179+ sourceId: connected.source.id,
180+ toolPath: "linear.administrableTeams",
181+ },
182+ });
183+
184+ expect(toolDetail.summary.path).toBe("linear.administrableTeams");
185+ expect(toolDetail.summary.inputTypePreview).toBeUndefined();
186+ expect(toolDetail.summary.outputTypePreview).toBeUndefined();
187+ expect(toolDetail.contract.input.typeDeclaration).toContain(
188+ "type LinearAdministrableTeamsCall = {",
189+ );
190+ expect(toolDetail.contract.input.schemaJson).toContain("\"$defs\"");
191+
160192 const storedSource = yield* client.sources.get({
161193 path: {
162194 workspaceId: installation.workspaceId,