Skip to content

Release v2.0.0: CLI v2 for the Extensions Registry - #17

Draft
roncodes wants to merge 15 commits into
mainfrom
release/v2.0.0
Draft

roncodes wants to merge 15 commits into
mainfrom
release/v2.0.0

Conversation

@roncodes

@roncodes roncodes commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Roll-up for the Fleetbase Extensions Registry re-architecture, CLI side. Every CLI PR for this project merges into release/v2.0.0. This PR merges into main only when the whole project is complete (registry, registry-bridge, fleetbase-cli, registry-infra); deployments and the npm publish happen after that. Do not merge piecemeal.

What's in it

Release notes and breaking changes are in RELEASE.md (currently v2.0.0-beta.0).

Open into this branch

Related

Before merging

  • Bump package.json and RELEASE.md from 2.0.0-beta.0 to 2.0.0.
  • Run npm run test:e2e against the released Registry Service.

Rewrites flb in TypeScript (commander) for the Registry Service /v1 API,
still published as @fleetbase/cli with the flb binary.

- Config in ~/.fleetbase/config.json (mode 600, atomic writes), reading the
  phase-0 keys (host, registry, tokens by host, defaultOrganization) and
  adding per-host token metadata and instance tokens. FLB_TOKEN for CI.
- login (password or --token), logout, whoami, register, verify,
  token create|list|revoke. No token is printed without --show-token and
  output is redacted centrally.
- init from fleetbase/starter-extension with package names, PHP namespace,
  route and an extension.json with compat ranges; bump keeps
  extension.json, package.json and composer.json on one version.
- build: npm pack engine, Composer api archive, optional prebuilt dist via
  ember-core build-engine-release; .fleetbase/release.json.
- publish creates the listing if needed, uploads, streams checks by
  polling the release; release list|status|submit|withdraw|yank.
- search, info, instance code|register|status|updates|list|forget.
- install|update|uninstall run php artisan registry:* locally or in a
  docker compose service and follow the job with registry:job.
- doctor.
- install-fleetbase moves to packages/installer (@fleetbase/installer);
  flb install-fleetbase prints the npx command.
- Vitest unit tests and test/e2e/run.sh against the service, run in CI
  against fleetbase/registry@v2.
- flb listing list|show|update|categories: PATCH the catalog listing from
  flags or --file, and show what a first release still needs.
- flb instance register --path|--docker mints a code and pipes it to
  php artisan registry:register --code-stdin on the instance, so the
  instance token stays in its encrypted settings. Without a target, or
  with --store-token, the CLI exchanges the code as before.
- The artisan runner can write stdin; doctor reports registry:register.
- The e2e uses flb listing instead of curl, and its stub artisan really
  exchanges the piped code with the service.
- Replace the SemVer regex (exponential backtracking on long numeric
  prerelease identifiers) with isSemver(), a strict check on semver.parse's
  canonical form; versions over 256 characters are rejected as npm does.
- Escape backslashes as well as single quotes when the scaffold writes the
  extension name and description into JS and PHP string literals.
…egex

CodeQL js/redos pointed at COMPOSER_NAME, not the SemVer regex. Rewrite
Composer's vendor/package rule so each separator is required between
alphanumeric runs. Same language (checked exhaustively against the old
pattern for every string up to 8 characters over [a0_.-/]), linear time.
D17 from the registry end-to-end walk. `flb instance register` on an
instance that is already registered created a second instance on the
service.

- --path/--docker: registry:register sends the instance's current token
  (registry-bridge #44/#46), and the CLI now prints 'Re-registered …' with a
  note that installs and licence seats are kept when the summary says
  rotated.
- --store-token: the config entry for the same --path or --host sends its
  token as previous_token; entries now remember --host. The service also
  matches the same host in the same organization (registry 68331fe).

README documents it.
`flb publish` can publish without a stored secret: in a job with
`id-token: write` it requests the GitHub OIDC token (audience: the
registry's host name, FLB_OIDC_AUDIENCE overrides), exchanges it with
POST /v1/auth/oidc/github for a short-lived flbt_ token scoped to the
extension (named by its npm package, else composer), and uses that token
for the listing lookup, upload and checks.

- Token order for publish: FLB_TOKEN, then the exchange when
  ACTIONS_ID_TOKEN_REQUEST_URL/TOKEN are set (or --oidc), then the stored
  login; --no-oidc skips it. Other commands are unchanged.
- The exchange runs after the build and again when the token is within two
  minutes of expiry (RegistryClient gains a tokenProvider), so long check
  runs outlive the ~15 minute token.
- Actionable errors: missing OIDC variables or a refused GitHub request
  point at `permissions: id-token: write`; 401 names the audience; 403
  names the repository, workflow file and ref to configure in Studio →
  Access. A GitHub Actions job with no token at all gets the same hint.
- Trusted publishing never creates a listing or adds a package to one.
- flbt_ tokens are service tokens (not legacy) and are redacted in output,
  as are JWTs. Neither token is printed or written to disk.

action/: a composite action (fleetbase/fleetbase-cli/action@v2) that sets
up Node, installs @fleetbase/cli (or builds it from the action's checkout
with cli-version: source), runs `flb publish --json` and exposes
release-id, version, status, channel and extension, with a job summary.
action/examples/publish-on-tag.yml publishes on tag push. README documents
the setup.
Trusted publishing: GitHub Actions OIDC exchange and composite action
CLI v2: TypeScript rewrite against the Registry Service API
The scaffold defaulted to console >=0.7.0 <0.8.0 and core-api ^1.6, so a fresh
extension was incompatible with every Laravel 12 instance (console 0.8.x, core-api
2.x) that registry v2 serves.
fix(init): default compat to console 0.8+ and core-api 2.x
Ports #11 (written against the 0.0.x install-fleetbase)
into @fleetbase/installer: SOCKETCLUSTER_AUTH_KEY (64 hex characters, kept on
re-runs when 32+), SOCKETCLUSTER_AUTH_ENABLED=false, SOCKETCLUSTER_AUTH_MODE=log
and SOCKETCLUSTER_ORIGIN (the console origin) go to the root .env that Compose
reads, existing values and other lines are kept, and the file is mode 600. The
helper throws instead of exiting so it is unit-tested.
docs(init): describe the new compat defaults
feat(installer): provision the socket auth key in the project .env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant