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
58 changes: 20 additions & 38 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -451,24 +451,20 @@ jobs:
severity: 'CRITICAL'

# Credentials preflight (workflow_dispatch only). Proves, without
# publishing, what the tag run will need: an npm identity that can publish
# in the @checkgate scope, parseable pub.dev credentials, and a PyPI trusted
# publisher matching this workflow and environment. Prints no secret.
# publishing, what the tag run will need from npm and pub.dev: an npm
# identity with read-write access in the @checkgate scope and parseable
# pub.dev credentials. Prints no secret.
#
# The PyPI check exchanges this job's OIDC token for a short-lived upload
# token (discarded unused), exactly as publish-pypi will. If the publisher
# is still *pending* (project not yet on PyPI), that exchange creates the
# empty project `checkgate` under the account that registered it.
# PyPI cannot be checked here: the `pypi` environment only admits version
# tags, and the trusted publisher is bound to that environment. Instead,
# publish-pypi runs first in the tag run and every other publish job needs
# it, so a PyPI failure stops the release before anything is published.
preflight-credentials:
name: Preflight — publishing credentials
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/checkgate/
permissions:
contents: read
id-token: write
steps:
- uses: actions/setup-node@v5
with:
Expand Down Expand Up @@ -521,30 +517,14 @@ jobs:
console.log("pub.dev credentials: refresh token present");
});'

- name: PyPI — trusted publisher accepts this workflow
run: |
set -euo pipefail
AUD="$(curl -fsS https://pypi.org/_/oidc/audience | node -p 'JSON.parse(require("fs").readFileSync(0)).audience')"
OIDC="$(curl -fsS -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=$AUD" | node -p 'JSON.parse(require("fs").readFileSync(0)).value')"
echo "::add-mask::$OIDC"
RESP="$(curl -sS -X POST https://pypi.org/_/oidc/mint-token -H 'Content-Type: application/json' -d "{\"token\":\"$OIDC\"}")"
printf '%s' "$RESP" | node -e '
const r = JSON.parse(require("fs").readFileSync(0));
if (r.success && r.token) { console.log("PyPI trusted publishing: accepted (upload token minted and discarded)"); process.exit(0); }
console.error("Error: PyPI refused the trusted-publishing exchange:");
console.error(JSON.stringify({ message: r.message, errors: (r.errors || []).map((e) => e.code + ": " + e.description) }, null, 2));
process.exit(1);
'
echo "PyPI project page: $(curl -s -o /dev/null -w '%{http_code}' https://pypi.org/pypi/checkgate/json)"

# ===========================================================================
# PHASE 2 — PUBLISH. Every job below waits for *all* of phase 1.
# ===========================================================================

publish-node:
name: Publish — @checkgate/node
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker]
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker, publish-pypi]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -614,7 +594,7 @@ jobs:
publish-web:
name: Publish — @checkgate/web
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker]
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker, publish-pypi]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -661,7 +641,7 @@ jobs:
publish-cli:
name: Publish — @checkgate/cli
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker]
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker, publish-pypi]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -689,7 +669,7 @@ jobs:
publish-edge:
name: Publish — @checkgate/edge
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker]
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker, publish-pypi]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -717,7 +697,7 @@ jobs:
publish-ssr:
name: Publish — @checkgate/ssr
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker]
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker, publish-pypi]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -745,7 +725,7 @@ jobs:
publish-openfeature:
name: Publish — @checkgate/openfeature-provider
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker]
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker, publish-pypi]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -773,7 +753,7 @@ jobs:
publish-node-integrations:
name: Publish — @checkgate/node-integrations
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker]
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker, publish-pypi]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -801,7 +781,7 @@ jobs:
publish-mcp-server:
name: Publish — @checkgate/mcp-server
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker]
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker, publish-pypi]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -829,7 +809,7 @@ jobs:
publish-react-native:
name: Publish — @checkgate/react-native
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker]
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker, publish-pypi]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -861,7 +841,7 @@ jobs:
publish-flutter:
name: Publish — checkgate_flutter (pub.dev)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker]
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker, publish-pypi]
runs-on: ubuntu-latest
permissions:
id-token: write
Expand Down Expand Up @@ -902,7 +882,7 @@ jobs:
publish-docker:
name: Publish — Docker image
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker]
needs: [verify-js, build-native, build-web, verify-flutter, verify-python, build-docker, publish-pypi]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -954,6 +934,8 @@ jobs:
run: |
cosign sign --yes ${{ env.IMAGE_NAME }}@${{ steps.build-push.outputs.digest }}

# Runs before every other publish job (they all need it): it is the one
# credential the dispatch preflight cannot check (see preflight-credentials).
# PyPI trusted publishing (OIDC): no stored token. Needs, once, on PyPI: a
# publisher for project `checkgate`, owner checkgate-sh, repository
# checkgate, workflow release.yml, environment `pypi`. The action attaches
Expand Down
31 changes: 14 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,9 @@ request. One Server-Sent Events connection per SDK delivers changes as they happ
reconnects, a polling fallback and the last known flags if the server is unreachable. You run the
server, PostgreSQL and Redis on your own infrastructure.

> [!NOTE]
> **0.2.0 is in development and not yet released.** The latest release is
> [v0.1.31](https://github.com/checkgate-sh/checkgate/releases/latest). Items marked
> *0.2.0* below are in this source tree but not yet published to npm, PyPI or the container
> registry. Upgrading an existing server to 0.2.0 has
> [rules to read first](docs/operations/upgrading-to-0-2-0.md) (two migrations, no rolling upgrade; back up the database first).
> [!IMPORTANT]
> Upgrading a 0.1.31 server to 0.2.0? Read [Upgrading to 0.2.0](docs/operations/upgrading-to-0-2-0.md)
> first: two database migrations, no rolling upgrade, back up the database before you start.

## How it works

Expand Down Expand Up @@ -106,20 +103,20 @@ client.isEnabled('new-checkout', 'user-123', { plan: 'pro' }) // local: no netwo

| Runtime | Package | Status |
|---|---|---|
| Node.js | [`@checkgate/node`](docs/sdks/nodejs.md) (NAPI) | npm 0.1.31 |
| Browser | [`@checkgate/web`](docs/sdks/web.md) (WebAssembly) | npm 0.1.31 |
| React Native | [`@checkgate/react-native`](docs/sdks/react-native.md) (JSI) | npm 0.1.31 · Android build verified in CI; iOS not certified |
| Flutter | [`checkgate_flutter`](docs/sdks/flutter.md) (FFI) | pub.dev 0.1.31 · bundles no engine: you build and link it |
| Python | [`checkgate`](docs/sdks/python.md) (PyO3) | *0.2.0* · build from source; **not on PyPI yet** |
| OpenFeature | [`@checkgate/openfeature-provider`](docs/sdks/openfeature.md) (Node.js server) | *0.2.0* · not yet on npm |
| Express · Fastify · NestJS | [`@checkgate/node-integrations`](docs/sdks/node-frameworks.md) | *0.2.0* · not yet on npm |
| SSR / edge | [`@checkgate/ssr`](docs/ecosystem/ssr.md), [`@checkgate/edge`](docs/ecosystem/edge.md) | npm 0.1.31 |
| Typed flags | [`@checkgate/cli`](docs/ecosystem/cli.md) | npm 0.1.31 |
| AI agents | [`@checkgate/mcp-server`](docs/ecosystem/mcp.md) | *0.2.0* · not yet on npm · read-only by default; can propose, never apply or approve |
| Node.js | [`@checkgate/node`](docs/sdks/nodejs.md) (NAPI) | npm 0.2.0 |
| Browser | [`@checkgate/web`](docs/sdks/web.md) (WebAssembly) | npm 0.2.0 |
| React Native | [`@checkgate/react-native`](docs/sdks/react-native.md) (JSI) | npm 0.2.0 · Android build verified in CI; iOS not certified |
| Flutter | [`checkgate_flutter`](docs/sdks/flutter.md) (FFI) | pub.dev 0.2.0 · bundles no engine: you build and link it |
| Python | [`checkgate`](docs/sdks/python.md) (PyO3) | PyPI 0.2.0 · new in 0.2.0; CPython 3.11+ |
| OpenFeature | [`@checkgate/openfeature-provider`](docs/sdks/openfeature.md) (Node.js server) | npm 0.2.0 · new in 0.2.0 |
| Express · Fastify · NestJS | [`@checkgate/node-integrations`](docs/sdks/node-frameworks.md) | npm 0.2.0 · new in 0.2.0 |
| SSR / edge | [`@checkgate/ssr`](docs/ecosystem/ssr.md), [`@checkgate/edge`](docs/ecosystem/edge.md) | npm 0.2.0 |
| Typed flags | [`@checkgate/cli`](docs/ecosystem/cli.md) | npm 0.2.0 |
| AI agents | [`@checkgate/mcp-server`](docs/ecosystem/mcp.md) | npm 0.2.0 · new in 0.2.0 · read-only by default; can propose, never apply or approve |
| Infrastructure as code | [Terraform / OpenTofu provider](docs/ecosystem/terraform.md), [Kubernetes operator](docs/ecosystem/kubernetes.md) | build from source |

Every SDK runs the same evaluation engine and checks the same shared test vectors. Also new in
*0.2.0*: the [evaluation playground](docs/guide/playground.md) (what an SDK would answer for a user,
0.2.0: the [evaluation playground](docs/guide/playground.md) (what an SDK would answer for a user,
and why) and [SDK diagnostics](docs/operations/sdk-diagnostics.md). Which packages your stack needs:
[Which SDK do I need?](docs/sdks/index.md)

Expand Down
36 changes: 18 additions & 18 deletions docs/.vitepress/data/release.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Release status for the docs site, in one place.
//
// Pages never hard-code "unreleased" or "not on npm": they use <Since>,
// <ReleaseNotice> and <SdkMatrix>, which read this file. When 0.2.0 is
// published, set `latest` to '0.2.0', `next` to null, and update each
// package's `registry` to what the registries actually serve (check with
// `npm view`, PyPI and pub.dev; never assume a publish succeeded).
// <ReleaseNotice> and <SdkMatrix>, which read this file. For a release, set
// `latest` to its version, `next` to null (or the version in development),
// and each package's `registry` to what the registries serve (check with
// `npm view`, PyPI and pub.dev after publishing).

export const release = {
/** Newest version published to npm, pub.dev, ghcr.io and GitHub Releases. */
latest: '0.1.31',
latest: '0.2.0',
/** The version in development on `dev`, or null when nothing is pending. */
next: '0.2.0' as string | null,
next: null as string | null,
repo: 'https://github.com/checkgate-sh/checkgate',
}

Expand Down Expand Up @@ -50,34 +50,34 @@ export interface Package {

export const packages: Package[] = [
{ id: 'node', name: '@checkgate/node', platform: 'Node.js', binding: 'NAPI', doc: '/sdks/nodejs', since: '0.1.0',
registry: { kind: 'npm', version: '0.1.31' }, install: 'npm install @checkgate/node', group: 'sdk',
limits: 'Node.js runtime only (not edge runtimes). getDetails(), getHealth() and onStatusChange() arrive in 0.2.0.' },
registry: { kind: 'npm', version: '0.2.0' }, install: 'npm install @checkgate/node', group: 'sdk',
limits: 'Node.js runtime only (not edge runtimes). getDetails(), getHealth() and onStatusChange() since 0.2.0.' },
{ id: 'python', name: 'checkgate', platform: 'Python', binding: 'PyO3', doc: '/sdks/python', since: '0.2.0',
registry: { kind: 'source', note: 'Not on PyPI yet: build from the repository (needs Rust). Do not install a package named checkgate from PyPI until the project announces it.' },
registry: { kind: 'pypi', version: '0.2.0' }, install: 'pip install checkgate',
group: 'sdk', limits: 'CPython 3.11+. No impression reporting or track() yet.' },
{ id: 'web', name: '@checkgate/web', platform: 'Browser', binding: 'WebAssembly', doc: '/sdks/web', since: '0.1.0',
registry: { kind: 'npm', version: '0.1.31' }, install: 'npm install @checkgate/web', group: 'sdk' },
registry: { kind: 'npm', version: '0.2.0' }, install: 'npm install @checkgate/web', group: 'sdk' },
{ id: 'react-native', name: '@checkgate/react-native', platform: 'React Native', binding: 'JSI', doc: '/sdks/react-native', since: '0.1.0',
registry: { kind: 'npm', version: '0.1.31' }, install: 'npm install @checkgate/react-native', group: 'sdk',
registry: { kind: 'npm', version: '0.2.0' }, install: 'npm install @checkgate/react-native', group: 'sdk',
limits: 'Android native build verified in CI; iOS not certified. Builds the Rust engine in your app build.' },
{ id: 'flutter', name: 'checkgate_flutter', platform: 'Flutter', binding: 'Dart FFI', doc: '/sdks/flutter', since: '0.1.0',
registry: { kind: 'pub', version: '0.1.31' }, install: 'flutter pub add checkgate_flutter', group: 'sdk',
registry: { kind: 'pub', version: '0.2.0' }, install: 'flutter pub add checkgate_flutter', group: 'sdk',
limits: 'Bundles no compiled engine: you build and link the Rust engine yourself.' },
{ id: 'openfeature', name: '@checkgate/openfeature-provider', platform: 'OpenFeature (Node.js server)', binding: 'over @checkgate/node', doc: '/sdks/openfeature', since: '0.2.0',
registry: { kind: 'unpublished', note: 'Publishes to npm with 0.2.0; it needs @checkgate/node 0.2.' },
registry: { kind: 'npm', version: '0.2.0' },
install: 'npm install @checkgate/openfeature-provider @openfeature/server-sdk', group: 'framework' },
{ id: 'node-integrations', name: '@checkgate/node-integrations', platform: 'Express · Fastify · NestJS', binding: 'over @checkgate/node', doc: '/sdks/node-frameworks', since: '0.2.0',
registry: { kind: 'unpublished', note: 'Publishes to npm with 0.2.0.' },
registry: { kind: 'npm', version: '0.2.0' },
install: 'npm install @checkgate/node @checkgate/node-integrations', group: 'framework',
limits: 'Node.js 22.12+; Express 5, Fastify 5, NestJS 12.' },
{ id: 'ssr', name: '@checkgate/ssr', platform: 'SSR / bootstrap', binding: 'with @checkgate/web', doc: '/ecosystem/ssr', since: '0.1.0',
registry: { kind: 'npm', version: '0.1.31' }, install: 'npm install @checkgate/web @checkgate/ssr', group: 'framework' },
registry: { kind: 'npm', version: '0.2.0' }, install: 'npm install @checkgate/web @checkgate/ssr', group: 'framework' },
{ id: 'edge', name: '@checkgate/edge', platform: 'Edge runtimes', binding: 'with @checkgate/web', doc: '/ecosystem/edge', since: '0.1.0',
registry: { kind: 'npm', version: '0.1.31' }, install: 'npm install @checkgate/edge @checkgate/web', group: 'framework' },
registry: { kind: 'npm', version: '0.2.0' }, install: 'npm install @checkgate/edge @checkgate/web', group: 'framework' },
{ id: 'cli', name: '@checkgate/cli', platform: 'Typed flag accessors', binding: 'dev dependency', doc: '/ecosystem/cli', since: '0.1.0',
registry: { kind: 'npm', version: '0.1.31' }, install: 'npm install -D @checkgate/cli', group: 'tooling' },
registry: { kind: 'npm', version: '0.2.0' }, install: 'npm install -D @checkgate/cli', group: 'tooling' },
{ id: 'mcp', name: '@checkgate/mcp-server', platform: 'AI agents (MCP)', binding: 'stdio', doc: '/ecosystem/mcp', since: '0.2.0',
registry: { kind: 'unpublished', note: 'Publishes to npm with 0.2.0; needs a 0.2.0 server.' }, group: 'tooling',
registry: { kind: 'npm', version: '0.2.0' }, install: 'npx -y @checkgate/mcp-server@0.2.0', group: 'tooling',
limits: 'Read-only by default; can propose changes, never create, apply or approve.' },
{ id: 'terraform', name: 'terraform-provider-checkgate', platform: 'Terraform / OpenTofu', binding: 'Go', doc: '/ecosystem/terraform', since: '0.1.0',
registry: { kind: 'source', note: 'Not on the Terraform Registry: build from source.' }, group: 'tooling' },
Expand Down
12 changes: 6 additions & 6 deletions docs/ecosystem/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,18 @@ your email. Someone else must approve them.

## 2. Configure your MCP client

The package needs Node.js 22 or later (CI tests it on 22). Until it is published to npm, run it from a checkout of the
repository (`cd integrations/mcp-server && npm ci`) and point `command`/`args` at
`integrations/mcp-server/bin/checkgate-mcp.js`.
The client starts the server with `npx`, so there is nothing to install beforehand. It needs
Node.js 20 or later (CI tests it on 22). To run it from a checkout instead, use `node` with
`integrations/mcp-server/bin/checkgate-mcp.js` as `command`/`args` after `npm ci` in that directory.

**Claude Desktop** (`claude_desktop_config.json`):

```json
{
"mcpServers": {
"checkgate": {
"command": "node",
"args": ["/path/to/checkgate/integrations/mcp-server/bin/checkgate-mcp.js"],
"command": "npx",
"args": ["-y", "@checkgate/mcp-server@0.2.0"],
"env": {
"CHECKGATE_URL": "https://flags.example.com",
"CHECKGATE_TOKEN": "pat_your_propose_token",
Expand All @@ -107,7 +107,7 @@ claude mcp add --transport stdio checkgate \
--env CHECKGATE_URL=https://flags.example.com \
--env CHECKGATE_TOKEN=pat_your_propose_token \
--env CHECKGATE_MCP_WRITE=1 \
-- node /path/to/checkgate/integrations/mcp-server/bin/checkgate-mcp.js
-- npx -y @checkgate/mcp-server@0.2.0
```

Leave out `CHECKGATE_MCP_WRITE` for a read-only assistant.
Expand Down
Loading
Loading