Skip to content

runtime: read the fixture and process overrides from InitRequest, not only Start #71

Closed

Description

@antoinetoussaint-byte

Agent-side half of codefly-dev/core#526.

pkg/runtime/runtime.go consumes both values only inside Start:

s.EnvironmentVariables.SetFixture(req.Fixture)
s.EnvironmentVariables.AddOverrides(req.GetOverrides())

A service under test is not always started: a TEST_DEPENDENCY_MODE_START_DEPENDENCIES policy replaces its RuntimeStart with a no-op sequencing barrier and NONE skips Start entirely. Under the two modes a dependency-backed suite actually uses, the service observes no CODEFLY__FIXTURE, no CODEFLY__API_CONSUMES and no federation registration secrets — the suite runs green against a composition that was never wired. The CLI populates both fields on every InitRequest (codefly-dev/cli#689).

Change

In Runtime.Init, alongside the runtime context it already records:

s.Runtime.SetFixtureFromInit(req.GetFixture())
s.Runtime.SetOverridesFromInit(req.GetOverrides())

and switch the existing Start calls to the non-authoritative twins SetFixtureFromStart / SetOverridesFromStart, so a barrier Start carrying nothing cannot clear what Init recorded, and a Start repeating a key cannot leave the process holding two entries for it (AddOverrides appends unconditionally). Precedence is first-non-empty, Init before Start; both pairs are nil-safe and ignore an empty selection.

The contract is documented in core docs/agent-development.md, under Runtime → Fixture and process overrides.

Gate

Needs a core pin carrying core#520 and core#525. No tag has them yet: v0.3.31 predates both. codefly-dev/core#527 bumps version/info.codefly.yaml to 0.3.32, which cuts that tag on merge — pin v0.3.32 (or newer) first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions