Skip to content

fix(environments): service-secrets accepts a module-qualified service - #1268

Merged
antoinetoussaint-byte merged 1 commit into
mainfrom
fix/service-secrets-accepts-a-qualified-service
Nov 2, 2026
Merged

antoinetoussaint-byte merged 1 commit into
mainfrom
fix/service-secrets-accepts-a-qualified-service

Conversation

@antoinetoussaint-byte

Copy link
Copy Markdown
Contributor

service-secrets is the one service-scoped block that accepts only a bare service name. The validator admits the module-qualified form for service-identity, service-mesh, service-config and build-images (pkg/environments/workspace.go:289), and RemoteRef looks the mapping up by scope.Service alone (environment.go:1246) — even though SecretScope documents the module as the thing that keeps two modules stores apart.

A bare name cannot name a service whose name several modules declare. Eleven modules of platform-obin each ship a store, so those stores cannot be named in service-secrets at all:

environment "blue" service-secrets references unknown service "tracing/store"
environment "blue" service-secrets references unknown service "documents/vector"

That matters because without an explicit reference, every store POSTGRES_USER falls through to the dev plaintext its own module ships (.../services/store/configurations/local/postgres.secret.env), which every hosted cell reads as the last link of its configuration-profiles chain, and service-postgres refuses a value where it requires a typed Secret reference for all four primitives (builder.go:937-953):

builder deploy failed: postgres deployment requires a typed Kubernetes Secret reference
for CODEFLY__SERVICE_SECRET_CONFIGURATION__MODEL__STORE__POSTGRES__POSTGRES_USER

So today no hosted cell of that composition can be rendered at all. (The same render on 0.1.219 projected those keys as secretKeyRefs; the committed blue tree still shows them.)

Change

  • EnvironmentServiceSecrets.MappingFor(module, service): the qualified entry wins, the bare entry stays for a name only one module declares — which is how every environment written before this states its services.
  • RemoteRef and both configuration_projection.go readers use it, so validation, render and the projection check agree.
  • The validator admits the qualified form for service-secrets as it already does for the other four blocks.

Tests

pkg/environments/environment_remote_ref_qualified_test.go: two modules store resolve to different remote entries; a module with no entry still falls to the environment template with its own module substituted; a bare entry keeps working. go build ./..., go vet, go test ./pkg/environments/ ./pkg/gitops/ all pass (gitops 104s).

🤖 Generated with Claude Code

service-secrets was the one service-scoped block that took only a bare service
name: the validator admits the qualified form for service-identity,
service-mesh, service-config and build-images, and RemoteRef looked its mapping
up by scope.Service alone. A bare name cannot name a service whose name several
modules declare, and eleven modules of platform-obin each ship a "store", so
those stores could not be named at all:

  environment "blue" service-secrets references unknown service "tracing/store"

Without an explicit reference every store POSTGRES_USER falls through to the dev
plaintext its module ships in its own local profile, which every hosted cell
reads as the last link of its profile chain, and service-postgres refuses a
value where it requires a typed Secret reference — so no hosted cell of that
composition can be rendered.

MappingFor resolves the qualified entry first and the bare one after, and every
call site uses it: RemoteRef and both configuration-projection readers. The
SecretScope doc already said the module is what keeps two modules stores apart.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@antoinetoussaint-byte
antoinetoussaint-byte added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit ebbff3b Nov 2, 2026
19 checks passed
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