Skip to content

ci: fix on main#277

Merged
atilafassina merged 5 commits intomainfrom
fix-type-linting
Apr 16, 2026
Merged

ci: fix on main#277
atilafassina merged 5 commits intomainfrom
fix-type-linting

Conversation

@atilafassina
Copy link
Copy Markdown
Contributor

@atilafassina atilafassina commented Apr 15, 2026

no logic change, just getting CI to pass
there's more work coming here for docs and adjusting some internal funcionality

Fix Vector Search plugin type errors, lint, and test failures:

  • Use payload instead of body in apiClient.request() calls
  • Handle ExecutionResult discriminated union from execute()
  • Make getConfig route handler async to match RouteConfig type
  • Make indexes config optional to satisfy PluginConstructor constraint
  • Add setExecution to test logger mock
  • Sort exports in index.ts for Biome import ordering

Fix Vector Search plugin type errors, lint, and test failures:

- Use `payload` instead of `body` in apiClient.request() calls
- Handle ExecutionResult discriminated union from execute()
- Make getConfig route handler async to match RouteConfig type
- Make indexes config optional to satisfy PluginConstructor constraint
- Add setExecution to test logger mock
- Sort exports in index.ts for Biome import ordering

Co-authored-by: Isaac
Signed-off-by: Atila Fassina <atila@fassina.eu>
The vector-search plugin imported from the connectors barrel, which
re-exports the lakebase connector using a @/ path alias that tsx
cannot resolve at runtime during integration tests.

Co-authored-by: Isaac
Signed-off-by: Atila Fassina <atila@fassina.eu>
tsx cannot resolve tsconfig @/ path aliases at runtime during
integration tests. Replace all 5 occurrences in the appkit package
with standard relative imports.

Co-authored-by: Isaac
Signed-off-by: Atila Fassina <atila@fassina.eu>
The vector-search plugin is not yet exported from @databricks/appkit,
so the playground imported it directly from source. This caused a
dual-singleton CacheManager issue during integration tests.

Commenting out until vector-search is properly exported.

Co-authored-by: Isaac
Signed-off-by: Atila Fassina <atila@fassina.eu>
@atilafassina atilafassina marked this pull request as ready for review April 15, 2026 18:37
Copilot AI review requested due to automatic review settings April 15, 2026 18:37
@atilafassina atilafassina enabled auto-merge (squash) April 15, 2026 18:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR focuses on getting AppKit CI passing by resolving TypeScript/lint/test failures around plugin execution results, SDK request payload shape, and module import paths.

Changes:

  • Update Vector Search plugin + connector to use apiClient.request({ payload }) and to handle ExecutionResult<T> (result.ok/result.data).
  • Adjust route handler typing (async handler), config typing (indexes?), and test mocks/expectations to satisfy stricter type/lint checks.
  • Replace several @/… path-alias imports with relative imports and apply minor ordering fixes.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/appkit/src/plugins/vector-search/vector-search.ts Handle ExecutionResult from execute(), add indexes runtime validation, async route handler, optional-chaining index resolution
packages/appkit/src/plugins/vector-search/types.ts Make indexes optional in config type
packages/appkit/src/plugins/vector-search/tests/vector-search.test.ts Update request assertion from .body to .payload; extend logger mock with setExecution
packages/appkit/src/plugins/vector-search/index.ts Reorder exports for Biome import ordering
packages/appkit/src/plugins/server/vite-dev-server.ts Switch mergeConfigDedup import from alias to relative
packages/appkit/src/plugin/dev-reader.ts Switch remote-tunnel gate import from alias to relative
packages/appkit/src/connectors/vector-search/client.ts Use payload instead of body in apiClient.request()
packages/appkit/src/connectors/lakebase/index.ts Switch logger import from alias to relative
packages/appkit/src/connectors/lakebase-v1/client.ts Switch telemetry import from alias to relative
packages/appkit/src/cache/index.ts Switch lakebase connector import from alias to relative
apps/dev-playground/server/index.ts Comment out Vector Search plugin usage pending export from @databricks/appkit
Comments suppressed due to low confidence (1)

packages/appkit/src/plugins/vector-search/vector-search.ts:66

  • indexes is now optional in IVectorSearchConfig, but Object.entries(this.config.indexes) / Object.keys(this.config.indexes) still pass a possibly-undefined value. With strictNullChecks, this will fail typechecking. Consider assigning to a local const indexes = this.config.indexes after the guard (or using a non-null assertion) and then using indexes for Object.entries/keys and logging.
    if (!this.config.indexes || Object.keys(this.config.indexes).length === 0) {
      throw new Error(
        'VectorSearchPlugin requires at least one index in "indexes" config',
      );
    }
    for (const [alias, idx] of Object.entries(this.config.indexes)) {
      if (!idx.indexName) {
        throw new Error(
          `Index "${alias}" is missing required field "indexName"`,
        );
      }
      if (!idx.columns || idx.columns.length === 0) {
        throw new Error(`Index "${alias}" is missing required field "columns"`);
      }
      if (idx.pagination && !idx.endpointName) {
        throw new Error(
          `Index "${alias}" has pagination enabled but is missing "endpointName"`,
        );
      }
    }
    logger.debug(
      "Vector Search plugin configured with %d index(es)",
      Object.keys(this.config.indexes).length,
    );

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/appkit/src/plugin/dev-reader.ts
Comment thread packages/appkit/src/cache/index.ts
Comment thread apps/dev-playground/server/index.ts
Comment thread packages/appkit/src/plugins/vector-search/vector-search.ts
Comment thread packages/appkit/src/plugins/server/vite-dev-server.ts
Copy link
Copy Markdown
Member

@pkosiec pkosiec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got this diff on your branch after doing:

pnpm clean; pnpm build; pnpm docs:build; pnpm check:fix; pnpm -r typecheck

Could you please validate that? and already hide the vector search plugin maybe? Thanks!

❯ git diff
diff --git a/template/appkit.plugins.json b/template/appkit.plugins.json
index d1420d2e..e9289103 100644
--- a/template/appkit.plugins.json
+++ b/template/appkit.plugins.json
@@ -173,6 +173,34 @@
         ],
         "optional": []
       }
+    },
+    "vector-search": {
+      "name": "vector-search",
+      "displayName": "Vector Search Plugin",
+      "description": "Query Databricks Vector Search indexes with built-in hybrid search, reranking, and pagination",
+      "package": "@databricks/appkit",
+      "resources": {
+        "required": [
+          {
+            "type": "vector_search_index",
+            "alias": "Vector Search Index",
+            "resourceKey": "vector-search-index",
+            "description": "A Databricks Vector Search index to query. Index names configured via plugin config.",
+            "permission": "SELECT",
+            "fields": {
+              "indexName": {
+                "env": "DATABRICKS_VS_INDEX_NAME",
+                "description": "Three-level UC name of the default index (catalog.schema.index_name)"
+              },
+              "endpointName": {
+                "env": "DATABRICKS_VS_ENDPOINT_NAME",
+                "description": "Vector Search endpoint name (required for pagination)"
+              }
+            }
+          }
+        ],
+        "optional": []
+      }
     }
   }
 }

Copy link
Copy Markdown
Member

@pkosiec pkosiec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - but please rename the PR title to avoid showing it up in the next AppKit release. Thanks!

@atilafassina atilafassina merged commit 30a0a24 into main Apr 16, 2026
7 checks passed
@atilafassina atilafassina deleted the fix-type-linting branch April 16, 2026 08:28
@pkosiec pkosiec changed the title fix: ci on main ci: fix on main Apr 16, 2026
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.

3 participants