Skip to content

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

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

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

Conversation

@roncodes

@roncodes roncodes commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Version 2.0.0 (95e7132): package.json, package-lock.json and the first line of RELEASE.md are at 2.0.0. Merging tags v2.0.0, and ci.yml then publishes @fleetbase/[email protected] as latest (only prereleases go to next) along with @fleetbase/installer.

Merge this at the cutover, not before. Today's latest (0.0.6) is what consoles on the v1 registry use. Publishing 2.0.0 as latest early points them at a CLI that only talks to the Registry Service. If it has to ship earlier, publish by hand with npm publish --tag next instead of merging. The registry's docs/cutover.md ("Releases ready") has the same note.


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
roncodes and others added 5 commits November 23, 2026 19:15
- extension.json accepts a `listing` block (subtitle, description and promotional_text as text or a Markdown file, category, tags, languages, icon, hosting, copyright, links); flb build validates it and that the files it names exist, with the registry schema's limits.
- flb publish applies it before the upload (PUT /v1/publisher/extensions/{slug}/listing-manifest), trusted publishing included, and logs the managed fields; top-level keywords and repository fill tags and links.repo. Without a block, fields an earlier publish managed are handed back to Studio. A refused block stops the publish.
- flb listing pull writes the current listing into the block (other keys and four-space layout kept; existing file references kept); flb listing show marks manifest-managed fields; flb listing update explains a refused manifest-managed field.
- flb init starts the block with the subtitle. README and RELEASE.md document it.

Co-Authored-By: Claude <[email protected]>
…needs

- extension.json's `compat` accepts `extensions`: package name → version range of the other extensions this one needs (`{ "@fleetbase/fleetops-engine": ">=0.6" }`). flb build checks the names, that each range parses and at most 20 entries, as the registry schema does.
- The release upload already sends the whole extension.json, so the registry gets it as is.
- flb init's README and README describe it.

Co-Authored-By: Claude <[email protected]>
- extension.json's `listing` block accepts `highlights` ("What you'll get") and `setup_steps` ("After you install"): plain text, at most 5 items of 1 to 120 characters, checked by flb build.
- flb publish sends them with the rest of the block (PUT …/listing-manifest); flb listing pull writes them when the listing has some; flb listing show lists the highlights and numbers the steps, marking the ones extension.json manages.
- README documents them.

Co-Authored-By: Claude <[email protected]>
The job checked out the registry's old `v2` branch (22 Oct, 91 commits
behind), which has no listing-manifest endpoint, so `flb publish` stopped on
"Resource not found" since the extension.json listing work. The test also
expects what flb init now does: extension.json's listing block sets the
subtitle and the tags, flb listing show marks them, and flb listing update
refuses to change them. Passes locally against a fresh release/v2.0.0.
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