Skip to content

fix(installer): prebuilt dist from dist.url, logged rebuild fallback, keep host-modules.json (D9) - #51

Open
roncodes wants to merge 1 commit into
release/v0.2.0from
fix/installer-dist-url
Open

roncodes wants to merge 1 commit into
release/v0.2.0from
fix/installer-dist-url

Conversation

@roncodes

Copy link
Copy Markdown
Member

The installer now downloads a release's prebuilt dist from dist.url and records why whenever it rebuilds the console instead. This is the last part of D9 from the end-to-end walk; it goes with fleetbase/registry#13, which adds dist.url and the instance download.

  • Download URL. ServiceReleaseSource takes the dist from the dist.url the Registry Service names (/v1/instances/me/releases/<id>/dist; a path is resolved against the configured service). Services that send no url keep using <service>/npm/<engine>/-/dist/<version>. The instance token is still sent only to URLs on the configured service.
  • Rebuild fallback, with the reason recorded. A Registry Service release with no dist, or whose dist can't be downloaded (unreachable, 404, refused), installs the engine package and rebuilds the console. The reason goes into the job log, result.prebuilt_skipped and the application log. Before this change a missing dist rebuilt silently, and a failed dist download failed the whole install.
  • Checksum mismatches still fail the job. They throw the new ChecksumMismatchException and are never worked around.
  • host-modules.json survives rebuilds. Console rebuilds run with FLEETBASE_HOST_MODULES=1. The console only writes dist/host-modules.json in production builds, and the installer builds with --environment <APP_ENV>. So the first rebuild on a development instance dropped the file, and the console refused every prebuilt engine after that. The e2e walk console was in exactly this state after its last rebuild.

Tests: RegistryServiceInstallTest covers the dist.url handling, the download-failure fallback, the logged reason for a missing dist, and FLEETBASE_HOST_MODULES on the build. Bridge CI still doesn't run composer test:unit (it's commented out in server.yml), so these tests haven't run in CI. The installer path was exercised live in the e2e setup instead (see the report).

…ld with the reason logged

ServiceReleaseSource downloads a release's prebuilt dist from the dist.url the
Registry Service names (/v1/instances/me/releases/<id>/dist), falling back to
the npm dist route for services without one.

A Registry Service release whose dist is missing or cannot be downloaded now
installs the engine package and rebuilds, with the reason in the job log,
result.prebuilt_skipped and the application log. A checksum mismatch still
fails the job (ChecksumMismatchException).

Console rebuilds run with FLEETBASE_HOST_MODULES=1, so a non-production build
keeps dist/host-modules.json and later installs can still take prebuilt dists.
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