Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e586ab9bd9 | ||
|
|
68415f805b |
No files matched your search
@@ -2,6 +2,28 @@
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## 1.19.2 - 2026-09-30
|
||||
|
||||
Changes since 1.19.1:
|
||||
|
||||
### Fixed
|
||||
|
||||
- Running a scenario from its detail page could preselect the first environment in the list instead of the scenario's default environment, depending on whether the environment list or the scenario loaded first. The default environment is now chosen when the run modal opens.
|
||||
- Made the run status filter test deterministic; it could fail when the scheduler picked up the test's pending run mid-test.
|
||||
|
||||
## 1.19.1 - 2026-09-30
|
||||
|
||||
Changes since 1.19.0:
|
||||
|
||||
### Changed
|
||||
|
||||
- Upgraded to Node.js 24: the Docker image is based on `node:24-slim`, and the root `package.json` declares `"engines": { "node": ">=24" }`.
|
||||
- The server reads the app name and version (startup log, Swagger, MCP server info, `APP_NAME`/`APP_VERSION`) from the workspace root `package.json`. Previously local runs reported the server workspace's own `liqa-server` / `1.0.0`; the server workspace no longer has a version.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Tests using a local HTTP server bind to `127.0.0.1` instead of `localhost`, which could resolve to an unreachable `::1` inside Docker containers.
|
||||
|
||||
## 1.19.0 - 2026-09-30
|
||||
|
||||
Changes since 1.18.0:
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
# scheduler) also serves the built client, so one container is enough.
|
||||
|
||||
# ── Client build ──────────────────────────────────────────────────────────────
|
||||
FROM node:22-slim AS client-build
|
||||
FROM node:24-slim AS client-build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -15,7 +15,7 @@ COPY client ./client
|
||||
RUN npm run -w client build
|
||||
|
||||
# ── Server build ──────────────────────────────────────────────────────────────
|
||||
FROM node:22-slim AS server-build
|
||||
FROM node:24-slim AS server-build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -29,7 +29,7 @@ COPY server/src ./server/src
|
||||
RUN npm run -w server build
|
||||
|
||||
# ── Runtime ───────────────────────────────────────────────────────────────────
|
||||
FROM node:22-slim AS runtime
|
||||
FROM node:24-slim AS runtime
|
||||
|
||||
# Shared libraries chrome-headless-shell links against (from `ldd`), plus
|
||||
# fontconfig and basic fonts for text rendering. Playwright's `--with-deps`
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useRef, useState, useCallback, SubmitEvent } from 'react';
|
||||
import { useEffect, useState, useCallback, SubmitEvent } from 'react';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { usePageTitle } from '../../hooks/usePageTitle';
|
||||
@@ -85,7 +85,6 @@ export function ScenarioDetailPage() {
|
||||
const traceMode = traceModeOverride ?? runDefaults?.traceMode ?? 'off';
|
||||
const [envs, setEnvs] = useState<Environment[]>([]);
|
||||
const [selectedEnvId, setSelectedEnvId] = useState('');
|
||||
const envInitRef = useRef(false);
|
||||
const [pendingDelete, setPendingDelete] = useState<
|
||||
{ type: 'scenario' } | { type: 'step'; id: string } | { type: 'credential'; id: string } | null
|
||||
>(null);
|
||||
@@ -144,14 +143,23 @@ export function ScenarioDetailPage() {
|
||||
.catch(() => {});
|
||||
}, [id, loadFiles]);
|
||||
|
||||
// Default selected env to scenario's linked environment (or first env) once both are loaded
|
||||
useEffect(() => {
|
||||
if (envInitRef.current || envs.length === 0) return;
|
||||
envInitRef.current = true;
|
||||
const openRunModal = () => {
|
||||
// Preselect the scenario's default environment (or the first one) when the
|
||||
// modal opens: by then both are loaded, and it follows default env edits
|
||||
const preferred = scenario?.environmentId ?? null;
|
||||
const exists = preferred ? envs.some((e) => e.id === preferred) : false;
|
||||
setSelectedEnvId(exists ? preferred! : envs[0].id);
|
||||
}, [scenario, envs]);
|
||||
setSelectedEnvId(exists ? preferred! : (envs[0]?.id ?? ''));
|
||||
setTraceModeOverride(null);
|
||||
setRunVersion(null);
|
||||
setRunVersions([]);
|
||||
if (id) {
|
||||
scenarios
|
||||
.versions(id)
|
||||
.then(setRunVersions)
|
||||
.catch(() => undefined);
|
||||
}
|
||||
setRunModalOpen(true);
|
||||
};
|
||||
|
||||
const reloadScenario = async () => {
|
||||
if (!id) return;
|
||||
@@ -470,21 +478,7 @@ export function ScenarioDetailPage() {
|
||||
/>
|
||||
{scenario && (
|
||||
<div className={styles.toolbarActions}>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
setTraceModeOverride(null);
|
||||
setRunVersion(null);
|
||||
setRunVersions([]);
|
||||
if (id) {
|
||||
scenarios
|
||||
.versions(id)
|
||||
.then(setRunVersions)
|
||||
.catch(() => undefined);
|
||||
}
|
||||
setRunModalOpen(true);
|
||||
}}
|
||||
>
|
||||
<Button size="sm" onClick={openRunModal}>
|
||||
<Play size={14} />
|
||||
{t('scenarios.action_run')}
|
||||
</Button>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Node.js 20+
|
||||
- Node.js 24+ (required by `engines` in `package.json`; the Docker image uses Node.js 24)
|
||||
- Docker + Docker Compose
|
||||
|
||||
The repository is a **npm workspace monorepo** with two packages:
|
||||
|
||||
Generated
+6
-4
@@ -1,16 +1,19 @@
|
||||
{
|
||||
"name": "liqa",
|
||||
"version": "1.19.0",
|
||||
"version": "1.19.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "liqa",
|
||||
"version": "1.19.0",
|
||||
"version": "1.19.2",
|
||||
"workspaces": [
|
||||
"server",
|
||||
"client"
|
||||
]
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
}
|
||||
},
|
||||
"client": {
|
||||
"name": "liqa-client",
|
||||
@@ -16693,7 +16696,6 @@
|
||||
},
|
||||
"server": {
|
||||
"name": "liqa-server",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@modelcontextprotocol/sdk": "^1.29.0",
|
||||
|
||||
+4
-1
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"name": "liqa",
|
||||
"version": "1.19.0",
|
||||
"version": "1.19.2",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": ">=24"
|
||||
},
|
||||
"workspaces": [
|
||||
"server",
|
||||
"client"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "liqa-server",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "nest build",
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import * as fs from "node:fs";
|
||||
import * as path from "node:path";
|
||||
|
||||
export interface AppPackage {
|
||||
name: string;
|
||||
version: string;
|
||||
}
|
||||
|
||||
let cached: AppPackage | undefined;
|
||||
|
||||
/**
|
||||
* Name and version of the application, read from the workspace root
|
||||
* `package.json` (the one declaring `workspaces`) - the single source of the
|
||||
* app version. Found by walking up from this file, which covers both the repo
|
||||
* (`server/src/common` → repo root) and the Docker image
|
||||
* (`/app/dist/common` → `/app/package.json`).
|
||||
*/
|
||||
export function appPackage(): AppPackage {
|
||||
if (cached) return cached;
|
||||
let dir = __dirname;
|
||||
for (;;) {
|
||||
const file = path.join(dir, "package.json");
|
||||
if (fs.existsSync(file)) {
|
||||
const pkg = JSON.parse(fs.readFileSync(file, "utf8")) as Partial<
|
||||
AppPackage & { workspaces: unknown }
|
||||
>;
|
||||
if (pkg.workspaces && pkg.name && pkg.version) {
|
||||
cached = { name: pkg.name, version: pkg.version };
|
||||
return cached;
|
||||
}
|
||||
}
|
||||
const parent = path.dirname(dir);
|
||||
if (parent === dir) {
|
||||
throw new Error(
|
||||
`Workspace root package.json (with "workspaces", "name" and "version") not found above ${__dirname}`,
|
||||
);
|
||||
}
|
||||
dir = parent;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
validateSync,
|
||||
} from "class-validator";
|
||||
|
||||
import pkg from "../../package.json";
|
||||
import { appPackage } from "../common/app-package";
|
||||
|
||||
export enum TraceMode {
|
||||
On = "on",
|
||||
@@ -26,10 +26,10 @@ export class AppConfig {
|
||||
PORT: number = 3000;
|
||||
|
||||
@IsString()
|
||||
APP_NAME: string = pkg.name;
|
||||
APP_NAME: string = appPackage().name;
|
||||
|
||||
@IsString()
|
||||
APP_VERSION: string = pkg.version;
|
||||
APP_VERSION: string = appPackage().version;
|
||||
|
||||
@IsString()
|
||||
KEYS_DIR: string = "keys";
|
||||
|
||||
+2
-1
@@ -3,8 +3,8 @@ import { ConfigService } from "@nestjs/config";
|
||||
import { NestFactory } from "@nestjs/core";
|
||||
import type { NestExpressApplication } from "@nestjs/platform-express";
|
||||
import { DocumentBuilder, SwaggerModule } from "@nestjs/swagger";
|
||||
import { name as pkgName, version as pkgVersion } from "../package.json";
|
||||
import { AppModule } from "./app.module";
|
||||
import { appPackage } from "./common/app-package";
|
||||
import { configureBodyParsers } from "./common/body-parsers";
|
||||
import { TraceLogger } from "./common/trace-logger";
|
||||
import { AppConfig } from "./config/app.config";
|
||||
@@ -28,6 +28,7 @@ process.on("unhandledRejection", (reason) => {
|
||||
});
|
||||
|
||||
async function bootstrap() {
|
||||
const { name: pkgName, version: pkgVersion } = appPackage();
|
||||
const API_PREFIX = "api/v1";
|
||||
const logger = new TraceLogger("Bootstrap");
|
||||
const app = await NestFactory.create<NestExpressApplication>(AppModule, {
|
||||
|
||||
@@ -16,7 +16,7 @@ import { E2eExportService } from "../scenario/e2e-export.service";
|
||||
import { SnippetService } from "../snippet/snippet.service";
|
||||
import { ImportService } from "../import/import.service";
|
||||
|
||||
import pkg from "../../package.json";
|
||||
import { appPackage } from "../common/app-package";
|
||||
|
||||
@Injectable()
|
||||
export class McpService {
|
||||
@@ -34,7 +34,8 @@ export class McpService {
|
||||
) {}
|
||||
|
||||
private createServer(): McpServer {
|
||||
const server = new McpServer({ name: pkg.name, version: pkg.version });
|
||||
const { name, version } = appPackage();
|
||||
const server = new McpServer({ name, version });
|
||||
this.registerTools(server);
|
||||
return server;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import * as fs from "node:fs";
|
||||
import * as path from "node:path";
|
||||
import { appPackage } from "../src/common/app-package";
|
||||
import { validateAppConfig } from "../src/config/app.config";
|
||||
|
||||
describe("appPackage", () => {
|
||||
const root = JSON.parse(
|
||||
fs.readFileSync(path.resolve(__dirname, "../../package.json"), "utf8"),
|
||||
) as { name: string; version: string; workspaces: string[] };
|
||||
|
||||
it("reads name and version from the workspace root package.json", () => {
|
||||
expect(root.workspaces).toContain("server");
|
||||
expect(appPackage()).toEqual({ name: root.name, version: root.version });
|
||||
});
|
||||
|
||||
it("feeds APP_NAME and APP_VERSION", () => {
|
||||
const config = validateAppConfig({});
|
||||
expect(config.APP_NAME).toBe(root.name);
|
||||
expect(config.APP_VERSION).toBe(root.version);
|
||||
});
|
||||
});
|
||||
@@ -58,7 +58,7 @@ describe("Exec Context File Methods Integration Tests", () => {
|
||||
|
||||
// Start a test HTTP server for downloadFile tests
|
||||
testServer = await createTestServer();
|
||||
testServerUrl = `http://localhost:${(testServer.address() as AddressInfo).port}`;
|
||||
testServerUrl = `http://127.0.0.1:${(testServer.address() as AddressInfo).port}`;
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
@@ -94,7 +94,9 @@ describe("Exec Context File Methods Integration Tests", () => {
|
||||
}
|
||||
});
|
||||
|
||||
server.listen(0, "localhost", () => {
|
||||
// Explicit IPv4: "localhost" may bind ::1, which is unreachable in some
|
||||
// containers (e.g. Docker without IPv6)
|
||||
server.listen(0, "127.0.0.1", () => {
|
||||
resolve(server);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -51,7 +51,7 @@ describe("McpController", () => {
|
||||
|
||||
// Start a test HTTP server for downloadFile tests
|
||||
testServer = await createTestServer();
|
||||
testServerUrl = `http://localhost:${(testServer.address() as AddressInfo).port}`;
|
||||
testServerUrl = `http://127.0.0.1:${(testServer.address() as AddressInfo).port}`;
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
@@ -78,7 +78,9 @@ describe("McpController", () => {
|
||||
}
|
||||
});
|
||||
|
||||
server.listen(0, "localhost", () => {
|
||||
// Explicit IPv4: "localhost" may bind ::1, which is unreachable in some
|
||||
// containers (e.g. Docker without IPv6)
|
||||
server.listen(0, "127.0.0.1", () => {
|
||||
resolve(server);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -550,22 +550,27 @@ describe("ScenarioController", () => {
|
||||
it("filters by status", async () => {
|
||||
const sc = await createScenario();
|
||||
await createStep(sc.id, { order: 0 });
|
||||
await createRun(sc.id);
|
||||
const run = await createRun(sc.id);
|
||||
// Put the run in a final state directly: a pending run would be picked
|
||||
// up by the scheduler (@Interval) and could change status mid-test
|
||||
await app
|
||||
.get(DataSource)
|
||||
.query(`UPDATE scenario_runs SET status = 'fail' WHERE id = ?`, [
|
||||
run.id,
|
||||
]);
|
||||
|
||||
const pendingRes = await request(app.getHttpServer())
|
||||
.get(`/scenarios/${sc.id}/runs?status=pending`)
|
||||
const failRes = await request(app.getHttpServer())
|
||||
.get(`/scenarios/${sc.id}/runs?status=fail`)
|
||||
.expect(200);
|
||||
expect(failRes.body.total).toBe(1);
|
||||
expect(failRes.body.data[0].id).toBe(run.id);
|
||||
|
||||
expect(pendingRes.body.total).toBeGreaterThanOrEqual(1);
|
||||
pendingRes.body.data.forEach((r: { status: string }) =>
|
||||
expect(r.status).toBe("pending"),
|
||||
);
|
||||
|
||||
const passRes = await request(app.getHttpServer())
|
||||
.get(`/scenarios/${sc.id}/runs?status=pass`)
|
||||
.expect(200);
|
||||
|
||||
expect(passRes.body.total).toBe(0);
|
||||
for (const status of ["pending", "pass"]) {
|
||||
const res = await request(app.getHttpServer())
|
||||
.get(`/scenarios/${sc.id}/runs?status=${status}`)
|
||||
.expect(200);
|
||||
expect(res.body.total).toBe(0);
|
||||
}
|
||||
});
|
||||
|
||||
it("returns 400 for invalid status filter", async () => {
|
||||
|
||||
Reference in new issue
Block a user