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
437 changes: 411 additions & 26 deletions .github/workflows/publish.yml

Large diffs are not rendered by default.

29 changes: 18 additions & 11 deletions docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,31 @@ After that pull request is merged, create a signed annotated tag at the exact
create the GitHub release with `--verify-tag`. Do not let GitHub create the tag
and never move or recreate a release tag.

The release workflow verifies that the tag:
Before checkout or dependency commands in the preparation job, the release
workflow fetches only `main` and the named tag into a temporary bare
repository and verifies that the tag:

- is a stable annotated `vX.Y.Z` tag signed by an allowed signer;
- matches a public package version;
- points to the checkout and the GitHub release-event commit; and
- is contained in `origin/main`.

Its preparation job has no OIDC permission. It installs the reviewed npm
The checkout then uses the immutable release-event commit rather than the tag
name. The preparation job has no OIDC permission. It installs the reviewed npm
`11.18.0` release and the pinned pnpm without dependency caching, runs the
full gate, builds and packs once with that npm CLI, smoke-tests the tarballs
from a clean consumer, records SHA-1 and SHA-512 integrity, and uploads
the exact prepared artifacts. The lockfile source of truth is `pnpm-lock.yaml`.

Only the `npm-publish` job receives `id-token: write`. It installs no
dependencies and does not download pnpm. It runs
`node scripts/release-packages.mjs publish`, verifies the prepared manifest
and tarball hashes against the release commit, and publishes those tarballs
with npm provenance.
full gate, builds and packs once with that npm CLI, revalidates each packed
manifest, records SHA-1, SHA-256, and SHA-512 integrity, seals the exact
release-directory inventory, and uploads the prepared artifacts. The lockfile
source of truth is `pnpm-lock.yaml`.

A separate unprivileged job checks out the immutable event commit, downloads
the sealed artifact, and installs every tarball into a clean consumer before
importing every public export. Only the `npm-publish` job receives
`id-token: write`. That job authenticates the tag again before any dependency
command, checks out no repository content, installs no project dependencies,
and does not download pnpm. Workflow-owned code verifies the prepared
manifest digest, exact file inventory, and tarball hashes, then publishes from
an isolated temporary directory with npm provenance.

## Safe retry

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"format:check": "prettier --check .",
"release:check": "node scripts/release-packages.mjs check",
"release:pack": "node scripts/release-packages.mjs pack",
"release:smoke": "node scripts/release-packages.mjs smoke",
"release:publish": "node scripts/release-packages.mjs publish",
"test": "pnpm run build && vitest run"
},
Expand Down
1 change: 1 addition & 0 deletions packages/flags-contracts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export interface FlagResolutionRequest {
readonly defaultValue: unknown;
readonly kind: FlagValueKind;
readonly context: EvaluationContext;
readonly signal?: AbortSignal;
}

export interface FlagProviderCapabilities {
Expand Down
9 changes: 9 additions & 0 deletions packages/flags-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,12 @@ The client never blocks a request on an unbounded provider call. A timeout
or error returns the default (or a stale cache entry) with an explicit
reason and a log line. This package does not author flags and does not
evaluate targeting rules.

Provider calls receive an optional `AbortSignal`. When an evaluation context
has a bounded canonical identity, concurrent misses share one provider call
and completed values can enter the cache. Oversized or non-canonical contexts
skip both mechanisms. The evaluation cache is an LRU capped at 1,024 entries
by default. Set `maxCacheEntries` to a smaller non-negative integer when a
host needs a tighter bound; zero disables stored entries. Cache identity
covers the complete evaluation context, while client fallback logs include
the flag key and coarse reason without the raw `targetingKey`.
Loading
Loading