CloudRunPreflight class

Shared Cloud Run / Artifact Registry preflights.

Both ServerSetup.deployToCloudRun (arcane_server) and JasprServerDeployer.deploy (Jaspr SSR/hybrid) need the same three preflight gates before any docker push or gcloud run deploy is attempted:

  1. Active gcloud account sanity — catch the "wrong service account active" foot-gun up front instead of letting it cascade into ten lines of PERMISSION_DENIED deep inside the push.
  2. Required GCP APIs enabledartifactregistry.googleapis.com and run.googleapis.com. Both are off by default on fresh projects.
  3. Artifact Registry repository exists — without this docker push fails with NOT_FOUND because the registry path doesn't resolve to a repo.

All three were originally private to ServerSetup; this class is the single source of truth so the Jaspr deployer can reuse them without re-implementing or duplicating.

Constructors

CloudRunPreflight({ProcessRunner? runner})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

ensureArtifactRegistryRepository({required String projectId, required String repository, required String region}) Future<bool>
Ensure the Artifact Registry repository <repository>@<region> exists for projectId. Idempotent: a "already exists" / 409 response is treated as success.
ensureCloudRunPrerequisiteApis({required String projectId}) Future<bool>
Enable the GCP services Cloud Run deployment depends on. Returns true when all required APIs are enabled (or were already enabled), false when at least one gcloud services enable call returns non-zero.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
runAll({required String projectId, required String repository, required String region}) Future<bool>
Run all three preflights in order. Returns true only when the project is ready for docker push + gcloud run deploy.
toString() String
A string representation of this object.
inherited
verifyActiveGcloudAccount({required String projectId}) Future<bool>
Preflight: verify the active gcloud account is plausibly authorized for projectId. Returns true when:

Operators

operator ==(Object other) bool
The equality operator.
inherited