mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-02 21:32:10 +03:00
fix(ci): resolve remaining CI failures (typecheck + build-reorg test drift + #3100 dedup)
Full CI surfaced real failures that local subsets missed (gh-merged PRs bypass the hooks that run these gates): - typecheck:core (Lint job): 3 now-unused @ts-expect-error in mcp-server/server.ts (#3077 dynamic tool loops) → @ts-ignore (lenient, no TS2578). - pack-artifact-policy.test.ts: build-reorg (#3124) renamed app/->dist/; the test still asserted app/ paths + REQUIRED order (it sorts alphabetically). - electron-packaging.test.ts: extraResources from .next/electron-standalone -> .build/electron-standalone (#3124). - glm-provider-model-import-route.test.ts: two GLM connections shared one apiKey, so #3100 (#3023) dedup collapsed them → only one discovery fetch. Distinct keys. Remaining CI flakes (batch expiration, ModelSync self-fetch) pass in isolation — concurrency/port flakiness under --test-concurrency=4, not real failures.
This commit is contained in:
@@ -998,7 +998,7 @@ export function createMcpServer(): McpServer {
|
||||
async (args) => {
|
||||
try {
|
||||
const parsedArgs = toolDef.inputSchema.parse(args ?? {});
|
||||
// @ts-expect-error - handler type lost through dynamic Object.values() access
|
||||
// @ts-ignore - handler type lost through dynamic Object.values() access
|
||||
const result = await toolDef.handler(parsedArgs);
|
||||
return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
|
||||
} catch (err) {
|
||||
@@ -1025,7 +1025,7 @@ export function createMcpServer(): McpServer {
|
||||
async (args) => {
|
||||
try {
|
||||
const parsedArgs = toolDef.inputSchema.parse(args ?? {});
|
||||
// @ts-expect-error - handler type lost through dynamic Object.values() access
|
||||
// @ts-ignore - handler type lost through dynamic Object.values() access
|
||||
const result = await toolDef.handler(parsedArgs);
|
||||
return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
|
||||
} catch (err) {
|
||||
@@ -1102,7 +1102,7 @@ export function createMcpServer(): McpServer {
|
||||
async (args) => {
|
||||
try {
|
||||
const parsedArgs = toolDef.inputSchema.parse(args ?? {});
|
||||
// @ts-expect-error - handler type lost through dynamic Object.values() access
|
||||
// @ts-ignore - handler type lost through dynamic Object.values() access
|
||||
const result = await toolDef.handler(parsedArgs);
|
||||
return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
|
||||
} catch (err) {
|
||||
|
||||
@@ -14,11 +14,11 @@ test("electron build copies standalone runtime dependencies into resources/app/n
|
||||
assert.deepEqual(
|
||||
extraResources.find(
|
||||
(resource) =>
|
||||
resource?.from === "../.next/electron-standalone/node_modules" &&
|
||||
resource?.from === "../.build/electron-standalone/node_modules" &&
|
||||
resource?.to === "app/node_modules"
|
||||
),
|
||||
{
|
||||
from: "../.next/electron-standalone/node_modules",
|
||||
from: "../.build/electron-standalone/node_modules",
|
||||
to: "app/node_modules",
|
||||
filter: ["**/*"],
|
||||
}
|
||||
|
||||
@@ -60,14 +60,20 @@ test("GLM import uses international coding endpoint when apiRegion is internatio
|
||||
|
||||
test("GLM import normalizes custom coding models URLs without duplicating endpoints", async () => {
|
||||
await resetStorage();
|
||||
// Distinct apiKeys per connection: createProviderConnection dedups by decrypted
|
||||
// key value (#3023), so a shared key would collapse these two custom-endpoint
|
||||
// connections into one and the second would serve from the first's cached
|
||||
// catalog (only one discovery fetch instead of two).
|
||||
const cases = [
|
||||
{
|
||||
baseUrl: "https://api.z.ai/api/coding/paas/v4",
|
||||
expectedUrl: "https://api.z.ai/api/coding/paas/v4/models",
|
||||
apiKey: "glm-key-0",
|
||||
},
|
||||
{
|
||||
baseUrl: "https://api.z.ai/api/coding/paas/v4/models",
|
||||
expectedUrl: "https://api.z.ai/api/coding/paas/v4/models",
|
||||
apiKey: "glm-key-1",
|
||||
},
|
||||
];
|
||||
|
||||
@@ -81,7 +87,7 @@ test("GLM import normalizes custom coding models URLs without duplicating endpoi
|
||||
provider: "glm",
|
||||
authType: "apikey",
|
||||
name: `glm-custom-${index}`,
|
||||
apiKey: "glm-key",
|
||||
apiKey: testCase.apiKey,
|
||||
providerSpecificData: { baseUrl: testCase.baseUrl },
|
||||
})
|
||||
);
|
||||
@@ -91,7 +97,7 @@ test("GLM import normalizes custom coding models URLs without duplicating endpoi
|
||||
const expected = cases[seenUrls.length];
|
||||
assert.ok(expected, `unexpected GLM discovery call to ${String(url)}`);
|
||||
assert.equal(String(url), expected.expectedUrl);
|
||||
assert.equal(init.headers.Authorization, "Bearer glm-key");
|
||||
assert.equal(init.headers.Authorization, `Bearer ${expected.apiKey}`);
|
||||
assert.equal(init.headers["x-api-key"], undefined);
|
||||
assert.equal(init.headers["anthropic-version"], undefined);
|
||||
seenUrls.push(String(url));
|
||||
|
||||
@@ -40,11 +40,11 @@ test("findUnexpectedArtifactPaths flags staged app files outside the allowlist",
|
||||
test("findUnexpectedArtifactPaths flags app pack files outside the allowlist", () => {
|
||||
const unexpectedPaths = findUnexpectedArtifactPaths(
|
||||
[
|
||||
"app/open-sse/services/compression/engines/rtk/filters/generic-output.json",
|
||||
"app/open-sse/services/compression/rules/en/filler.json",
|
||||
"app/server.js",
|
||||
"app/scripts/dev/sync-env.mjs",
|
||||
"app/scripts/build/prepublish.mjs",
|
||||
"dist/open-sse/services/compression/engines/rtk/filters/generic-output.json",
|
||||
"dist/open-sse/services/compression/rules/en/filler.json",
|
||||
"dist/server.js",
|
||||
"dist/scripts/dev/sync-env.mjs",
|
||||
"dist/scripts/build/prepublish.mjs",
|
||||
"docs/extra.md",
|
||||
],
|
||||
{
|
||||
@@ -53,7 +53,7 @@ test("findUnexpectedArtifactPaths flags app pack files outside the allowlist", (
|
||||
}
|
||||
);
|
||||
|
||||
assert.deepEqual(unexpectedPaths, ["app/scripts/build/prepublish.mjs", "docs/extra.md"]);
|
||||
assert.deepEqual(unexpectedPaths, ["dist/scripts/build/prepublish.mjs", "docs/extra.md"]);
|
||||
});
|
||||
|
||||
test("setupPolyfill.ts is allowed in the tarball (bin/omniroute.mjs imports it at startup)", () => {
|
||||
@@ -68,7 +68,7 @@ test("setupPolyfill.ts is allowed in the tarball (bin/omniroute.mjs imports it a
|
||||
test("findMissingArtifactPaths flags missing root runtime files in the tarball", () => {
|
||||
const missingPaths = findMissingArtifactPaths(
|
||||
[
|
||||
"app/server.js",
|
||||
"dist/server.js",
|
||||
"bin/omniroute.mjs",
|
||||
"package.json",
|
||||
"scripts/build/postinstall.mjs",
|
||||
@@ -77,15 +77,18 @@ test("findMissingArtifactPaths flags missing root runtime files in the tarball",
|
||||
PACK_ARTIFACT_REQUIRED_PATHS
|
||||
);
|
||||
|
||||
// findMissingArtifactPaths returns the missing required paths sorted
|
||||
// alphabetically (bin/ < dist/ < scripts/ < src/), minus the paths present
|
||||
// above (dist/server.js, bin/omniroute.mjs, package.json, the postinstall scripts).
|
||||
assert.deepEqual(missingPaths, [
|
||||
"app/open-sse/services/compression/engines/rtk/filters/generic-output.json",
|
||||
"app/open-sse/services/compression/rules/en/filler.json",
|
||||
"app/peer-stamp.mjs",
|
||||
"app/responses-ws-proxy.mjs",
|
||||
"app/server-ws.mjs",
|
||||
"bin/cli/program.mjs",
|
||||
"bin/mcp-server.mjs",
|
||||
"bin/nodeRuntimeSupport.mjs",
|
||||
"dist/open-sse/services/compression/engines/rtk/filters/generic-output.json",
|
||||
"dist/open-sse/services/compression/rules/en/filler.json",
|
||||
"dist/peer-stamp.mjs",
|
||||
"dist/responses-ws-proxy.mjs",
|
||||
"dist/server-ws.mjs",
|
||||
"scripts/build/native-binary-compat.mjs",
|
||||
"src/shared/utils/nodeRuntimeSupport.ts",
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user