Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/bundled-undici-8-12-4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@openmapx/extension-cli": patch
---

Bundle the undici 8.12.4 patch release in the extension CLI. The extension scaffolding, validation
and packaging command interfaces remain unchanged.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ updates:
# receive 17.x updates; move a major deliberately.
- dependency-name: "graphql"
update-types: ["version-update:semver-major"]
# Dependabot writes one target version to every manifest that lists a
# dependency, so a 16.x update for the code generator also downgraded
# the workspaces on 17. Update the generator's graphql 16 by hand.
- dependency-name: "graphql"
versions: ["< 17"]
# Expo owns the compatible React Native and test-preset versions. Upgrade
# this pair with the Expo SDK instead of accepting standalone bumps.
- dependency-name: "react-native"
Expand Down
17 changes: 1 addition & 16 deletions .trivyignore.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
vulnerabilities:
# The fixed Soup Sieve releases (3.0.2 and 4.0) require Python 3.11.5 or
# newer, while the transitous-runner and data-manager images, which install
# the same Transitous requirements, run Debian 12's Python 3.11.2.
# Only the upstream Transitous catalog scripts load it, through
# beautifulsoup4, on upstream catalog HTML; no user input reaches a selector.
# Keep each exception scoped to the installed package and let it expire so a
# newer Python or a backported fix must replace it.
- id: CVE-2026-126190
paths: ["usr/local/lib/python3.11/dist-packages/soupsieve-3.0.1.dist-info/METADATA"]
expired_at: 2026-12-14
statement: No fixed Soup Sieve release supports the image's Python 3.11.2; only upstream catalog scripts use it on upstream HTML.
- id: CVE-2026-126191
paths: ["usr/local/lib/python3.11/dist-packages/soupsieve-3.0.1.dist-info/METADATA"]
expired_at: 2026-12-14
statement: No fixed Soup Sieve release supports the image's Python 3.11.2; only upstream catalog scripts use it on upstream HTML.
vulnerabilities: []
4 changes: 2 additions & 2 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@openmapx/presets": "workspace:^",
"@openmapx/transitous-core": "workspace:^",
"@opentelemetry/api": "^1.10.0",
"@opentelemetry/exporter-prometheus": "^0.300.0",
"@opentelemetry/exporter-prometheus": "^0.301.0",
"@opentelemetry/sdk-metrics": "^3.0.0",
"better-auth": "1.7.18",
"better-auth-harmony": "^1.3.2",
Expand All @@ -53,7 +53,7 @@
"nodemailer": "^10.2.1",
"opening_hours": "^3.15.0",
"pino": "^10.4.0",
"postgres": "^3.4.9",
"postgres": "^4.1.1",
"tsx": "4.23.15",
"zod": "^4.6.7"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
import { services } from "@openmapx/core/server";
import { eq } from "drizzle-orm";
import Fastify, { type FastifyRequest } from "fastify";
import type postgres from "postgres";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { releaseProvenance } from "../../../../../packages/core/src/services/__fixtures__/release-provenance";
import { ownedDataManager } from "../../../../ops-agent/src/__fixtures__/owned-data-manager";
Expand Down Expand Up @@ -144,7 +145,9 @@ describe.skipIf(process.env.OPENMAPX_RUN_DATABASE_TESTS !== "1")(
if (member !== "unsafe") return Reflect.get(connection, member, owned);
return (
query: string,
parameters?: Parameters<typeof connection.unsafe>[1],
// postgres v4 adds an `unsafe(query, options)` overload, which
// `Parameters<>` would pick; name the values parameter directly.
parameters?: postgres.ParameterOrJSON<never>[],
) => {
const continuation = parameters?.some((value) => {
if (typeof value !== "string" || !value.startsWith("{")) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,13 @@ export async function withAdministrativeConfigurationWriter<T>(
try {
// postgres-js reserves query execution but omits the parent's parser metadata.
// Drizzle needs that metadata; it must still execute through this reserved SQL.
const connection = drizzle(Object.assign(reserved, { options: sql.options }), { schema });
// postgres v4 types a reserved connection without `begin`/`end`, which it never
// had at runtime. Drizzle only calls `begin` from `transaction()`; this writer
// opens its transactions with explicit BEGIN/COMMIT on the reserved connection.
const connection = drizzle(
Object.assign(reserved, { options: sql.options }) as unknown as typeof sql,
{ schema },
);
const deadline = Date.now() + 5_000;
while (!global) {
options.signal?.throwIfAborted();
Expand Down
2 changes: 1 addition & 1 deletion apps/ops-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"verify:traffic-maintenance": "tsx scripts/verify-traffic-maintenance.ts"
},
"dependencies": {
"@fastify/rate-limit": "11.2.1",
"@fastify/rate-limit": "11.2.2",
"@openmapx/core": "workspace:^",
"@openmapx/integration-framework": "workspace:^",
"@openmapx/transitous-core": "workspace:^",
Expand Down
30 changes: 17 additions & 13 deletions apps/transitous-runner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ WORKDIR /tmp/gtfsclean-build
COPY --chmod=0755 services/motis/tools/transitous/build-gtfsclean.sh /usr/local/bin/build-gtfsclean
RUN build-gtfsclean

FROM node:24.22.2-slim@sha256:01d566e8d94d8c619591d78652babfccd3c6992a3dffa9ed5ab39e11cf6c70e9 AS base
FROM node:24.22.2-trixie-slim@sha256:0820eaa85e07d0490446dd01d14707e17e6108a36988cf374899cd057eb3812d AS base
COPY package.json /tmp/package.json
RUN corepack enable && \
corepack prepare "$(node -e "console.log(require('/tmp/package.json').packageManager)")" --activate && \
Expand Down Expand Up @@ -82,26 +82,30 @@ RUN node scripts/copy-runtime-packages.mjs /tmp/runtime-packages.json /app /runt
# The runner needs no package manager: starting from the plain Node image keeps
# the pnpm that corepack prepared for the build stages, and its bundled
# dependencies, out of the shipped image.
FROM node:24.22.2-slim@sha256:01d566e8d94d8c619591d78652babfccd3c6992a3dffa9ed5ab39e11cf6c70e9 AS runner
FROM node:24.22.2-trixie-slim@sha256:0820eaa85e07d0490446dd01d14707e17e6108a36988cf374899cd057eb3812d AS runner
WORKDIR /app
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# git is required because the upstream attribution script reads the catalog's
# submodule metadata; there is no credential helper and no remote configured.
# Explicitly upgrade PCRE2 and Expat inherited from the pinned base, and
# libssl3 and openssl (3.0.22-1~deb12u2 fixes CVE-2026-84782) that curl, git,
# Python and ca-certificates pull in, to their security fixes. The version
# checks fail a stale mirror and, when raised, invalidate this layer in the
# registry build cache.
# apt and libapt-pkg6.0 2.6.2 fix CVE-2026-109518 (Debian DLA-4880-1).
# libssl3t64 and openssl (3.5.7-1~deb13u3 fixes CVE-2026-84782, DSA-6531-1)
# that curl, git, Python and ca-certificates pull in, to their security fixes.
# Expat 2.9.0-1~deb13u1 fixes CVE-2026-77214 (DSA-6566-1). Trixie's PCRE2
# 10.46-1~deb13u2 point release already fixes CVE-2026-86145, CVE-2026-89157
# and CVE-2026-89161, so it needs no floor. The version checks fail a stale
# mirror and, when raised, invalidate this layer in the registry build cache.
# apt and libapt-pkg7.0 3.0.4 fix CVE-2026-109518 (Debian DSA-6607-1).
# zlib1g 1:1.3.dfsg+really1.3.1-1+deb13u1 fixes CVE-2026-76844 and CVE-2026-85091.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates curl git python3 python3-pip python3-venv age tini apt libapt-pkg6.0 libpcre2-8-0 libexpat1 libssl3 openssl \
&& dpkg --compare-versions "$(dpkg-query -W -f='${Version}' apt)" ge 2.6.2 \
&& dpkg --compare-versions "$(dpkg-query -W -f='${Version}' libapt-pkg6.0)" ge 2.6.2 \
&& dpkg --compare-versions "$(dpkg-query -W -f='${Version}' libexpat1)" ge 2.5.0-1+deb12u5 \
&& dpkg --compare-versions "$(dpkg-query -W -f='${Version}' libssl3)" ge 3.0.22-1~deb12u2 \
&& dpkg --compare-versions "$(dpkg-query -W -f='${Version}' openssl)" ge 3.0.22-1~deb12u2 \
ca-certificates curl git python3 python3-pip python3-venv age tini apt libapt-pkg7.0 libpcre2-8-0 libexpat1 libssl3t64 openssl zlib1g \
&& dpkg --compare-versions "$(dpkg-query -W -f='${Version}' apt)" ge 3.0.4 \
&& dpkg --compare-versions "$(dpkg-query -W -f='${Version}' libapt-pkg7.0)" ge 3.0.4 \
&& dpkg --compare-versions "$(dpkg-query -W -f='${Version}' libexpat1)" ge 2.9.0-1~deb13u1 \
&& dpkg --compare-versions "$(dpkg-query -W -f='${Version}' libssl3t64)" ge 3.5.7-1~deb13u3 \
&& dpkg --compare-versions "$(dpkg-query -W -f='${Version}' openssl)" ge 3.5.7-1~deb13u3 \
&& dpkg --compare-versions "$(dpkg-query -W -f='${Version}' zlib1g)" ge 1:1.3.dfsg+really1.3.1-1+deb13u1 \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /usr/lib/python3.*/EXTERNALLY-MANAGED
Expand Down
4 changes: 2 additions & 2 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"esbuild": "^0.28.2",
"fake-indexeddb": "6.2.6",
"jsdom": "^30.1.3",
"fake-indexeddb": "6.2.7",
"jsdom": "^31.0.1",
"sharp": "0.35.5",
"typescript": "^6.0.3"
}
Expand Down
18 changes: 13 additions & 5 deletions apps/web/src/components/admin/AdminLayout.navigation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useContext } from "react";
import { renderToStaticMarkup } from "react-dom/server";
import { afterEach, expect, it, vi } from "vitest";
import { AdminDraftContext, AdminDraftProvider } from "@/lib/admin/AdminDraftProvider";
import { act, cleanup, createQueryWrapper, fireEvent, render, screen } from "@/test";
import { act, cleanup, createQueryWrapper, fireEvent, render, screen, within } from "@/test";
import { adminTestHistory } from "@/test/adminNavigation";
import { AdminLayout } from "./AdminLayout";

Expand Down Expand Up @@ -119,7 +119,11 @@ it("keeps the desktop sidebar preference independent of mobile drawer navigation
});
fireEvent.click(toggle);
expect(toggle).toHaveAttribute("aria-expanded", "true");
const link = screen.getAllByRole("link", { name: "Overview" })[0];
// jsdom lays CSS out at a fixed 1024px viewport, where the phone drawer
// (`display: { md: "none" }`) is hidden whatever matchMedia reports, so
// reach its link through the hidden tree.
const drawer = document.querySelector<HTMLElement>(".MuiDrawer-modal") as HTMLElement;
const link = within(drawer).getByRole("link", { name: "Overview", hidden: true });
document.addEventListener("click", (event) => event.preventDefault(), { once: true });
fireEvent.click(link);
expect(toggle).toHaveAttribute("aria-expanded", "false");
Expand Down Expand Up @@ -173,7 +177,11 @@ it("links hosted Data operators to available Data topics", () => {
{ wrapper: createQueryWrapper() },
);
expect(screen.queryByRole("button", { name: "Host mutation" })).toBeNull();
expect(screen.queryByRole("link", { name: "Cache" })).toBeNull();
expect(screen.getAllByRole("link", { name: "Transit" })).toHaveLength(2);
expect(screen.getAllByRole("link", { name: "Coverage & freshness" })).toHaveLength(2);
// The topic link list only shows from `lg` up; at jsdom's fixed 1024px
// viewport the topic select stands in for it, so count hidden links too.
expect(screen.queryByRole("link", { name: "Cache", hidden: true })).toBeNull();
for (const name of ["Transit", "Coverage & freshness"]) {
expect(screen.getAllByRole("link", { name, hidden: true })).toHaveLength(2);
expect(screen.getByRole("link", { name })).toBeVisible();
}
});
18 changes: 12 additions & 6 deletions apps/web/src/components/admin/AdminSidebar.test.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { en } from "@openmapx/i18n";
import { NextIntlClientProvider } from "next-intl";
import { afterEach, beforeEach, expect, it, vi } from "vitest";
import { cleanup, render, screen } from "@/test";
import { cleanup, render, screen, within } from "@/test";
import { AdminSidebar } from "./AdminSidebar";

vi.mock("next/navigation", () => ({ usePathname: () => "/admin/system/services" }));
beforeEach(() =>
// jsdom lays CSS out at a fixed 1024px viewport, where only the docked desktop
// drawer is displayed; matchMedia has to agree with that layout.
const stubWide = (matches: boolean) =>
vi.stubGlobal("matchMedia", () => ({
matches: false,
matches,
addEventListener: () => {},
removeEventListener: () => {},
})),
);
}));
beforeEach(() => stubWide(true));
afterEach(() => {
cleanup();
vi.unstubAllGlobals();
Expand Down Expand Up @@ -56,13 +58,17 @@ it("shows privacy casework to full administrators", () => {
});

it("closes mobile navigation on an ordinary destination selection", () => {
stubWide(false);
const close = vi.fn();
render(
<NextIntlClientProvider locale="en" messages={en}>
<AdminSidebar open={true} onClose={close} selfHosted={true} />
</NextIntlClientProvider>,
);
document.addEventListener("click", (event) => event.preventDefault(), { once: true });
screen.getAllByRole("link", { name: "System" })[0].click();
// The phone drawer is open, but its `display: { md: "none" }` still applies
// at jsdom's 1024px layout viewport, so reach the link through the hidden tree.
const drawer = document.querySelector<HTMLElement>(".MuiDrawer-modal") as HTMLElement;
within(drawer).getByRole("link", { name: "System", hidden: true }).click();
expect(close).toHaveBeenCalledTimes(1);
});
10 changes: 6 additions & 4 deletions apps/web/src/components/map/MapControls.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { announceAlign, clearAlignAnnouncement } from "@/lib/alignAnnouncement";
import { publishMapObstruction } from "@/lib/mapObstructions";
import type { StreetGridAlignment } from "@/lib/streetGrid";
import { act, createFakeMap, fireEvent, render, screen, waitFor } from "@/test";
import { act, createFakeMap, fireEvent, render, resolvedStyle, screen, waitFor } from "@/test";

type AlignStatus = StreetGridAlignment["status"];

Expand Down Expand Up @@ -267,7 +267,9 @@ describe("MapControls sheet following", () => {
render(<MapControls />);
const stack = document.querySelector<HTMLElement>("[data-map-controls-columns]");
expect(stack).not.toBeNull();
expect(getComputedStyle(stack as HTMLElement).transition).toBe("");
// No transition of any property: every computed duration is zero.
const durations = getComputedStyle(stack as HTMLElement).transitionDuration.split(", ");
expect(durations.every((duration) => parseFloat(duration) === 0)).toBe(true);
});

it("rides a driving sheet's top edge on the compositor, 12px above it", () => {
Expand All @@ -278,7 +280,7 @@ describe("MapControls sheet following", () => {
const style = getComputedStyle(
document.querySelector<HTMLElement>("[data-map-controls-columns]") as HTMLElement,
);
expect(style.bottom).toBe("calc(12px + var(--omx-safe-bottom))");
expect(style.bottom).toBe(resolvedStyle("bottom", "calc(12px + var(--omx-safe-bottom))"));
expect(style.animationName).toBe("omx-sheet-follow");
expect(style.getPropertyValue("animation-range")).toBe("4px 444px");
} finally {
Expand Down Expand Up @@ -311,7 +313,7 @@ describe("MapControls sheet following", () => {
const style = getComputedStyle(stack);
const [start, end] = style.getPropertyValue("animation-range").split(" ").map(parseFloat);
// It rises from 12px to the grid's ceiling, 400 - (100 + 12) - grid.
expect(style.bottom).toBe("calc(12px + var(--omx-safe-bottom))");
expect(style.bottom).toBe(resolvedStyle("bottom", "calc(12px + var(--omx-safe-bottom))"));
expect(end - start).toBe(400 - 112 - grid - 12);
} finally {
rect.mockRestore();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ vi.mock("./RouteSearchResultsLayer", () => ({

import { NAV_CHROME_TOP } from "@/lib/layout";
import { useRouteSearchStore } from "@/lib/navigation/routeSearchStore";
import { resolvedStyle } from "@/test/resolvedStyle";
import { RouteSearchControl } from "./RouteSearchControl";

function view() {
Expand Down Expand Up @@ -259,11 +260,13 @@ it("lines the picker and stop card up with the maneuver banner and bottom bar in
useRouteSearchStore.getState().openPicker();
const { unmount } = render(view());
const picker = screen.getByText("Search along route").closest(".MuiPaper-root") as HTMLElement;
expect(getComputedStyle(picker).top).toBe(NAV_CHROME_TOP);
expect(getComputedStyle(picker).top).toBe(resolvedStyle("top", NAV_CHROME_TOP));
unmount();
useRouteSearchStore.getState().setCategoryKey("preset:amenity/fuel");
render(view());
fireEvent.click(screen.getByRole("button", { name: "Select stop" }));
const card = screen.getByText("River services").closest(".MuiPaper-root") as HTMLElement;
expect(getComputedStyle(card).bottom).toBe("calc(var(--omx-safe-bottom) + 16px)");
expect(getComputedStyle(card).bottom).toBe(
resolvedStyle("bottom", "calc(var(--omx-safe-bottom) + 16px)"),
);
});
6 changes: 4 additions & 2 deletions apps/web/src/components/panels/SidebarShell.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { act, fireEvent } from "@testing-library/react";
import { afterEach, describe, expect, it, vi } from "vitest";
import { SEARCH_BAR_CLEARANCE } from "@/lib/layout";
import { getMapObstructionInsets, publishMapObstruction } from "@/lib/mapObstructions";
import { render, screen } from "@/test";
import { render, resolvedStyle, screen } from "@/test";

const isMobileRef = { current: true };
vi.mock("@mui/material/useMediaQuery", () => ({ default: () => isMobileRef.current }));
Expand Down Expand Up @@ -93,7 +93,9 @@ describe("SidebarShell on desktop", () => {
);
const probe = screen.getByTestId("probe");
expect(probe.textContent).toBe("none");
expect(probe.previousElementSibling).toHaveStyle({ height: SEARCH_BAR_CLEARANCE });
expect(probe.previousElementSibling).toHaveStyle({
height: resolvedStyle("height", SEARCH_BAR_CLEARANCE),
});
});

it("hands the inset to content that lays itself out under the bar", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import userEvent from "@testing-library/user-event";
import { NextIntlClientProvider } from "next-intl";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { MobileRuntimeProvider } from "@/lib/mobile/MobileRuntimeProvider";
import { resolvedStyle } from "@/test/resolvedStyle";
import { RouteCard } from "./RouteCard";

// Pin the viewer's zone so the arrival offset assertions do not depend on the
Expand Down Expand Up @@ -390,7 +391,7 @@ describe("RouteCard compact traffic explanation", () => {
(duration, band) => {
renderCard({ ...baseRoute, duration, baselineDuration: 3600 });
expect(getComputedStyle(screen.getByRole("heading", { level: 6 })).color).toBe(
`var(--omx-traffic-${band})`,
resolvedStyle("color", `var(--omx-traffic-${band})`),
);
},
);
Expand Down Expand Up @@ -435,7 +436,7 @@ describe("RouteCard compact traffic explanation", () => {
</NextIntlClientProvider>,
);
expect(getComputedStyle(screen.getByRole("heading", { level: 6 })).color).toBe(
"var(--omx-traffic-heavy)",
resolvedStyle("color", "var(--omx-traffic-heavy)"),
);
expect(screen.getByText("(+45 min)")).toBeInTheDocument();
});
Expand Down Expand Up @@ -928,7 +929,7 @@ describe("RouteCard current congestion coverage", () => {
trafficCoverage: freshCoverage,
});
expect(getComputedStyle(screen.getByRole("heading", { level: 6 })).color).toBe(
"var(--omx-brand)",
resolvedStyle("color", "var(--omx-brand)"),
);
expect(screen.queryByTestId("route-traffic-status")).toBeNull();
expect(screen.queryByTestId("traffic-delay")).toBeNull();
Expand Down Expand Up @@ -1012,7 +1013,7 @@ describe("RouteCard expired congestion estimates", () => {
});
expect(screen.getByTestId("traffic-delay")).toHaveTextContent(/^\(\+45 min\)$/);
expect(getComputedStyle(screen.getByRole("heading", { level: 6 })).color).toBe(
"var(--omx-traffic-heavy)",
resolvedStyle("color", "var(--omx-traffic-heavy)"),
);
expect(screen.queryByText("Traffic data unavailable")).toBeNull();
act(() => vi.advanceTimersByTime(30000));
Expand Down
Loading
Loading