From d1faf286c4ed872903b76fcaa71e3cc2442b5ffc Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Wed, 1 Jul 2026 18:07:27 -0700 Subject: [PATCH 01/20] feat: set up `mise`-based workflow for initial codebase setup --- .bun-version | 1 + .github/actions/setup/action.yml | 2 +- CONTRIBUTING.md | 18 ++++++++++++++++++ mise.toml | 18 ++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .bun-version create mode 100644 mise.toml diff --git a/.bun-version b/.bun-version new file mode 100644 index 0000000000..7962dcfdb6 --- /dev/null +++ b/.bun-version @@ -0,0 +1 @@ +1.3.13 diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index cdd585bae4..f4318e7313 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -20,7 +20,7 @@ runs: steps: - name: Resolve Bun version shell: bash - run: echo "BUN_VERSION=1.3.13" >> "$GITHUB_ENV" + run: echo "BUN_VERSION=$(cat .bun-version)" >> "$GITHUB_ENV" - name: Install Bun id: install-bun diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cfa452dd09..65c56146eb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,6 +4,24 @@ Bun monorepo for exploring the next generation of the Supabase CLI and local dev ## Setup +### Tool versions + +This repo supports the use of [`mise`](https://mise.jdx.dev/) to manage the tool versions (Node, Bun, Go, pnpm, golangci-lint) needed to work on it. + +If you don't already have these tools installed, you can set up `mise` (by going through steps 1 [here](https://mise.en.dev/getting-started.html)) and let it install the correct versions for you. + +Once `mise` is up and running, run this from the repo root to install the pinned tool versions: + +```sh +mise install +``` + +This reads `mise.toml` (and a handful of downstream files) to install matching versions of Node, Bun, pnpm, Go, and golangci-lint, and makes them available whenever you `cd` into this repo. + +If you already have these tools installed and managed some other way, `mise` is not required — just make sure your versions match the ones pinned in `apps/cli-go/go.mod`, `.bun-version`, and `.nvmrc`. + +### Install dependencies + Install workspace dependencies: ```sh diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000000..3861d2339d --- /dev/null +++ b/mise.toml @@ -0,0 +1,18 @@ +monorepo_root = true + +[monorepo] +config_roots = [ + "apps/*", + "packages/*", +] + +[settings] +# uses .bun-version and .nvmrc to determine the bun and node versions to use +idiomatic_version_file_enable_tools = ["bun", "node"] + +[tools] +# extracts the go version from the go.mod file in apps/cli-go +go = "{{ exec(command=`awk '/^go / {print $2}' apps/cli-go/go.mod`) }}" +golangci-lint = "2" +# extracts the pnpm version from the root package.json file +pnpm = """{{ exec(command=`jq -r '.packageManager | split("@")[1]' package.json`) }}""" From 62244b359871ac654e978a09084deef1bca215b2 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Wed, 1 Jul 2026 18:16:31 -0700 Subject: [PATCH 02/20] cleanup --- CONTRIBUTING.md | 36 +++++++++++++++++++++++++++++++----- mise.toml | 4 ++-- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 65c56146eb..bb210a157f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,19 +6,45 @@ Bun monorepo for exploring the next generation of the Supabase CLI and local dev ### Tool versions -This repo supports the use of [`mise`](https://mise.jdx.dev/) to manage the tool versions (Node, Bun, Go, pnpm, golangci-lint) needed to work on it. +This repo pins the versions of Node, Bun, Go, pnpm, and golangci-lint that contributors are expected to build against, and uses [`mise`](https://mise.jdx.dev/) — a polyglot version manager — to install and activate them automatically. If you don't already have these tools installed, `mise` is the fastest way to get a working set without hand-installing each one. -If you don't already have these tools installed, you can set up `mise` (by going through steps 1 [here](https://mise.en.dev/getting-started.html)) and let it install the correct versions for you. +#### Installing mise -Once `mise` is up and running, run this from the repo root to install the pinned tool versions: +```sh +# macOS / Linux +curl https://mise.run | sh + +# macOS via Homebrew +brew install mise +``` + +See the [`mise` installation docs](https://mise.jdx.dev/getting-started.html) for other package managers (apt, dnf, cargo, npm, Windows, …). + +`mise` needs to hook into your shell so it can inject the right tool versions into your `PATH` as you move between directories. Follow the `mise activate` instructions [in this section](https://mise.en.dev/getting-started.html#activate-mise) to add the activation line for your shell to its startup file. + +#### Installing the pinned tool versions + +From the repo root: ```sh mise install ``` -This reads `mise.toml` (and a handful of downstream files) to install matching versions of Node, Bun, pnpm, Go, and golangci-lint, and makes them available whenever you `cd` into this repo. +`mise` resolves the versions this repo expects from a handful of files, rather than hardcoding them all in one place: + +| Tool | Version source | +| --- | --- | +| Bun | `.bun-version` | +| Node.js | `.nvmrc` | +| pnpm | `packageManager` field in `package.json` | +| Go | `go.mod` in `apps/cli-go` | +| golangci-lint | `mise.toml` | + +Once installed, `mise` activates these versions automatically whenever your shell is inside this repo — no manual `nvm use`, `gvm use`, or similar switching required. + +#### Without mise -If you already have these tools installed and managed some other way, `mise` is not required — just make sure your versions match the ones pinned in `apps/cli-go/go.mod`, `.bun-version`, and `.nvmrc`. +`mise` is not required. If you already have Node, Bun, Go, and pnpm installed and managed some other way, just make sure your versions match the ones pinned in `.bun-version`, `.nvmrc`, `package.json`, and `apps/cli-go/go.mod`. ### Install dependencies diff --git a/mise.toml b/mise.toml index 3861d2339d..86be2da310 100644 --- a/mise.toml +++ b/mise.toml @@ -11,8 +11,8 @@ config_roots = [ idiomatic_version_file_enable_tools = ["bun", "node"] [tools] -# extracts the go version from the go.mod file in apps/cli-go +# extracts the go version from `apps/cli-go/go.mod` go = "{{ exec(command=`awk '/^go / {print $2}' apps/cli-go/go.mod`) }}" golangci-lint = "2" -# extracts the pnpm version from the root package.json file +# extracts the pnpm version from `package.json` (in the root) pnpm = """{{ exec(command=`jq -r '.packageManager | split("@")[1]' package.json`) }}""" From 9e866940df35bc3831a2267397baf006679b045e Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Thu, 2 Jul 2026 07:28:00 -0700 Subject: [PATCH 03/20] chore: simplify pnpm installation --- mise.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mise.toml b/mise.toml index 86be2da310..e6b7c7bc68 100644 --- a/mise.toml +++ b/mise.toml @@ -1,5 +1,9 @@ monorepo_root = true +[hooks] +# installs the package manager (e.g., pnpm) for the project, if it is not already installed +postinstall = "corepack enable" + [monorepo] config_roots = [ "apps/*", @@ -14,5 +18,3 @@ idiomatic_version_file_enable_tools = ["bun", "node"] # extracts the go version from `apps/cli-go/go.mod` go = "{{ exec(command=`awk '/^go / {print $2}' apps/cli-go/go.mod`) }}" golangci-lint = "2" -# extracts the pnpm version from `package.json` (in the root) -pnpm = """{{ exec(command=`jq -r '.packageManager | split("@")[1]' package.json`) }}""" From c4965ae020056ac24bedc3d6325994683980b9c1 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Thu, 2 Jul 2026 07:30:34 -0700 Subject: [PATCH 04/20] docs: more cleanup --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bb210a157f..9c8ea0ea82 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ Bun monorepo for exploring the next generation of the Supabase CLI and local dev ### Tool versions -This repo pins the versions of Node, Bun, Go, pnpm, and golangci-lint that contributors are expected to build against, and uses [`mise`](https://mise.jdx.dev/) — a polyglot version manager — to install and activate them automatically. If you don't already have these tools installed, `mise` is the fastest way to get a working set without hand-installing each one. +This repo pins the versions of Node, Bun, Go, pnpm, and golangci-lint that contributors are expected to build against, and uses [`mise`](https://mise.jdx.dev/) — a polyglot version manager — to install and activate them automatically. If you don't already have these tools installed, `mise` is a great way to get up and running quickly. #### Installing mise @@ -44,7 +44,7 @@ Once installed, `mise` activates these versions automatically whenever your shel #### Without mise -`mise` is not required. If you already have Node, Bun, Go, and pnpm installed and managed some other way, just make sure your versions match the ones pinned in `.bun-version`, `.nvmrc`, `package.json`, and `apps/cli-go/go.mod`. +`mise` is not required. If you already have Bun, Node, pnpm, and Go installed and managed some other way, just make sure your versions match the ones pinned in `.bun-version`, `.nvmrc`, `package.json`, and `apps/cli-go/go.mod`. ### Install dependencies From b5d90ecb51245d388ffad9939f9f025db5598275 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Thu, 2 Jul 2026 08:40:51 -0700 Subject: [PATCH 05/20] docs: use consistent link URLs Co-Authored-By: Andrew Valleteau --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9c8ea0ea82..c278f893bc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,7 +20,7 @@ brew install mise See the [`mise` installation docs](https://mise.jdx.dev/getting-started.html) for other package managers (apt, dnf, cargo, npm, Windows, …). -`mise` needs to hook into your shell so it can inject the right tool versions into your `PATH` as you move between directories. Follow the `mise activate` instructions [in this section](https://mise.en.dev/getting-started.html#activate-mise) to add the activation line for your shell to its startup file. +`mise` needs to hook into your shell so it can inject the right tool versions into your `PATH` as you move between directories. Follow the `mise activate` instructions [in this section](https://mise.jdx.dev/getting-started.html#activate-mise) to add the activation line for your shell to its startup file. #### Installing the pinned tool versions From 16598eaa33ae1b83ff6a3dfdab4cc8f47f1486a3 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Thu, 2 Jul 2026 08:41:16 -0700 Subject: [PATCH 06/20] chore: remove monorepo config, add min version --- mise.toml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mise.toml b/mise.toml index e6b7c7bc68..56d28bbc8c 100644 --- a/mise.toml +++ b/mise.toml @@ -1,15 +1,11 @@ monorepo_root = true +min_version = {soft = '2026.6.14'} + [hooks] # installs the package manager (e.g., pnpm) for the project, if it is not already installed postinstall = "corepack enable" -[monorepo] -config_roots = [ - "apps/*", - "packages/*", -] - [settings] # uses .bun-version and .nvmrc to determine the bun and node versions to use idiomatic_version_file_enable_tools = ["bun", "node"] From 68862e363e45cdc26b174c70f942616cbde5d1aa Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Thu, 2 Jul 2026 08:42:39 -0700 Subject: [PATCH 07/20] revert: install pnpm directly rather than relying on corepack reverts 9e866940df35bc3831a2267397baf006679b045e --- mise.toml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mise.toml b/mise.toml index 56d28bbc8c..bb2848761c 100644 --- a/mise.toml +++ b/mise.toml @@ -2,10 +2,6 @@ monorepo_root = true min_version = {soft = '2026.6.14'} -[hooks] -# installs the package manager (e.g., pnpm) for the project, if it is not already installed -postinstall = "corepack enable" - [settings] # uses .bun-version and .nvmrc to determine the bun and node versions to use idiomatic_version_file_enable_tools = ["bun", "node"] @@ -14,3 +10,5 @@ idiomatic_version_file_enable_tools = ["bun", "node"] # extracts the go version from `apps/cli-go/go.mod` go = "{{ exec(command=`awk '/^go / {print $2}' apps/cli-go/go.mod`) }}" golangci-lint = "2" +# extracts the pnpm version from `package.json` (in the root) +pnpm = """{{ exec(command=`jq -r '.packageManager | split("@")[1]' package.json`) }}""" From 47511ef255ae5dad9454c1a032873363ecbd16a9 Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Thu, 2 Jul 2026 09:15:23 -0700 Subject: [PATCH 08/20] chore: point to go.mod file for golangci-lint --- mise.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index bb2848761c..5cf7f80048 100644 --- a/mise.toml +++ b/mise.toml @@ -9,6 +9,7 @@ idiomatic_version_file_enable_tools = ["bun", "node"] [tools] # extracts the go version from `apps/cli-go/go.mod` go = "{{ exec(command=`awk '/^go / {print $2}' apps/cli-go/go.mod`) }}" -golangci-lint = "2" +# extracts the golangci-lint version from `apps/cli-go/go.mod` +golangci-lint = "{{ exec(command=`awk '/golangci-lint\\/v2 v/ {print $2}' apps/cli-go/go.mod`) }}" # extracts the pnpm version from `package.json` (in the root) pnpm = """{{ exec(command=`jq -r '.packageManager | split("@")[1]' package.json`) }}""" From 4471f6bd6891ca7bde1ee5aa350ab45b0b6c7d4f Mon Sep 17 00:00:00 2001 From: Kanad Gupta Date: Thu, 2 Jul 2026 09:20:09 -0700 Subject: [PATCH 09/20] chore: add `jq`, just in case --- mise.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index 5cf7f80048..fd2998512f 100644 --- a/mise.toml +++ b/mise.toml @@ -11,5 +11,7 @@ idiomatic_version_file_enable_tools = ["bun", "node"] go = "{{ exec(command=`awk '/^go / {print $2}' apps/cli-go/go.mod`) }}" # extracts the golangci-lint version from `apps/cli-go/go.mod` golangci-lint = "{{ exec(command=`awk '/golangci-lint\\/v2 v/ {print $2}' apps/cli-go/go.mod`) }}" +# just in case it's not already installed, used in the pnpm install step below +jq = "1" # extracts the pnpm version from `package.json` (in the root) -pnpm = """{{ exec(command=`jq -r '.packageManager | split("@")[1]' package.json`) }}""" +pnpm = {version = """{{ exec(command=`jq -r '.packageManager | split("@")[1]' package.json`) }}""", depends = ["jq"]} From 2e90cf9ead4ecbf44327d0ad73c8f63b5581f54c Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 3 Jul 2026 10:29:50 +0200 Subject: [PATCH 10/20] chore(dev): simplify mise tool version sources --- .nvmrc | 1 - .tool-versions | 1 + CONTRIBUTING.md | 20 ++++++++++++++++---- mise.toml | 17 ----------------- package.json | 6 ++++++ 5 files changed, 23 insertions(+), 22 deletions(-) delete mode 100644 .nvmrc create mode 100644 .tool-versions delete mode 100644 mise.toml diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index cabf43b5dd..0000000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -24 \ No newline at end of file diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000000..69475a4a1f --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +go 1.25.5 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c278f893bc..488d6a07cf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,8 +22,18 @@ See the [`mise` installation docs](https://mise.jdx.dev/getting-started.html) fo `mise` needs to hook into your shell so it can inject the right tool versions into your `PATH` as you move between directories. Follow the `mise activate` instructions [in this section](https://mise.jdx.dev/getting-started.html#activate-mise) to add the activation line for your shell to its startup file. +This repo relies on `mise` support for reading Node and pnpm versions from `package.json`, so use mise `2026.7.0` or newer. + #### Installing the pinned tool versions +Enable the idiomatic version files used by this repo once on your machine: + +```sh +mise settings add idiomatic_version_file_enable_tools node +mise settings add idiomatic_version_file_enable_tools bun +mise settings add idiomatic_version_file_enable_tools pnpm +``` + From the repo root: ```sh @@ -35,16 +45,18 @@ mise install | Tool | Version source | | --- | --- | | Bun | `.bun-version` | -| Node.js | `.nvmrc` | +| Node.js | `devEngines.runtime` field in `package.json` | | pnpm | `packageManager` field in `package.json` | -| Go | `go.mod` in `apps/cli-go` | -| golangci-lint | `mise.toml` | +| Go | `.tool-versions` | +| golangci-lint | `apps/cli-go/go.mod` | + +The Go entry in `.tool-versions` is intentionally temporary while the Go CLI remains in the repo. The canonical Go module metadata still lives in `apps/cli-go/go.mod`; keep the `.tool-versions` Go entry aligned only until the Go code is removed. Once installed, `mise` activates these versions automatically whenever your shell is inside this repo — no manual `nvm use`, `gvm use`, or similar switching required. #### Without mise -`mise` is not required. If you already have Bun, Node, pnpm, and Go installed and managed some other way, just make sure your versions match the ones pinned in `.bun-version`, `.nvmrc`, `package.json`, and `apps/cli-go/go.mod`. +`mise` is not required. If you already have Bun, Node, pnpm, and Go installed and managed some other way, just make sure your versions match the ones pinned in `.bun-version`, `.tool-versions`, `package.json`, and `apps/cli-go/go.mod`. ### Install dependencies diff --git a/mise.toml b/mise.toml deleted file mode 100644 index fd2998512f..0000000000 --- a/mise.toml +++ /dev/null @@ -1,17 +0,0 @@ -monorepo_root = true - -min_version = {soft = '2026.6.14'} - -[settings] -# uses .bun-version and .nvmrc to determine the bun and node versions to use -idiomatic_version_file_enable_tools = ["bun", "node"] - -[tools] -# extracts the go version from `apps/cli-go/go.mod` -go = "{{ exec(command=`awk '/^go / {print $2}' apps/cli-go/go.mod`) }}" -# extracts the golangci-lint version from `apps/cli-go/go.mod` -golangci-lint = "{{ exec(command=`awk '/golangci-lint\\/v2 v/ {print $2}' apps/cli-go/go.mod`) }}" -# just in case it's not already installed, used in the pnpm install step below -jq = "1" -# extracts the pnpm version from `package.json` (in the root) -pnpm = {version = """{{ exec(command=`jq -r '.packageManager | split("@")[1]' package.json`) }}""", depends = ["jq"]} diff --git a/package.json b/package.json index 0afc996a05..d835f5b2c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,12 @@ { "name": "@supabase/root", "private": true, + "devEngines": { + "runtime": { + "name": "node", + "version": "24" + } + }, "scripts": { "test:core": "nx run-many -t test:unit test:integration --coverage.enabled", "test:e2e": "nx run-many -t test:e2e", From 32bbad0b6064fd4576f0b4901da9eec8c1625990 Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 3 Jul 2026 10:33:26 +0200 Subject: [PATCH 11/20] ci: use mise for shared tool setup --- .github/actions/setup/action.yml | 69 ++++++++++++----------- .github/workflows/build-cli-artifacts.yml | 7 --- .github/workflows/cli-go-ci.yml | 6 +- .github/workflows/live-e2e.yml | 6 -- .github/workflows/test.yml | 28 +++------ 5 files changed, 49 insertions(+), 67 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index f4318e7313..db7acfda93 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -9,8 +9,8 @@ inputs: default: "" dependency-cache: description: >- - Whether to enable the pnpm dependency cache. Disable this when the job - deletes the pnpm store before exiting, otherwise the post-job cache save + Whether to enable dependency caches. Disable this when the job deletes a + cached dependency path before exiting, otherwise the post-job cache save fails with a path validation error. required: false default: "true" @@ -18,47 +18,50 @@ inputs: runs: using: "composite" steps: - - name: Resolve Bun version - shell: bash - run: echo "BUN_VERSION=$(cat .bun-version)" >> "$GITHUB_ENV" - - - name: Install Bun - id: install-bun - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 - continue-on-error: true - with: - bun-version: ${{ env.BUN_VERSION }} - - - name: Install Bun (fallback with retries) - if: steps.install-bun.outcome == 'failure' - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 + - name: Install toolchains + uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4 + env: + MISE_IDIOMATIC_VERSION_FILE_ENABLE_TOOLS: node,bun,pnpm with: - timeout_minutes: 3 - max_attempts: 5 - retry_wait_seconds: 30 - command: | - curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}" - echo "$HOME/.bun/bin" >> "$GITHUB_PATH" + version: 2026.7.0 + install: true + cache_key: >- + {{cache_key_prefix}}-{{platform}}-{{version}}-${{ + hashFiles('.tool-versions', '.bun-version', 'package.json') }} - - name: Verify Bun + - name: Resolve pnpm store path + if: inputs.dependency-cache == 'true' + id: pnpm-store shell: bash - run: bun --version + run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" - - name: Install Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - name: Configure pnpm dependency cache + if: inputs.dependency-cache == 'true' + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: - node-version-file: .nvmrc - package-manager-cache: false + path: ${{ steps.pnpm-store.outputs.path }} + key: pnpm-store-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }} + restore-keys: | + pnpm-store-${{ runner.os }}-${{ runner.arch }}- - - name: Enable Corepack + - name: Resolve Go cache paths + if: inputs.dependency-cache == 'true' + id: go-cache shell: bash - run: npm install --global --force corepack && corepack enable + run: | + echo "mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" + echo "build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" - - name: Configure dependency cache + - name: Configure Go dependency cache if: inputs.dependency-cache == 'true' - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: - cache: pnpm + path: | + ${{ steps.go-cache.outputs.mod }} + ${{ steps.go-cache.outputs.build }} + key: go-cache-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('apps/cli-go/go.mod', 'apps/cli-go/go.sum') }} + restore-keys: | + go-cache-${{ runner.os }}-${{ runner.arch }}- - name: Install dependencies shell: bash diff --git a/.github/workflows/build-cli-artifacts.yml b/.github/workflows/build-cli-artifacts.yml index 336c125cbf..8faf9d0377 100644 --- a/.github/workflows/build-cli-artifacts.yml +++ b/.github/workflows/build-cli-artifacts.yml @@ -76,13 +76,6 @@ jobs: with: dependency-firewall-token: ${{ secrets.DF_FIREWALL_TOKEN }} - - name: Setup Go - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 - with: - go-version-file: apps/cli-go/go.mod - cache: true - cache-dependency-path: apps/cli-go/go.sum - - name: Pre-download Go modules working-directory: apps/cli-go run: go mod download -x diff --git a/.github/workflows/cli-go-ci.yml b/.github/workflows/cli-go-ci.yml index 0fc58f8c37..5dd99d8235 100644 --- a/.github/workflows/cli-go-ci.yml +++ b/.github/workflows/cli-go-ci.yml @@ -84,10 +84,14 @@ jobs: # Linter requires no cache cache: false + - name: Resolve golangci-lint version + id: golangci-lint + run: echo "version=$(go list -m -f '{{.Version}}' github.com/golangci/golangci-lint/v2)" >> "$GITHUB_OUTPUT" + - uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1 with: args: --timeout 5m --verbose - version: latest + version: ${{ steps.golangci-lint.outputs.version }} only-new-issues: true working-directory: apps/cli-go diff --git a/.github/workflows/live-e2e.yml b/.github/workflows/live-e2e.yml index a2954fcbde..efdb4a8374 100644 --- a/.github/workflows/live-e2e.yml +++ b/.github/workflows/live-e2e.yml @@ -113,12 +113,6 @@ jobs: - name: Setup uses: ./.github/actions/setup - - name: Setup Go - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 - with: - go-version-file: apps/cli-go/go.mod - cache-dependency-path: apps/cli-go/go.sum - # Build the Go binary for every target: `go` runs it directly and # `ts-legacy` shells out to it for most commands. - name: Build Go CLI diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e5da5adca0..73bbbee22a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,13 +43,11 @@ jobs: uses: ./.github/actions/setup with: dependency-firewall-token: ${{ secrets.DF_FIREWALL_TOKEN }} - - name: Setup Go - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 - with: - go-version-file: apps/cli-go/go.mod - cache-dependency-path: apps/cli-go/go.sum - name: Install golangci-lint - run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest && + working-directory: apps/cli-go + run: | + version="$(go list -m -f '{{.Version}}' github.com/golangci/golangci-lint/v2)" + go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${version}" echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" - name: Unlock keyring (for cli-go keyring tests) uses: t1m0thyj/unlock-keyring@cbcf205c879ebd86add70bab3a6abfcce59a5cae # v1.2.0 @@ -74,13 +72,11 @@ jobs: uses: ./.github/actions/setup with: dependency-firewall-token: ${{ secrets.DF_FIREWALL_TOKEN }} - - name: Setup Go - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 - with: - go-version-file: apps/cli-go/go.mod - cache-dependency-path: apps/cli-go/go.sum - name: Install golangci-lint - run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest && + working-directory: apps/cli-go + run: | + version="$(go list -m -f '{{.Version}}' github.com/golangci/golangci-lint/v2)" + go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${version}" echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" - name: Unlock keyring (for cli-go keyring tests) uses: t1m0thyj/unlock-keyring@cbcf205c879ebd86add70bab3a6abfcce59a5cae # v1.2.0 @@ -144,14 +140,6 @@ jobs: key: go-cli-${{ runner.os }}-${{ hashFiles('apps/cli-go/**/*.go', 'apps/cli-go/go.mod', 'apps/cli-go/go.sum') }} - - name: Setup Go - if: steps.detect.outputs.cli_e2e == 'true' && - steps.cache-go-binary.outputs.cache-hit != 'true' - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 - with: - go-version-file: apps/cli-go/go.mod - cache-dependency-path: apps/cli-go/go.sum - - name: Build Go CLI if: steps.detect.outputs.cli_e2e == 'true' && steps.cache-go-binary.outputs.cache-hit != 'true' From 4784613cd2737b678403bd91c3e47c11bfdfb2a2 Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 3 Jul 2026 10:46:52 +0200 Subject: [PATCH 12/20] ci: tighten mise cache key --- .github/actions/setup/action.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index db7acfda93..07a036fcd9 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -18,6 +18,26 @@ inputs: runs: using: "composite" steps: + - name: Resolve mise cache key + id: mise-cache-key + shell: bash + run: | + python3 <<'PY' >> "$GITHUB_OUTPUT" + import hashlib + import json + from pathlib import Path + + package_json = json.loads(Path("package.json").read_text()) + payload = { + "bun": Path(".bun-version").read_text().strip(), + "go": Path(".tool-versions").read_text().strip(), + "node": package_json.get("devEngines", {}).get("runtime"), + "pnpm": package_json.get("packageManager"), + } + digest = hashlib.sha256(json.dumps(payload, sort_keys=True).encode()).hexdigest() + print(f"hash={digest}") + PY + - name: Install toolchains uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4 env: @@ -27,7 +47,7 @@ runs: install: true cache_key: >- {{cache_key_prefix}}-{{platform}}-{{version}}-${{ - hashFiles('.tool-versions', '.bun-version', 'package.json') }} + steps.mise-cache-key.outputs.hash }} - name: Resolve pnpm store path if: inputs.dependency-cache == 'true' From 4e1c9852f6e03ccbc3df4ee2d2955c66f4d7ce61 Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 3 Jul 2026 11:10:44 +0200 Subject: [PATCH 13/20] ci: fix mise setup path activation --- .github/actions/setup/action.yml | 10 ++++++++++ .tool-versions | 2 +- apps/cli-go/go.mod | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 07a036fcd9..14c78ed1c3 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -49,6 +49,16 @@ runs: {{cache_key_prefix}}-{{platform}}-{{version}}-${{ steps.mise-cache-key.outputs.hash }} + - name: Add toolchains to PATH + shell: bash + env: + MISE_IDIOMATIC_VERSION_FILE_ENABLE_TOOLS: node,bun,pnpm + run: | + echo "$(mise where go)/bin" >> "$GITHUB_PATH" + echo "$(mise where node)/bin" >> "$GITHUB_PATH" + echo "$(mise where pnpm)" >> "$GITHUB_PATH" + echo "$(mise where bun)/bin" >> "$GITHUB_PATH" + - name: Resolve pnpm store path if: inputs.dependency-cache == 'true' id: pnpm-store diff --git a/.tool-versions b/.tool-versions index 69475a4a1f..f858909a30 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -go 1.25.5 +go 1.25.11 diff --git a/apps/cli-go/go.mod b/apps/cli-go/go.mod index e11a2d06fc..c9961ac356 100644 --- a/apps/cli-go/go.mod +++ b/apps/cli-go/go.mod @@ -1,6 +1,6 @@ module github.com/supabase/cli -go 1.25.5 +go 1.25.11 require ( github.com/BurntSushi/toml v1.6.0 From a64f089c33e9db4c460c5eec719fea4010d3c9b4 Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 3 Jul 2026 11:14:58 +0200 Subject: [PATCH 14/20] ci: address mise review followups --- .github/actions/setup/action.yml | 29 +++++++++++++++-------------- CONTRIBUTING.md | 14 +++++++++++++- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 14c78ed1c3..13a5d8398b 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -22,21 +22,22 @@ runs: id: mise-cache-key shell: bash run: | - python3 <<'PY' >> "$GITHUB_OUTPUT" - import hashlib - import json - from pathlib import Path + node <<'JS' >> "$GITHUB_OUTPUT" + const { createHash } = require("node:crypto"); + const { readFileSync } = require("node:fs"); - package_json = json.loads(Path("package.json").read_text()) - payload = { - "bun": Path(".bun-version").read_text().strip(), - "go": Path(".tool-versions").read_text().strip(), - "node": package_json.get("devEngines", {}).get("runtime"), - "pnpm": package_json.get("packageManager"), - } - digest = hashlib.sha256(json.dumps(payload, sort_keys=True).encode()).hexdigest() - print(f"hash={digest}") - PY + const packageJson = JSON.parse(readFileSync("package.json", "utf8")); + const payload = { + bun: readFileSync(".bun-version", "utf8").trim(), + go: readFileSync(".tool-versions", "utf8").trim(), + node: packageJson.devEngines?.runtime, + pnpm: packageJson.packageManager, + }; + const digest = createHash("sha256") + .update(JSON.stringify(payload)) + .digest("hex"); + console.log(`hash=${digest}`); + JS - name: Install toolchains uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 488d6a07cf..82955ecf0c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ Bun monorepo for exploring the next generation of the Supabase CLI and local dev ### Tool versions -This repo pins the versions of Node, Bun, Go, pnpm, and golangci-lint that contributors are expected to build against, and uses [`mise`](https://mise.jdx.dev/) — a polyglot version manager — to install and activate them automatically. If you don't already have these tools installed, `mise` is a great way to get up and running quickly. +This repo pins the versions of Node, Bun, Go, pnpm, and golangci-lint that contributors are expected to build against, and uses [`mise`](https://mise.jdx.dev/) — a polyglot version manager — to install and activate Node, Bun, Go, and pnpm automatically. If you don't already have these tools installed, `mise` is a great way to get up and running quickly. #### Installing mise @@ -40,6 +40,18 @@ From the repo root: mise install ``` +Install the Go linter recorded by the Go module: + +```sh +( + cd apps/cli-go + version="$(go list -m -f '{{.Version}}' github.com/golangci/golangci-lint/v2)" + go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${version}" +) +``` + +Make sure `$(go env GOPATH)/bin` is on your `PATH` so `pnpm run check:all` can find `golangci-lint`. + `mise` resolves the versions this repo expects from a handful of files, rather than hardcoding them all in one place: | Tool | Version source | From c972bd6a746cb3ed70fde7523da71e23dbb433bc Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 3 Jul 2026 11:17:19 +0200 Subject: [PATCH 15/20] ci: build go linter with setup toolchain --- .github/workflows/cli-go-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cli-go-ci.yml b/.github/workflows/cli-go-ci.yml index 5dd99d8235..7c6feb65b4 100644 --- a/.github/workflows/cli-go-ci.yml +++ b/.github/workflows/cli-go-ci.yml @@ -91,6 +91,7 @@ jobs: - uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1 with: args: --timeout 5m --verbose + install-mode: goinstall version: ${{ steps.golangci-lint.outputs.version }} only-new-issues: true working-directory: apps/cli-go From 9e0d7be6b0789ec75921704a6c1855e89d8c54ae Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 3 Jul 2026 11:35:27 +0200 Subject: [PATCH 16/20] ci: cache go linter binary --- .github/workflows/cli-go-ci.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cli-go-ci.yml b/.github/workflows/cli-go-ci.yml index 7c6feb65b4..5635f8327c 100644 --- a/.github/workflows/cli-go-ci.yml +++ b/.github/workflows/cli-go-ci.yml @@ -88,11 +88,36 @@ jobs: id: golangci-lint run: echo "version=$(go list -m -f '{{.Version}}' github.com/golangci/golangci-lint/v2)" >> "$GITHUB_OUTPUT" + - name: Resolve Go environment + id: go-env + run: | + go_bin="$(go env GOBIN)" + if [ -z "$go_bin" ]; then + go_bin="$(go env GOPATH)/bin" + fi + + { + echo "bin=${go_bin}" + echo "version=$(go env GOVERSION)" + } >> "$GITHUB_OUTPUT" + + echo "${go_bin}" >> "$GITHUB_PATH" + + - name: Cache golangci-lint binary + id: golangci-lint-cache + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ steps.go-env.outputs.bin }}/golangci-lint + key: golangci-lint-${{ runner.os }}-${{ runner.arch }}-${{ steps.go-env.outputs.version }}-${{ steps.golangci-lint.outputs.version }} + + - name: Install golangci-lint + if: steps.golangci-lint-cache.outputs.cache-hit != 'true' + run: go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${{ steps.golangci-lint.outputs.version }}" + - uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1 with: args: --timeout 5m --verbose - install-mode: goinstall - version: ${{ steps.golangci-lint.outputs.version }} + install-mode: none only-new-issues: true working-directory: apps/cli-go From 5e00d1f4aa3110608381b69cad2f9797651c1270 Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 3 Jul 2026 11:45:59 +0200 Subject: [PATCH 17/20] chore(dev): trust repo mise settings --- .github/actions/setup/action.yml | 5 +---- CONTRIBUTING.md | 10 ++++------ mise.toml | 2 ++ 3 files changed, 7 insertions(+), 10 deletions(-) create mode 100644 mise.toml diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 13a5d8398b..65d6829ba5 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -30,6 +30,7 @@ runs: const payload = { bun: readFileSync(".bun-version", "utf8").trim(), go: readFileSync(".tool-versions", "utf8").trim(), + mise: readFileSync("mise.toml", "utf8").trim(), node: packageJson.devEngines?.runtime, pnpm: packageJson.packageManager, }; @@ -41,8 +42,6 @@ runs: - name: Install toolchains uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4 - env: - MISE_IDIOMATIC_VERSION_FILE_ENABLE_TOOLS: node,bun,pnpm with: version: 2026.7.0 install: true @@ -52,8 +51,6 @@ runs: - name: Add toolchains to PATH shell: bash - env: - MISE_IDIOMATIC_VERSION_FILE_ENABLE_TOOLS: node,bun,pnpm run: | echo "$(mise where go)/bin" >> "$GITHUB_PATH" echo "$(mise where node)/bin" >> "$GITHUB_PATH" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 82955ecf0c..dd5e74e17d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,15 +26,13 @@ This repo relies on `mise` support for reading Node and pnpm versions from `pack #### Installing the pinned tool versions -Enable the idiomatic version files used by this repo once on your machine: +Trust this repo's `mise.toml` once from the repo root so `mise` can read the project setting that enables idiomatic version files: ```sh -mise settings add idiomatic_version_file_enable_tools node -mise settings add idiomatic_version_file_enable_tools bun -mise settings add idiomatic_version_file_enable_tools pnpm +mise trust ``` -From the repo root: +Then install the pinned tool versions: ```sh mise install @@ -52,7 +50,7 @@ Install the Go linter recorded by the Go module: Make sure `$(go env GOPATH)/bin` is on your `PATH` so `pnpm run check:all` can find `golangci-lint`. -`mise` resolves the versions this repo expects from a handful of files, rather than hardcoding them all in one place: +After `mise trust`, `mise` resolves the versions this repo expects from a handful of files, rather than hardcoding them all in one place: | Tool | Version source | | --- | --- | diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000000..057ffcab1e --- /dev/null +++ b/mise.toml @@ -0,0 +1,2 @@ +[settings] +idiomatic_version_file_enable_tools = ["node", "bun", "pnpm"] From 4244f04e63d12c4633717322af54c9019a0d13cc Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 3 Jul 2026 11:57:55 +0200 Subject: [PATCH 18/20] ci: rely on mise shims path --- .github/actions/setup/action.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 65d6829ba5..43973f695e 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -49,14 +49,6 @@ runs: {{cache_key_prefix}}-{{platform}}-{{version}}-${{ steps.mise-cache-key.outputs.hash }} - - name: Add toolchains to PATH - shell: bash - run: | - echo "$(mise where go)/bin" >> "$GITHUB_PATH" - echo "$(mise where node)/bin" >> "$GITHUB_PATH" - echo "$(mise where pnpm)" >> "$GITHUB_PATH" - echo "$(mise where bun)/bin" >> "$GITHUB_PATH" - - name: Resolve pnpm store path if: inputs.dependency-cache == 'true' id: pnpm-store From 80eb9c9229dadbc0de3b5188e5b7e3631aab4820 Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 3 Jul 2026 12:05:15 +0200 Subject: [PATCH 19/20] chore(dev): keep go pin in mise config --- .github/actions/setup/action.yml | 1 - .tool-versions | 1 - CONTRIBUTING.md | 6 +++--- mise.toml | 3 +++ 4 files changed, 6 insertions(+), 5 deletions(-) delete mode 100644 .tool-versions diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 43973f695e..12f3aab054 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -29,7 +29,6 @@ runs: const packageJson = JSON.parse(readFileSync("package.json", "utf8")); const payload = { bun: readFileSync(".bun-version", "utf8").trim(), - go: readFileSync(".tool-versions", "utf8").trim(), mise: readFileSync("mise.toml", "utf8").trim(), node: packageJson.devEngines?.runtime, pnpm: packageJson.packageManager, diff --git a/.tool-versions b/.tool-versions deleted file mode 100644 index f858909a30..0000000000 --- a/.tool-versions +++ /dev/null @@ -1 +0,0 @@ -go 1.25.11 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dd5e74e17d..c9b0a39973 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,16 +57,16 @@ After `mise trust`, `mise` resolves the versions this repo expects from a handfu | Bun | `.bun-version` | | Node.js | `devEngines.runtime` field in `package.json` | | pnpm | `packageManager` field in `package.json` | -| Go | `.tool-versions` | +| Go | `mise.toml` | | golangci-lint | `apps/cli-go/go.mod` | -The Go entry in `.tool-versions` is intentionally temporary while the Go CLI remains in the repo. The canonical Go module metadata still lives in `apps/cli-go/go.mod`; keep the `.tool-versions` Go entry aligned only until the Go code is removed. +The Go entry in `mise.toml` is intentionally temporary while the Go CLI remains in the repo. The canonical Go module metadata still lives in `apps/cli-go/go.mod`; keep the `mise.toml` Go entry aligned only until the Go code is removed. Once installed, `mise` activates these versions automatically whenever your shell is inside this repo — no manual `nvm use`, `gvm use`, or similar switching required. #### Without mise -`mise` is not required. If you already have Bun, Node, pnpm, and Go installed and managed some other way, just make sure your versions match the ones pinned in `.bun-version`, `.tool-versions`, `package.json`, and `apps/cli-go/go.mod`. +`mise` is not required. If you already have Bun, Node, pnpm, and Go installed and managed some other way, just make sure your versions match the ones pinned in `.bun-version`, `mise.toml`, `package.json`, and `apps/cli-go/go.mod`. ### Install dependencies diff --git a/mise.toml b/mise.toml index 057ffcab1e..cd4d918630 100644 --- a/mise.toml +++ b/mise.toml @@ -1,2 +1,5 @@ +[tools] +go = "1.25.11" + [settings] idiomatic_version_file_enable_tools = ["node", "bun", "pnpm"] From 26d0c81d829859eaad28926d0c5c709e1be4f1ef Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 3 Jul 2026 12:17:35 +0200 Subject: [PATCH 20/20] chore(dev): install go linter with mise --- .github/workflows/cli-go-ci.yml | 40 +++++---------------------------- .github/workflows/test.yml | 12 ---------- CONTRIBUTING.md | 18 +++------------ mise.toml | 1 + 4 files changed, 10 insertions(+), 61 deletions(-) diff --git a/.github/workflows/cli-go-ci.yml b/.github/workflows/cli-go-ci.yml index 5635f8327c..fdf2dcb52f 100644 --- a/.github/workflows/cli-go-ci.yml +++ b/.github/workflows/cli-go-ci.yml @@ -78,41 +78,13 @@ jobs: with: persist-credentials: false - - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 + - uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4 with: - go-version-file: apps/cli-go/go.mod - # Linter requires no cache - cache: false - - - name: Resolve golangci-lint version - id: golangci-lint - run: echo "version=$(go list -m -f '{{.Version}}' github.com/golangci/golangci-lint/v2)" >> "$GITHUB_OUTPUT" - - - name: Resolve Go environment - id: go-env - run: | - go_bin="$(go env GOBIN)" - if [ -z "$go_bin" ]; then - go_bin="$(go env GOPATH)/bin" - fi - - { - echo "bin=${go_bin}" - echo "version=$(go env GOVERSION)" - } >> "$GITHUB_OUTPUT" - - echo "${go_bin}" >> "$GITHUB_PATH" - - - name: Cache golangci-lint binary - id: golangci-lint-cache - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: ${{ steps.go-env.outputs.bin }}/golangci-lint - key: golangci-lint-${{ runner.os }}-${{ runner.arch }}-${{ steps.go-env.outputs.version }}-${{ steps.golangci-lint.outputs.version }} - - - name: Install golangci-lint - if: steps.golangci-lint-cache.outputs.cache-hit != 'true' - run: go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${{ steps.golangci-lint.outputs.version }}" + version: 2026.7.0 + install: true + install_args: >- + go + go:github.com/golangci/golangci-lint/v2/cmd/golangci-lint - uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 73bbbee22a..b56df22275 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,12 +43,6 @@ jobs: uses: ./.github/actions/setup with: dependency-firewall-token: ${{ secrets.DF_FIREWALL_TOKEN }} - - name: Install golangci-lint - working-directory: apps/cli-go - run: | - version="$(go list -m -f '{{.Version}}' github.com/golangci/golangci-lint/v2)" - go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${version}" - echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" - name: Unlock keyring (for cli-go keyring tests) uses: t1m0thyj/unlock-keyring@cbcf205c879ebd86add70bab3a6abfcce59a5cae # v1.2.0 @@ -72,12 +66,6 @@ jobs: uses: ./.github/actions/setup with: dependency-firewall-token: ${{ secrets.DF_FIREWALL_TOKEN }} - - name: Install golangci-lint - working-directory: apps/cli-go - run: | - version="$(go list -m -f '{{.Version}}' github.com/golangci/golangci-lint/v2)" - go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${version}" - echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" - name: Unlock keyring (for cli-go keyring tests) uses: t1m0thyj/unlock-keyring@cbcf205c879ebd86add70bab3a6abfcce59a5cae # v1.2.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c9b0a39973..eff0cec734 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ Bun monorepo for exploring the next generation of the Supabase CLI and local dev ### Tool versions -This repo pins the versions of Node, Bun, Go, pnpm, and golangci-lint that contributors are expected to build against, and uses [`mise`](https://mise.jdx.dev/) — a polyglot version manager — to install and activate Node, Bun, Go, and pnpm automatically. If you don't already have these tools installed, `mise` is a great way to get up and running quickly. +This repo pins the versions of Node, Bun, Go, pnpm, and golangci-lint that contributors are expected to build against, and uses [`mise`](https://mise.jdx.dev/) — a polyglot version manager — to install and activate Node, Bun, Go, pnpm, and golangci-lint automatically. If you don't already have these tools installed, `mise` is a great way to get up and running quickly. #### Installing mise @@ -38,18 +38,6 @@ Then install the pinned tool versions: mise install ``` -Install the Go linter recorded by the Go module: - -```sh -( - cd apps/cli-go - version="$(go list -m -f '{{.Version}}' github.com/golangci/golangci-lint/v2)" - go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${version}" -) -``` - -Make sure `$(go env GOPATH)/bin` is on your `PATH` so `pnpm run check:all` can find `golangci-lint`. - After `mise trust`, `mise` resolves the versions this repo expects from a handful of files, rather than hardcoding them all in one place: | Tool | Version source | @@ -58,9 +46,9 @@ After `mise trust`, `mise` resolves the versions this repo expects from a handfu | Node.js | `devEngines.runtime` field in `package.json` | | pnpm | `packageManager` field in `package.json` | | Go | `mise.toml` | -| golangci-lint | `apps/cli-go/go.mod` | +| golangci-lint | `mise.toml` | -The Go entry in `mise.toml` is intentionally temporary while the Go CLI remains in the repo. The canonical Go module metadata still lives in `apps/cli-go/go.mod`; keep the `mise.toml` Go entry aligned only until the Go code is removed. +The Go and golangci-lint entries in `mise.toml` are intentionally temporary while the Go CLI remains in the repo. The canonical Go module metadata still lives in `apps/cli-go/go.mod`; keep the `mise.toml` entries aligned only until the Go code is removed. Once installed, `mise` activates these versions automatically whenever your shell is inside this repo — no manual `nvm use`, `gvm use`, or similar switching required. diff --git a/mise.toml b/mise.toml index cd4d918630..78f7662769 100644 --- a/mise.toml +++ b/mise.toml @@ -1,5 +1,6 @@ [tools] go = "1.25.11" +"go:github.com/golangci/golangci-lint/v2/cmd/golangci-lint" = "2.1.6" [settings] idiomatic_version_file_enable_tools = ["node", "bun", "pnpm"]