Skip to content
Draft
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
113 changes: 113 additions & 0 deletions .claude/skills/rebase-clickhouse-test-branch/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
name: rebase-clickhouse-test-branch
description: Rebase the clickhouse-js-client-release-test branch onto main. Use this skill whenever the user asks to rebase, sync, or update the clickhouse test branch, or says something like "rebase the clickhouse branch" or "sync the test branch with main". This branch is a long-lived e2e testing branch that tests the ClickHouse JS client HEAD builds against HyperDX — it is never merged, only rebased.
---

# Rebase the ClickHouse JS Client Test Branch

`clickhouse-js-client-release-test` is a permanent e2e testing branch that is **never merged into main**. It exists solely to test `@clickhouse/client` HEAD builds against HyperDX. Because it never lands, it must be periodically rebased as main moves forward.

## Branch structure

The branch always looks like this (top to bottom):

```
<lockfile-only commit> ← message "yarn", only touches yarn.lock — always drop this
<real change commits> ← e.g. "approve", "use head" — keep these
<main history>
```

The lockfile commit is the one that always conflicts on rebase, so the workflow is: drop it, rebase the real commits, then regenerate the lockfile fresh.

## Steps

### 1. Fetch latest main

```bash
git fetch origin main
```

### 2. Identify and drop the lockfile-only commit

Find the top commit(s) that touch only `yarn.lock`. The simplest check: if the top commit's diff is exclusively `yarn.lock`, it's the lockfile commit. Note the commit hash of the oldest real change commit — that's your rebase base.

```bash
git show --stat HEAD # confirm it's lockfile-only
```

The real commits sit below it. You need to rebase `HEAD~N` (excluding the lockfile commit) onto `origin/main`, where N depends on how many real commits there are.

Use `--onto` to be explicit:

```bash
# Drop top 1 lockfile commit, rebase the rest onto origin/main
git rebase --onto origin/main <lockfile-commit-hash> HEAD~1
```

Or equivalently, identify the merge-base and rebase with an interactive-style onto. The key is that `yarn.lock` must NOT be part of what you rebase — it will be regenerated.

### 3. Resolve conflicts

During rebase, conflicts are most likely in `.yarnrc.yml` (the `npmPreapprovedPackages` list). When resolving:

- **Keep both sides** — don't drop entries that main added. The list should contain all entries from both sides.

Example resolution for `npmPreapprovedPackages`:
```yaml
npmPreapprovedPackages:
- '@hyperdx/*' # from main
- "@clickhouse/*" # from this branch
```

After resolving:
```bash
git add <conflicted-file>
GIT_EDITOR=true git rebase --continue
```

### 4. Verify the change is complete

All packages that depend on `@clickhouse/client` must pin to `"head"`. After rebase, check:

```bash
grep -r "@clickhouse/client" packages/*/package.json
```

Every hit should show `"head"`, not a semver like `"^1.x.x"`. Currently the relevant files are:
- `packages/common-utils/package.json` — `@clickhouse/client`, `@clickhouse/client-common`, `@clickhouse/client-web`
- `packages/cli/package.json` — `@clickhouse/client`, `@clickhouse/client-common`

If any package still has a semver version, update it to `"head"` and amend the relevant commit.

### 5. Regenerate the lockfile

```bash
yarn
```

This resolves `@clickhouse/client*` to the current HEAD build (e.g. `1.x.x-head.<sha>.1`). The existing `yarn.lock` entries for those packages will be replaced.

### 6. Commit the lockfile

```bash
git add yarn.lock
git commit -m "yarn"
```

### 7. Force-push

```bash
git push --force-with-lease origin clickhouse-js-client-release-test
```

`--force-with-lease` is safe here because this branch is intentionally non-fast-forward after every rebase.

## After the rebase

Confirm the branch log looks right:

```bash
git log --oneline origin/main..HEAD
```

Expected output: the lockfile commit on top, the real change commits below it, nothing else.
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ npmMinimalAgeGate: 7d

npmPreapprovedPackages:
- '@hyperdx/*'
- "@clickhouse/*"
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"compile:macos-x64": "bun build src/cli.tsx --compile --target=bun-darwin-x64 --outfile dist/hdx-darwin-x64"
},
"devDependencies": {
"@clickhouse/client": "^1.12.1",
"@clickhouse/client-common": "^1.12.1",
"@clickhouse/client": "head",
"@clickhouse/client-common": "head",
"@hyperdx/common-utils": "^0.18.1",
"@types/crypto-js": "^4.2.2",
"@types/react": "^19.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/common-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"node": ">=22.16.0"
},
"dependencies": {
"@clickhouse/client": "^1.12.1",
"@clickhouse/client-common": "^1.12.1",
"@clickhouse/client-web": "^1.12.1",
"@clickhouse/client": "head",
"@clickhouse/client-common": "head",
"@clickhouse/client-web": "head",
"@hyperdx/lucene": "^3.1.1",
"date-fns": "^2.28.0",
"date-fns-tz": "^2.0.0",
Expand Down
38 changes: 19 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3019,28 +3019,28 @@ __metadata:
languageName: node
linkType: hard

"@clickhouse/client-common@npm:1.12.1, @clickhouse/client-common@npm:^1.12.1":
version: 1.12.1
resolution: "@clickhouse/client-common@npm:1.12.1"
checksum: 10c0/9f475c8517b164c3676a969b60c8165a4b0558906917dbe97ae35f69f2702a6fc198cbdb2e6d2ec3543c627ec04a7e2fccb41f3114452bf7f4818152c0f98a5d
"@clickhouse/client-common@npm:1.18.4-head.2d7ef25.1, @clickhouse/client-common@npm:head":
version: 1.18.4-head.2d7ef25.1
resolution: "@clickhouse/client-common@npm:1.18.4-head.2d7ef25.1"
checksum: 10c0/d41e467c1eb920a1bcfb5b7b7eff38da901a3db9002691a1a90e7073d046cf5e8d4106640fad52d25bb1752a18f881b6cb63fe2cc9a25af5fc351bdba45d66c4
languageName: node
linkType: hard

"@clickhouse/client-web@npm:^1.12.1":
version: 1.12.1
resolution: "@clickhouse/client-web@npm:1.12.1"
"@clickhouse/client-web@npm:head":
version: 1.18.4-head.2d7ef25.1
resolution: "@clickhouse/client-web@npm:1.18.4-head.2d7ef25.1"
dependencies:
"@clickhouse/client-common": "npm:1.12.1"
checksum: 10c0/3e374288a2e0e4ced37220638629612dc8d6ced66490c2bdac136ddb887d5e108b9992b26d57911d6007bd47eaf7a754caa48e3afdfdb44cbd4f07bec7900995
"@clickhouse/client-common": "npm:1.18.4-head.2d7ef25.1"
checksum: 10c0/fd67de929ab3ec08e827db4f4a22ff9e1faccf3e5f7b1d643b859be278fa80baa54fb54d8eed1e32c510a7d2e489db36dbae5227190c98cc24c535f98740c302
languageName: node
linkType: hard

"@clickhouse/client@npm:^1.12.1":
version: 1.12.1
resolution: "@clickhouse/client@npm:1.12.1"
"@clickhouse/client@npm:head":
version: 1.18.4-head.2d7ef25.1
resolution: "@clickhouse/client@npm:1.18.4-head.2d7ef25.1"
dependencies:
"@clickhouse/client-common": "npm:1.12.1"
checksum: 10c0/4d715accad5ba74248c63fab83469ebeffc16d7cc5050ee7e5f9e7dd48d0e7c4b79517bf5917f2a60599960aee997e5d8341c480d056286f5d9a86530623211f
"@clickhouse/client-common": "npm:1.18.4-head.2d7ef25.1"
checksum: 10c0/ef1ce1d7d24f9b334bbb72b946c1d35815a4c8d577ed368778101217db4334fd7554b23d293a885b161050a7f3e1c861b9a2775acd288a16619e198e36a84389
languageName: node
linkType: hard

Expand Down Expand Up @@ -4545,8 +4545,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "@hyperdx/cli@workspace:packages/cli"
dependencies:
"@clickhouse/client": "npm:^1.12.1"
"@clickhouse/client-common": "npm:^1.12.1"
"@clickhouse/client": "npm:head"
"@clickhouse/client-common": "npm:head"
"@hyperdx/common-utils": "npm:^0.18.1"
"@types/crypto-js": "npm:^4.2.2"
"@types/react": "npm:^19.0.0"
Expand All @@ -4573,9 +4573,9 @@ __metadata:
version: 0.0.0-use.local
resolution: "@hyperdx/common-utils@workspace:packages/common-utils"
dependencies:
"@clickhouse/client": "npm:^1.12.1"
"@clickhouse/client-common": "npm:^1.12.1"
"@clickhouse/client-web": "npm:^1.12.1"
"@clickhouse/client": "npm:head"
"@clickhouse/client-common": "npm:head"
"@clickhouse/client-web": "npm:head"
"@hyperdx/lucene": "npm:^3.1.1"
"@types/hyperdx__lucene": "npm:@types/lucene@*"
"@types/jest": "npm:^29.5.14"
Expand Down
Loading