Commit graph

16 commits

Author SHA1 Message Date
Warren Lee
6e8ddd3736
feat: isolate dev environment for multi-agent worktree support (#1994)
## Summary
- Isolate dev, E2E, and integration test environments so multiple git worktrees can run all three simultaneously without port conflicts
- Each worktree gets a deterministic slot (0-99) with unique port ranges: dev (30100-31199), E2E (20320-21399), CI integration (14320-40098)
- Dev portal dashboard (http://localhost:9900) auto-discovers all running stacks, streams logs, and provides a History tab for past run logs

## Port Isolation

| Environment | Port Range | Project Name |
|---|---|---|
| Dev stack | 30100-31199 | `hdx-dev-<slot>` |
| E2E tests | 20320-21399 | `e2e-<slot>` |
| CI integration | 14320-40098 | `int-<slot>` |

All three can run simultaneously from the same worktree with zero port conflicts.

## Dev Portal Features

**Live tab:**
- Auto-discovers dev, E2E, and integration Docker containers + local services (API, App)
- Groups all environments for the same worktree into a single card
- SSE log streaming with ANSI color rendering, capped at 5000 lines
- Auto-starts in background from `make dev`, `make dev-e2e`, `make dev-int`

**History tab:**
- Logs archived to `~/.config/hyperdx/dev-slots/<slot>/history/` on exit (instead of deleted)
- Each archived run includes `meta.json` with worktree/branch metadata
- Grouped by worktree with collapsible cards, search by worktree/branch
- View any past log file in the same log panel, delete individual runs or clear all
- Custom dark-themed confirm modal (no native browser dialogs)

## What Changed

- **`scripts/dev-env.sh`** — Slot-based port assignments, portal auto-start, log archival on exit
- **`scripts/test-e2e.sh`** — E2E port range (20320-21399), log capture via `tee`, portal auto-start, log archival
- **`scripts/ensure-dev-portal.sh`** — Shared singleton portal launcher (works sourced or executed)
- **`scripts/dev-portal/server.js`** — Discovery for dev/E2E/CI containers, history API (list/read/delete), local service port probing
- **`scripts/dev-portal/index.html`** — Live/History tabs, worktree-grouped cards, search, collapse/expand, custom confirm modal, ANSI color log rendering
- **`docker-compose.dev.yml`** — Parameterized ports/volumes/project name with `hdx.dev.*` labels
- **`packages/app/tests/e2e/docker-compose.yml`** — Updated to new E2E port defaults
- **`Makefile`** — `dev-int`/`dev-e2e` targets with log capture + portal auto-start; `dev-portal-stop`; `dev-clean` stops everything + wipes slot data
- **`.env` files** — Ports use `${VAR:-default}` syntax across dev, E2E, and CI environments
- **`agent_docs/development.md`** — Full documentation for isolation, port tables, E2E/CI port ranges

## How to Use

```bash
# Start dev stack (auto-starts portal)
make dev

# Run E2E tests (auto-starts portal, separate ports)
make dev-e2e FILE=navigation

# Run integration tests (auto-starts portal, separate ports)
make dev-int FILE=alerts

# All three can run simultaneously from the same worktree
# Portal at http://localhost:9900 shows everything

# Stop portal
make dev-portal-stop

# Clean up everything (all stacks + portal + history)
make dev-clean
```

## Dev Portal

<img width="1692" height="944" alt="image" src="https://github.com/user-attachments/assets/6ed388a3-43bc-4552-aa8d-688077b79fb7" />

<img width="1689" height="935" alt="image" src="https://github.com/user-attachments/assets/8677a138-0a40-4746-93ed-3b355c8bd45e" />

## Test Plan
- [x] Run `make dev` — verify services start with slot-assigned ports
- [x] Run `make dev` in a second worktree — verify different ports, no conflicts
- [x] Run `make dev-e2e` and `make dev-int` simultaneously — no port conflicts
- [x] Open http://localhost:9900 — verify all stacks grouped by worktree
- [x] Click a service to view logs — verify ANSI colors render correctly
- [x] Stop a stack — verify logs archived to History tab with correct worktree
- [x] History tab — search, collapse/expand, view archived logs, delete
- [x] `make dev-clean` — stops everything, wipes slot data and history
2026-03-31 18:24:24 +00:00
Vineet Ahirkar
6936ef8e29
Optimize materialized column lookup for expression aliases (#1959)
## Summary
Improve the materialized column optimization by allowing it to be applied when `WITH` clauses are expression aliases (i.e., `isSubquery: false`). Previously, any `WITH` clause would disable this optimization. This change ensures that materialized columns are still considered for performance benefits when the `WITH` clause does not represent a subquery.

### Screenshots or video



| Before | After |
| :----- | :---- |
|        |       |

### How to test locally or on Vercel


1. Create a ClickHouse table with a materialized column, e.g.:
   ```sql
   ALTER TABLE otel_logs ADD COLUMN awesome_attribute String MATERIALIZED LogAttributes['awesome_attribute']
   ```
2. Open the Explore view for logs (`/search`)
3. Add a filter for `awesome_attribute` (or `LogAttributes['awesome_attribute']`)
4. Inspect the POST body of `/clickhouse-proxy` requests in the network tab:
    - Before fix: The histogram (time chart) query contains `LogAttributes['awesome_attribute']` (full map scan), while the search results query correctly uses `awesome_attribute`.
    - After fix: Both the histogram and search results queries use `awesome_attribute` (the materialized column).


### References



- Linear Issue: #1957
- Related PRs:
2026-03-22 22:54:18 +00:00
Brandon Pereira
b58bb5d5f4
chore: git ignore worktrees directory (#1953)
If you use `.worktrees` subfolder for agent worktrees, it needs to be gitignored.
2026-03-20 19:52:23 +00:00
Tom Alexander
46daa63055
chore: add playwright agents for cursor and claude (#1847)
- Adds playwright agents for test creation with playwright mcp. 
- Enhances our playwright skill to make use of these
- Updates contribution guide/readmes
2026-03-05 15:16:18 +00:00
Aaron Knudtson
ce09b59b1d
feat: add build option for a ClickHouse bundled build (#1717)
References HDX-3265
Closes HDX-3389

Adds a build that we can use in ClickHouse. 

This build enables bundling HyperDX with ClickHouse https://github.com/ClickHouse/ClickHouse/pull/96597
2026-02-12 18:05:32 +00:00
Elizabet Oliveira
5dded38f87
feat(app): refactor Sources components and add custom Mantine UI variants (#1561)
Co-authored-by: Drew Davis <drew.davis@clickhouse.com>
2026-01-07 14:02:36 +00:00
Sam Garfinkel
ca693c0f56
feat: add support for visualizing histogram counts (#1477)
Adds support for histogram `count` aggregations. This partially resolves https://github.com/hyperdxio/hyperdx/issues/1441, which should probably be split into a new ticket to only address `sum`.

As part of this, I also moved the translation functionality for histograms to a new file `histogram.ts` to avoid contributing even more bloat to `renderChartConfig`. Happy to revert this and move that stuff back into the file if that's preferred.

I also noticed by doing this that there was actually a SQL error in the snapshots for the tests--the existing quantile test was missing a trailing `,` after the time bucket if no group was provided https://github.com/hyperdxio/hyperdx/blob/main/packages/common-utils/src/__tests__/__snapshots__/renderChartConfig.test.ts.snap#L194 so centralizing like this is probably desirable to keep things consistent.

I also personally use webstorm so I added that stuff to the gitignore.
2025-12-23 22:56:20 +00:00
Tom Alexander
68918e4711
chore: Run playwright tests with mongo backend (#1493)
Enables broader testing

Fixes: HDX-3069

To test:
- By default `make e2e` runs playwright tests with a docker compose for mongo
- To test the local-only mode, run `make e2e local=true`
- Since we manage play.hyperdx.io, I envision us running both commands on release
2025-12-17 18:33:28 +00:00
Tom Alexander
52d2798582
chore: Update to next 16, react 19, add react compiler (#1434)
fixes: HDX-2956

Co-authored-by: Brandon Pereira <7552738+brandon-pereira@users.noreply.github.com>
2025-12-04 23:40:59 +00:00
Tom Alexander
e3643ccfc0
chore: Add automatic api doc generation (#1397)
Fixes: HDX-2888
2025-11-21 21:14:02 +00:00
Tom Alexander
83b9c8a4b7
chore: Add playwright tests for app in local-only mode (#1181)
Fixes: HDX-2442
2025-09-20 01:43:08 +00:00
Candido Sales Gomes
5a59d32c00
chore: Upgraded NX from version 16.8.1 to 21.3.11 (#1076)
-  NX Version: 21.3.11 (Local)
-  All existing projects properly recognized: @hyperdx/common-utils, @hyperdx/api, @hyperdx/app
-  All NX commands are working properly
-  Edited the `.vscode/settings.json` adding `editor.tabSize`, `editor.insertSpaces`, `editor.detectIndentation` to keep the format standard for all developers.
-  Updated the `changeset`

## Why? Benefits

- Monorepo optimization - Improved incremental builds when only one package changes
- Enhanced Caching - More granular and intelligent caching mechanisms reduce redundant work
  - 20-40% faster build times in CI/CD due to improved caching 
- Improved Project Graph - Improved support for modern build tools (ESBuild, SWC, etc.)
- Enhanced visualization and analysis of project dependencies
- Clearer migration guides for future upgrades
- More intuitive commands and better error messages


## Tested

- `npx nx show projects`
- `npx nx graph --dry-run`
- `npx nx run @hyperdx/common-utils:dev --help`
- `bun run app:dev:local`

Lint

```
hyperdx/packages/common-utils && npm run build
npx nx run-many -t ci:lint
```

<img width="1126" height="314" alt="CleanShot 2025-08-17 at 22 47 19@2x" src="https://github.com/user-attachments/assets/e5186e1b-9799-491f-8ee8-25b26bd82a54" />


## Evidence

<img width="3810" height="1724" alt="CleanShot 2025-07-24 at 21 15 24@2x" src="https://github.com/user-attachments/assets/1f4d316e-de14-4e35-9098-3b33420afc18" />
2025-08-18 17:16:05 +00:00
Tom Alexander
293a2affc8
feat: Adds auto openapi doc generation + swagger UI for API (#779)
* Adds support for auto-openapi doc generation
* Adds a swagger route for local development
* Adds a script to manually generate the openapi doc (to be used later if we publish to our site, etc...)

Ref: HDX-1661
2025-04-29 17:54:34 +00:00
Warren
aa165fcc46 feat: move more codes 2024-11-21 21:44:33 -08:00
Warren
f2396340b4 feat: introduce usage-stats service 2023-09-15 17:22:53 -07:00
Warren
0826d4dd89 first commit 2023-09-12 20:08:05 -07:00