Skip to content

Follow-up: render backend runtime config from canonical manifest after validator proves drift #8517

Open

Description

@Git-on-my-level

Context

Issue #8515 tracks the immediate need for a repo-owned backend runtime config contract so Cloud Run and GKE stop drifting. The first implementation step should be validator-first: add a canonical manifest and fail CI/deploy checks when checked-in deploy config or live revision config diverges.

This follow-up tracks the later migration from validation to rendering/generation. It should not start until the validator path has proved the manifest shape and caught real drift without destabilizing deploys.

Follow-up Scope

Move backend runtime config from hand-maintained deploy targets to manifest-derived output:

  • Generate Helm-compatible env blocks for GKE services such as backend-listen and llm-gateway.
  • Generate Cloud Run env_vars blocks for backend, backend-sync, and backend-integration.
  • Generate or apply Cloud Run secret bindings from checked-in secret binding names, while keeping secret values in Secret Manager.
  • Model service discovery per caller platform, for example Kubernetes DNS for GKE callers and stable private Cloud Run-to-GKE endpoints for Cloud Run callers.
  • Remove duplicated hand-maintained env definitions only after generated output has been validated in dev and prod.

Conditions Before This Can Be Worked On

Do not start this follow-up until all of these are true:

  • The validator-first PR from Create canonical backend runtime config to prevent Cloud Run/GKE env drift #8515 is merged.
  • CI fails when a backend runtime env var is changed in Helm/workflows without a corresponding canonical manifest entry.
  • Deploy-time validation checks the new Cloud Run revision before traffic shift for required non-secret env vars and secret bindings.
  • The validator has run successfully in development for at least one backend deploy and one backend-listen deploy.
  • The validator has run successfully in production for at least one backend deploy or dry-run-equivalent validation.
  • Current live Cloud Run env drift has been reconciled or explicitly captured in the manifest as service-specific overrides.
  • Cloud Run-to-GKE service discovery has a stable target design, preferably DNS or named internal load balancer endpoints instead of undocumented raw IPs.
  • Secret rotation behavior is documented as additive and non-disruptive for both GKE and Cloud Run.
  • There is agreement on whether generated artifacts are checked in, regenerated in CI, or rendered only during deploy.

Acceptance Criteria

  • A single manifest is the source of truth for backend runtime env, secret bindings, service discovery, and service-specific overrides.
  • Generated or rendered output covers both Cloud Run and GKE deploy planes.
  • CI verifies generated output is current, or deploy jobs render from the manifest directly.
  • Manual duplicated env definitions are deleted or reduced to manifest references.
  • Dev and prod deploys fail before traffic shift when rendered config and target revision config diverge.
  • Documentation explains how to add, rotate, override, and validate backend runtime config.

Non-goals

  • Do not store secret values in the repo.
  • Do not silently preserve legacy env shapes; old shapes should be migrated, rejected, or explicitly documented as temporary overrides.
  • Do not replace live deploy behavior in one step before the validator has proven the manifest contract.

Activity

  1. added
    p3
    backend
    on Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendp3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions