Skip to content

registry:job and registry:register for the flb CLI - #46

Merged
roncodes merged 10 commits into
release/v0.2.0from
feature/cli-job-register-commands-827e43
Oct 24, 2026
Merged

roncodes merged 10 commits into
release/v0.2.0from
feature/cli-job-register-commands-827e43

Conversation

@roncodes

Copy link
Copy Markdown
Member

Adds two artisan commands that CLI v2 (fleetbase/fleetbase-cli#13) calls from a server shell.

registry:job {id} {--json}

  • Prints an installer job record from InstallerJobStore::find(), including position.
  • With --json, the output matches what InstallerCommand prints for a job.
  • An unknown id prints {"error": "Installer job <id> was not found."} and exits 1.
  • flb install|update|uninstall poll it to follow queued jobs.

registry:register {--code=} {--code-stdin} {--service-url=} {--name=} {--host=} {--console-version=} {--json}

  • Exchanges a registration code for an instance token without using the console admin page.
  • --code-stdin reads the code from stdin, which keeps it out of the process list; flb instance register --path|--docker uses this.
  • The token is stored encrypted under registry-bridge.registry.instance_token and is never printed. --json prints the stored summary from InstanceRegistration::instanceSummary(), which carries only token_hint.
  • On failure it prints {"error": "..."} and exits 1.
  • The registration logic moves into InstanceRegistration::register(), shared with RegistryExtensionController::registerInstance. The controller keeps its 422/502/503 mapping.

Testing

  • 3 registry:job cases in InstallerCommandsTest.
  • 7 cases in the new RegisterInstanceCommandTest: no token in the output, token stored encrypted, code from stdin, refused code, missing service URL, default service URL, bad option combinations, unreachable service.
  • php-cs-fixer (dry run) is clean.
  • Pest locally: 143 of 149 pass. The 6 SandboxConnectionTest failures happen before this change too: the local vendor is missing GeneaLabs\LaravelModelCaching\EloquentBuilder.

registry:job {id} prints an installer job record (with its queue position)
so flb can follow the jobs registry:install/update/uninstall queue.

registry:register exchanges a registration code (from --code or stdin) for an
instance token from a server shell. The registration logic moves into
InstanceRegistration::register(), shared with the admin endpoint; the token is
stored encrypted and only its hint is printed.
…o feature/cli-job-register-commands-827e43

# Conflicts:
#	server/src/Http/Controllers/Internal/v1/RegistryExtensionController.php
…e rotates it

InstanceRegistration::register() (the admin endpoint and registry:register)
now passes previous_token, only to the service that issued the token, so
re-registering keeps one instance with its installs and seats (D17).
A re-registration (flb instance register on an instance that is already
registered) now prints 'Re-registered … with …' and that the instance kept
its installs and licence seats while the previous token stopped working (D17).
--json carries 'rotated' in the summary.
@roncodes
roncodes changed the base branch from feat/service-release-source to release/v0.2.0 October 24, 2026 09:46
@roncodes
roncodes merged commit 76ee2ed into release/v0.2.0 Oct 24, 2026
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