From 3d2eaa6b9e44c9f07ea798828706a8f773fc9c98 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 07:34:46 +0000 Subject: [PATCH 1/3] Initial plan From f9d9570292b0f8681d92dac2631520174d412e4a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 07:56:13 +0000 Subject: [PATCH 2/3] fix: resolve CI build and test errors - Remove unused 'measure' variable in native-sql-strategy.ts (TS6133) - Update nextjs adapter tests to match current dispatch() signature - Fix auth-plugin tests to reference correct AuthManager instance Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> Agent-Logs-Url: https://github.com/objectstack-ai/spec/sessions/39b2f206-d4bb-4357-98ac-f5f9e1466455 --- .../adapters/nextjs/src/metadata-api.test.ts | 45 +++++++++++-------- .../plugin-auth/src/auth-plugin.test.ts | 6 ++- .../src/strategies/native-sql-strategy.ts | 2 - 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/packages/adapters/nextjs/src/metadata-api.test.ts b/packages/adapters/nextjs/src/metadata-api.test.ts index c1379bfbe..2853084a3 100644 --- a/packages/adapters/nextjs/src/metadata-api.test.ts +++ b/packages/adapters/nextjs/src/metadata-api.test.ts @@ -127,10 +127,11 @@ describe('Next.js Metadata API Integration Tests', () => { expect(res.status).toBe(200); expect(res.body.data).toHaveLength(2); expect(mockDispatcher.dispatch).toHaveBeenCalledWith( - 'objects', - expect.objectContaining({ request: expect.anything() }), 'GET', + '/meta/objects', undefined, + {}, + expect.objectContaining({ request: expect.anything() }), ); }); }); @@ -153,10 +154,11 @@ describe('Next.js Metadata API Integration Tests', () => { expect(res.status).toBe(200); expect(res.body.data.name).toBe('account'); expect(mockDispatcher.dispatch).toHaveBeenCalledWith( - 'objects/account', - expect.objectContaining({ request: expect.anything() }), 'GET', + '/meta/objects/account', undefined, + {}, + expect.objectContaining({ request: expect.anything() }), ); }); }); @@ -178,10 +180,11 @@ describe('Next.js Metadata API Integration Tests', () => { const res = await handler(req, { params: { objectstack: ['meta', 'objects'] } }); expect(res.status).toBe(201); expect(mockDispatcher.dispatch).toHaveBeenCalledWith( - 'objects', - expect.objectContaining({ request: expect.anything() }), 'POST', + '/meta/objects', body, + {}, + expect.objectContaining({ request: expect.anything() }), ); }); }); @@ -199,10 +202,11 @@ describe('Next.js Metadata API Integration Tests', () => { const res = await handler(req, { params: { objectstack: ['meta', 'objects', 'account'] } }); expect(res.status).toBe(200); expect(mockDispatcher.dispatch).toHaveBeenCalledWith( - 'objects/account', - expect.objectContaining({ request: expect.anything() }), 'PUT', + '/meta/objects/account', body, + {}, + expect.objectContaining({ request: expect.anything() }), ); }); }); @@ -229,10 +233,11 @@ describe('Next.js Metadata API Integration Tests', () => { const req = makeReq('http://localhost/api/meta/views'); await handler(req, { params: { objectstack: ['meta', 'views'] } }); expect(mockDispatcher.dispatch).toHaveBeenCalledWith( - 'views', - expect.objectContaining({ request: expect.anything() }), 'GET', + '/meta/views', undefined, + {}, + expect.objectContaining({ request: expect.anything() }), ); }); @@ -240,10 +245,11 @@ describe('Next.js Metadata API Integration Tests', () => { const req = makeReq('http://localhost/api/meta/flows'); await handler(req, { params: { objectstack: ['meta', 'flows'] } }); expect(mockDispatcher.dispatch).toHaveBeenCalledWith( - 'flows', - expect.objectContaining({ request: expect.anything() }), 'GET', + '/meta/flows', undefined, + {}, + expect.objectContaining({ request: expect.anything() }), ); }); @@ -251,10 +257,11 @@ describe('Next.js Metadata API Integration Tests', () => { const req = makeReq('http://localhost/api/meta/agents'); await handler(req, { params: { objectstack: ['meta', 'agents'] } }); expect(mockDispatcher.dispatch).toHaveBeenCalledWith( - 'agents', - expect.objectContaining({ request: expect.anything() }), 'GET', + '/meta/agents', undefined, + {}, + expect.objectContaining({ request: expect.anything() }), ); }); }); @@ -684,10 +691,11 @@ describe('Next.js Metadata API Integration Tests', () => { const req = makeReq('http://localhost/api/meta/objects/account/fields/name'); await handler(req, { params: { objectstack: ['meta', 'objects', 'account', 'fields', 'name'] } }); expect(mockDispatcher.dispatch).toHaveBeenCalledWith( - 'objects/account/fields/name', - expect.any(Object), 'GET', + '/meta/objects/account/fields/name', undefined, + {}, + expect.objectContaining({ request: expect.anything() }), ); }); @@ -696,10 +704,11 @@ describe('Next.js Metadata API Integration Tests', () => { // With just ['meta'], subPath becomes empty after slice(1) await handler(req, { params: { objectstack: ['meta'] } }); expect(mockDispatcher.dispatch).toHaveBeenCalledWith( - '', - expect.any(Object), 'GET', + '/meta', undefined, + {}, + expect.objectContaining({ request: expect.anything() }), ); }); }); diff --git a/packages/plugins/plugin-auth/src/auth-plugin.test.ts b/packages/plugins/plugin-auth/src/auth-plugin.test.ts index 56229f6f1..bf0551368 100644 --- a/packages/plugins/plugin-auth/src/auth-plugin.test.ts +++ b/packages/plugins/plugin-auth/src/auth-plugin.test.ts @@ -299,6 +299,7 @@ describe('AuthPlugin', () => { baseUrl: 'http://localhost:3000', }); mockContext.hook = localHookCapture.hookFn; + (mockContext.registerService as any).mockClear(); await localPlugin.init(mockContext); const mockRawApp = { all: vi.fn() }; @@ -314,7 +315,7 @@ describe('AuthPlugin', () => { throw new Error(`Service not found: ${name}`); }); - const registeredAuthManager = (mockContext.registerService as any).mock.calls.at(-1)[1]; + const registeredAuthManager = (mockContext.registerService as any).mock.calls[0][1]; const setRuntimeSpy = vi.spyOn(registeredAuthManager, 'setRuntimeBaseUrl'); await localPlugin.start(mockContext); @@ -330,6 +331,7 @@ describe('AuthPlugin', () => { secret: 'test-secret-at-least-32-chars-long', }); mockContext.hook = localHookCapture.hookFn; + (mockContext.registerService as any).mockClear(); await localPlugin.init(mockContext); const mockRawApp = { all: vi.fn() }; @@ -345,7 +347,7 @@ describe('AuthPlugin', () => { throw new Error(`Service not found: ${name}`); }); - const registeredAuthManager = (mockContext.registerService as any).mock.calls.at(-1)[1]; + const registeredAuthManager = (mockContext.registerService as any).mock.calls[0][1]; const setRuntimeSpy = vi.spyOn(registeredAuthManager, 'setRuntimeBaseUrl'); await localPlugin.start(mockContext); diff --git a/packages/services/service-analytics/src/strategies/native-sql-strategy.ts b/packages/services/service-analytics/src/strategies/native-sql-strategy.ts index 9e121ced2..617e65f84 100644 --- a/packages/services/service-analytics/src/strategies/native-sql-strategy.ts +++ b/packages/services/service-analytics/src/strategies/native-sql-strategy.ts @@ -176,8 +176,6 @@ export class NativeSQLStrategy implements AnalyticsStrategy { } if (query.measures) { for (const m of query.measures) { - const fieldName = m.includes('.') ? m.split('.')[1] : m; - const measure = cube.measures[fieldName]; fields.push({ name: m, type: 'number' }); } } From a9ffb717ba984c0d1b92dd2855a4b7b2d12105a8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 08:22:46 +0000 Subject: [PATCH 3/3] docs: update CHANGELOG.md with CI fix details Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> Agent-Logs-Url: https://github.com/objectstack-ai/spec/sessions/39b2f206-d4bb-4357-98ac-f5f9e1466455 --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bba7637f8..de65e0e9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 remains lazy (cold-start only) via `ensureApp()` / `ensureKernel()` in `_kernel.ts`. ### Fixed +- **Service-analytics build error (TS6133)** — Removed unused `measure` variable in + `native-sql-strategy.ts` that caused the DTS build to fail with `noUnusedLocals` enabled, + blocking the entire CI build pipeline. +- **Next.js adapter test failures** — Updated 9 metadata API test assertions to match the + current `dispatch(method, path, body, queryParams, context)` call signature used by the + implementation. Tests were still expecting the old `dispatch(subPath, context, method, body)` + signature. +- **Auth plugin test failures** — Fixed 2 tests in `auth-plugin.test.ts` that referenced the + wrong `AuthManager` instance via `registerService.mock.calls`. Added `mockClear()` before + local plugin init to ensure `mock.calls[0]` points to the correct AuthManager for the test's + plugin instance. - **SvelteKit adapter test failures** — Updated test mock to include `dispatch()` method and aligned Metadata, Data, Error handling, and toResponse test assertions with the unified catch-all dispatch pattern used by the implementation and all other adapters (e.g. Hono).