|
| 1 | +--- |
| 2 | +name: bump-pgducklake |
| 3 | +description: Bump pg_ducklake (and optionally DuckDB) to a new version. Updates all pinned commits and version constants across the repo. |
| 4 | +user_invocable: true |
| 5 | +allowed_tools: Bash, Read, Edit, Glob, Grep, WebFetch, AskUserQuestion |
| 6 | +--- |
| 7 | + |
| 8 | +# /bump-pgducklake — Bump pg_ducklake / DuckDB Version |
| 9 | + |
| 10 | +Bump the pg_ducklake commit pin (which transitively bumps DuckDB, pg_duckdb, and the ducklake extension) across all files in the repo. |
| 11 | + |
| 12 | +**IMPORTANT**: All paths below are relative to the **repo root** (the directory containing `Cargo.toml`, `Makefile`, and `duckpipe-pg/`). Determine the repo root at the start — if working inside a worktree, use the worktree root. |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +## Step 0 — Determine the Target |
| 17 | + |
| 18 | +Ask the user or infer from context: |
| 19 | +- **pg_ducklake commit**: the target commit hash on `https://github.com/relytcloud/pg_ducklake.git` (default: latest `main`) |
| 20 | +- **DuckDB version**: the DuckDB version that commit includes (check the pg_ducklake commit log for version bump commits) |
| 21 | + |
| 22 | +If the user just says "bump to latest", fetch the latest commit: |
| 23 | +```bash |
| 24 | +git ls-remote https://github.com/relytcloud/pg_ducklake.git refs/heads/main |
| 25 | +``` |
| 26 | + |
| 27 | +To find the DuckDB version, check the pg_ducklake repo's recent commits or `third_party/pg_duckdb/third_party/duckdb` submodule. |
| 28 | + |
| 29 | +--- |
| 30 | + |
| 31 | +## Step 1 — Determine the duckdb-rs Crate Version |
| 32 | + |
| 33 | +The `duckdb` Rust crate uses the version scheme `1.{10000*major + 100*minor + patch}.0`. For example: |
| 34 | +- DuckDB v1.5.0 → `1.10500.0` |
| 35 | +- DuckDB v1.5.1 → `1.10501.0` |
| 36 | +- DuckDB v1.6.0 → `1.10600.0` |
| 37 | + |
| 38 | +Verify the crate version exists on crates.io before proceeding: |
| 39 | +``` |
| 40 | +https://crates.io/api/v1/crates/duckdb/versions |
| 41 | +``` |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## Step 2 — Update All Version Pins |
| 46 | + |
| 47 | +There are **7 files** with version constants to update. Update all of them: |
| 48 | + |
| 49 | +### pg_ducklake commit (`PGDUCKLAKE_COMMIT`) |
| 50 | + |
| 51 | +| File | Variable | Format | |
| 52 | +|------|----------|--------| |
| 53 | +| `Makefile` | `PGDUCKLAKE_COMMIT ?= <hash>` | Make variable default | |
| 54 | +| `docker/Dockerfile` | `ARG PGDUCKLAKE_COMMIT=<hash>` | Docker ARG default (line 2) | |
| 55 | +| `docker/Dockerfile.daemon` | `ARG PGDUCKLAKE_COMMIT=<hash>` | Docker ARG default | |
| 56 | +| `docker/docker-bake.hcl` | `default = "<hash>"` | HCL variable default (in the `PGDUCKLAKE_COMMIT` variable block) | |
| 57 | + |
| 58 | +### DuckDB version (`DUCKDB_VERSION`) |
| 59 | + |
| 60 | +| File | Variable | Format | |
| 61 | +|------|----------|--------| |
| 62 | +| `docker/.env` | `DUCKDB_VERSION=v<version>` | Env var (e.g. `v1.5.1`) | |
| 63 | +| `docker/Dockerfile.daemon` | `ARG DUCKDB_VERSION=v<version>` | Docker ARG default | |
| 64 | +| `docker/docker-bake.hcl` | `default = "v<version>"` | HCL variable default (in the `DUCKDB_VERSION` variable block) | |
| 65 | + |
| 66 | +### duckdb-rs crate version |
| 67 | + |
| 68 | +| File | Variable | Format | |
| 69 | +|------|----------|--------| |
| 70 | +| `Cargo.toml` | `duckdb = { version = "=<crate_version>" }` | Exact pin in workspace deps | |
| 71 | + |
| 72 | +After editing `Cargo.toml`, update `Cargo.lock`: |
| 73 | +```bash |
| 74 | +cargo update -p duckdb |
| 75 | +``` |
| 76 | + |
| 77 | +--- |
| 78 | + |
| 79 | +## Step 3 — Ask User What Else to Do |
| 80 | + |
| 81 | +After updating all version pins, use AskUserQuestion to ask the user what additional steps to run: |
| 82 | + |
| 83 | +- Question: "Version pins updated. What else should I do?" |
| 84 | +- Options: |
| 85 | + 1. **Done** — Stop here (just the version pin updates) |
| 86 | + 2. **Build** — Also rebuild pg_duckpipe (`make build`) |
| 87 | + 3. **Build + Test** — Rebuild and run regression tests (`make installcheck`) |
| 88 | + |
| 89 | +If the user selects **Done**, skip to Step 6 (Summary). |
| 90 | + |
| 91 | +--- |
| 92 | + |
| 93 | +## Step 4 — Build pg_duckpipe (if requested) |
| 94 | + |
| 95 | +```bash |
| 96 | +PG_CONFIG=<pg_config_path> make build |
| 97 | +``` |
| 98 | + |
| 99 | +If there's a local pg_ducklake checkout that needs updating first, check if it's already at the target commit. If not, warn the user they may need to rebuild pg_ducklake first (via `/build` or manually). |
| 100 | + |
| 101 | +--- |
| 102 | + |
| 103 | +## Step 5 — Run Regression Tests (if requested) |
| 104 | + |
| 105 | +```bash |
| 106 | +PG_CONFIG=<pg_config_path> make check-regression |
| 107 | +``` |
| 108 | + |
| 109 | +All tests must pass before considering the bump complete. |
| 110 | + |
| 111 | +--- |
| 112 | + |
| 113 | +## Step 6 — Summary |
| 114 | + |
| 115 | +Print a summary of what was changed: |
| 116 | + |
| 117 | +``` |
| 118 | +Bumped pg_ducklake to <commit> (DuckDB v<version>) |
| 119 | +
|
| 120 | +Files updated: |
| 121 | + Makefile PGDUCKLAKE_COMMIT → <short_hash> |
| 122 | + docker/Dockerfile PGDUCKLAKE_COMMIT → <short_hash> |
| 123 | + docker/Dockerfile.daemon PGDUCKLAKE_COMMIT → <short_hash>, DUCKDB_VERSION → v<version> |
| 124 | + docker/docker-bake.hcl PGDUCKLAKE_COMMIT → <short_hash>, DUCKDB_VERSION → v<version> |
| 125 | + docker/.env DUCKDB_VERSION → v<version> |
| 126 | + Cargo.toml duckdb → =<crate_version> |
| 127 | + Cargo.lock (auto-updated) |
| 128 | +``` |
0 commit comments