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
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Keep the build context lean + never ship host artefacts into the image.
**/node_modules
**/.next
**/.turbo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ jobs:
tag: ${{ inputs.tag || '' }}
from-head: ${{ inputs.from-head || '' }}
bump: ${{ inputs.bump || 'auto' }}
# The called workflow is our own hyperi-io/hyperi-ci ts-ci.yml (not a third party) and needs the full secret set for publishing (registry tokens, R2 credentials, GH App token). Matches the documented hyperi-ci.yml template.
# hyperi-ci's reusable workflow publishes, so it needs every secret.
secrets: inherit # nosemgrep: yaml.github-actions.security.secrets-inherit.secrets-inherit
5 changes: 1 addition & 4 deletions .github/workflows/macos-dev-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
# License: BUSL-1.1
# Copyright: (c) 2026 HYPERI PTY LIMITED
#
# Runs scripts/macos-dev-smoke.py, the same file a developer runs on a Mac. The
# GitHub macOS runner has no docker, so the engine runs with no ClickHouse. A Linux
# leg runs the script's docker mode, the one a Mac with OrbStack or Docker Desktop picks.
# Dispatch it with an engine tag and a ui tag to gate a release candidate.
# docs/local-development.md "Running natively on a Mac, in VS Code" covers this workflow.

name: macOS dev smoke

Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Dependencies
node_modules
.pnp
Expand Down Expand Up @@ -70,7 +68,7 @@ TODO.md
.cursor/
.cursorrules

# OS junk (never useful in repo)
# OS junk
.DS_Store
Thumbs.db
*.swp
Expand Down
19 changes: 2 additions & 17 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
nodeLinker: node-modules

# Supply-chain release-age gate, enforced at INSTALL time. Deliberate, and not
# a duplicate of the org Renovate cooldown: that one governs what Renovate
# proposes, this one governs what yarn will install, including a hand-run
# `yarn add` that Renovate never sees.
#
# The two do NOT share an exception. Renovate lets a CVE fix bypass its 7-day
# cooldown; this gate has no such notion, so a security PR raised early fails
# here with YN0016 "quarantined" until the version ages out (dfe-ui#129).
#
# Unblock a genuine CVE with the narrow escape, never by lowering the gate:
# - npmPreapprovedPackages, using an EXACT locator (brace-expansion@5.0.8),
# removed once the version ages past the window
# - or `yarn add --no-time-gate` for a single command
#
# Keep the value in the `<n>d` form only while it demonstrably parses: yarn
# issue #6991 reports the suffix being dropped, which reads as protective and
# is not. Verified firing on yarn 4.13.0.
# Install-time release-age gate, separate from Renovate's cooldown. CONTRIBUTING.md "What tends to bite" covers a CVE fix it blocks.
# yarn#6991 reports the `<n>d` suffix being dropped, so check the gate still fires after a yarn bump.
npmMinimalAgeGate: '7d'

# Peers these packages use through their own dependencies but do not declare;
Expand Down
48 changes: 18 additions & 30 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ versioning and changelog generation. All commits must follow this format:
| `chore` | Other changes that don't modify src or test files | None |
| `revert` | Reverts a previous commit | Varies |

### Breaking Changes

For breaking changes that require a major version bump, add `!` after the type
or include `BREAKING CHANGE:` in the footer:

Expand All @@ -47,7 +45,7 @@ feat!: remove deprecated API endpoints
BREAKING CHANGE: The /v1/users endpoint has been removed. Use /v2/users instead.
```

### Examples
Examples:

```text
feat(auth): add OAuth2 support for Google login
Expand All @@ -61,18 +59,14 @@ refactor(core)!: restructure module exports
BREAKING CHANGE: Named exports are now used instead of default exports.
```

### Scope

Scope is optional but recommended. Use it to indicate the area of the codebase
affected (e.g., `api`, `auth`, `core`, `cli`, `docs`).

## Semantic Versioning

This project follows [Semantic Versioning 2.0.0](https://semver.org/):

- **MAJOR** (X.0.0): Breaking changes that require users to modify their code
- **MINOR** (0.X.0): New features that are backwards-compatible
- **PATCH** (0.0.X): Bug fixes and minor improvements
- MAJOR (X.0.0): Breaking changes that require users to modify their code
- MINOR (0.X.0): New features that are backwards-compatible
- PATCH (0.0.X): Bug fixes and minor improvements

Versions are automatically determined by semantic-release based on commit
messages. Do not manually update version numbers.
Expand All @@ -93,7 +87,7 @@ anniversary of its release.
3. **Test your changes** to ensure they work as expected
4. **Submit a pull request** with a clear description of what you've done

### Pull Request Checklist
Before you open it:

- [ ] Commits follow the conventional commit format
- [ ] Tests pass (if applicable)
Expand All @@ -113,8 +107,7 @@ hyperi-ci check
it once with `uv tool install hyperi-ci` (or `pipx install hyperi-ci`), or run it
ad hoc with `uvx hyperi-ci check`. It runs the project's full local validation --
the same suite CI runs -- and reports what to fix. Run it before every push and before opening a
pull request. It is the single best way to give your change the best chance of
surviving CI.
pull request.

## CI/CD Workflow

Expand All @@ -126,21 +119,15 @@ When your pull request is merged to `main`:
4. Creates a new GitHub release with release notes
5. Publishes the package (if applicable)

This happens automatically - no manual intervention required.

## Questions

If you have questions about contributing, please open an issue or contact us.
This happens automatically - no manual intervention required. A question about contributing goes in an issue.

## Context

### What this is

The operator console: a Next.js app that reads and writes through one backend, the dfe-engine API, and frames the dfe-hyperdx fork for data exploration. It keeps no datastore. When the console needs data the engine grows an endpoint, rather than the UI reaching past it.

Not an internal tool. Other organisations run this console against their own
engine, so cluster names, our fleet and credential paths belong in the private
config repos. One artifact ships, the `ghcr.io/hyperi-io/dfe-ui` container.
Not an internal tool. Other organisations run this console against their engines, so cluster names, fleet details and credential paths belong in each deployment's private config repo. One artifact ships, the `ghcr.io/hyperi-io/dfe-ui` container.

The console is one of the suite's user-facing components, with dfe-receiver and dfe-hyperdx, so an advisory here is graded on reachability before severity. The exposure model is declared once, in dfe-infra:
<https://github.com/hyperi-io/dfe-infra/blob/main/docs/threat-model.md>
Expand Down Expand Up @@ -178,15 +165,16 @@ The Playwright suite's setup is [apps/dfe-core-ui/e2e/README.md](apps/dfe-core-u

### What tends to bite

| Don't | Do | Why |
| ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| hand-patch a generated type to add a field the engine spec copy lacks | copy the engine spec again, then `yarn workspace @repo/dfe-engine-types generate` | #298: a hand patch kept a stale spec alive after the engine made the field required |
| re-derive what the engine already declares -- a picker's options, a name rule | read the engine's list, carry the engine's rule | #287, the engine picker was hardcoded and offered an engine that does not exist. #218, the form allowed `aws_cloudtrail` where the engine wants a DNS-1123 label |
| put a health or metrics route behind `withAuth` | keep `livez`, `readyz`, `metrics` in the `proxy.ts` matcher exclusions | probes carry no session, so `withAuth` returned 307 to `/login`. Kubernetes counts 3xx as success, so probes passed while the app was face down |
| read a failed engine call as a completed state | tell a broken config apart from an unreachable engine | #236, `proxy.ts` treated a failed setup-status call as setup complete |
| run the Playwright specs in parallel | leave `fullyParallel: false` and `workers: 1` | every spec shares one engine and calls `reset_all`. Workers race on seed-static, so a spec passes alone and hangs with the folder |
| add a per-file timeout when a `findBy` backstop expires | rely on the global `testTimeout: 20_000` | four suites died at vitest's 5s default on 4cpu runners, carrying 15s backstops the per-test budget beheads |
| merge a `feat:` with the GitHub squash button | default to `fix:` | #209, the validator wants `HYPERCI_ALLOW_FEAT=1` set at commit time and the squash button has no environment. Main was red from 2026-09-03 |
| Don't | Do | Why |
| ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| hand-patch a generated type to add a field the engine spec copy lacks | copy the engine spec again, then `yarn workspace @repo/dfe-engine-types generate` | #298: a hand patch kept a stale spec alive after the engine made the field required |
| re-derive what the engine already declares -- a picker's options, a name rule | read the engine's list, carry the engine's rule | #287, the engine picker was hardcoded and offered an engine that does not exist. #218, the form allowed `aws_cloudtrail` where the engine wants a DNS-1123 label |
| put a health or metrics route behind `withAuth` | keep `livez`, `readyz`, `metrics` in the `proxy.ts` matcher exclusions | probes carry no session, so `withAuth` returned 307 to `/login`. Kubernetes counts 3xx as success, so probes passed while the app was face down |
| read a failed engine call as a completed state | tell a broken config apart from an unreachable engine | #236, `proxy.ts` treated a failed setup-status call as setup complete |
| run the Playwright specs in parallel | leave `fullyParallel: false` and `workers: 1` | every spec shares one engine and calls `reset_all`. Workers race on seed-static, so a spec passes alone and hangs with the folder |
| add a per-file timeout when a `findBy` backstop expires | rely on the global `testTimeout: 20_000` | four suites died at vitest's 5s default on 4cpu runners, carrying 15s backstops the per-test budget beheads |
| lower `npmMinimalAgeGate` in `.yarnrc.yml` to land a CVE fix | pre-approve the exact locator in `npmPreapprovedPackages`, or `yarn add --no-time-gate` once | the gate applies at install and has no CVE exception, unlike Renovate's cooldown, so an early security PR fails with YN0016 "quarantined" (#129) |
| merge a `feat:` with the GitHub squash button | default to `fix:` | #209, the validator wants `HYPERCI_ALLOW_FEAT=1` set at commit time and the squash button has no environment. Main was red from 2026-09-03 |

### Where this sits

Expand Down
15 changes: 4 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
# License: BUSL-1.1
# Copyright: (c) 2026 HYPERI PTY LIMITED
#
# Next.js standalone output (apps/dfe-core-ui/next.config.ts) gives a
# self-contained server plus the traced workspace deps.
# docs/build-and-deploy.md covers the three stages.

# Trixie by name: the bare node:24-slim tag is still Debian 12. Renovate moves the digest.
ARG NODE_IMAGE=node:24-trixie-slim@sha256:43b9ba1142b8dcf33fa8f922ca1be85714adc444e0586c7cf7726daaeabc1bea
Expand All @@ -16,7 +15,7 @@ ARG NODE_IMAGE=node:24-trixie-slim@sha256:43b9ba1142b8dcf33fa8f922ca1be85714adc4
FROM --platform=$BUILDPLATFORM ${NODE_IMAGE} AS builder
WORKDIR /app

# Toolchain for any native (node-gyp) transitive deps. Builder-only; discarded.
# node-gyp toolchain for native dependencies, in the builder stage alone.
# Unpinned: Debian removes superseded versions from its archive, so a version pin breaks the build at the next point release.
# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
Expand All @@ -25,7 +24,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \

RUN corepack enable

# Manifests first so the install layer caches independently of source.
COPY package.json yarn.lock .yarnrc.yml turbo.json ./
COPY apps/ apps/
COPY packages/ packages/
Expand All @@ -36,21 +34,17 @@ COPY scripts/ scripts/
RUN yarn config set supportedArchitectures.cpu --json '["x64","arm64"]' \
&& yarn install --immutable
ENV NEXT_PUBLIC_API_URL=""
# hyperi-ci stamp-version writes VERSION before a publish image build.
# COPY of a missing file fails, so bind-mount the context and copy only when present.
# VERSION exists in a publish build alone, and COPY of a missing file fails.
RUN --mount=type=bind,source=.,target=/src \
if [ -f /src/VERSION ]; then cp /src/VERSION /app/VERSION; fi
# turbo builds the workspace packages (@repo/*) then the Next app.
RUN yarn build

# --- App tree ---
# The runtime /app, assembled on the build host so nothing here runs emulated.
FROM --platform=$BUILDPLATFORM ${NODE_IMAGE} AS app_tree
WORKDIR /app

# Standalone bundle carries the monorepo layout: apps/dfe-core-ui/server.js plus a
# minimal node_modules + traced packages/. Neither the built static assets nor the
# public/ tree ride in standalone -- copy both alongside the app.
# The standalone output leaves out .next/static and public/, so both are copied beside it.
COPY --from=builder /app/apps/dfe-core-ui/.next/standalone ./
COPY --from=builder /app/apps/dfe-core-ui/.next/static ./apps/dfe-core-ui/.next/static
COPY --from=builder /app/apps/dfe-core-ui/public ./apps/dfe-core-ui/public
Expand All @@ -67,7 +61,6 @@ ENV NODE_ENV=production
ENV PORT=3000
ENV HOSTNAME=0.0.0.0

# Non-root runtime.
RUN groupadd -g 1001 nodejs && useradd -u 1001 -g nodejs -m nextjs

COPY --from=app_tree --chown=nextjs:nodejs /app ./
Expand Down
Loading
Loading