Repository navigation
fix(gcp): inject the endpoint the read path honours, not nothing - #1434
Merged
Merged
Conversation
Closes #1431. Unblocks #1211 (E·gcp) and INTENTIUS/behold#126. `FLOCI_GCP_EMULATOR.env` returned `{}`, so `chant emulator up --lexicon gcp` booted floci-gcp, reported its endpoint, and left `GCP_ENDPOINT_URL` unset. `describeResources` and `observeResourcesDeep` take their endpoint from that variable and nothing else, so every `--live` read went to REAL GCP while an emulator sat running on :4588. The comment explaining the empty `env` was true when written and stopped being true two hours later: 2026-08-02 19:41 9200d0d #1345 declares the capability, env empty — correct, GCP was observed through Config Connector over kubectl, no ambient var existed 2026-08-02 21:34 7f4e985 #1209 moves observation onto the applier's own direct-REST transport, reading GCP_ENDPOINT_URL Nothing re-read the comment. Outside tests setting it by hand, nothing in the repo wrote that variable at all — only the two readers consumed it. The rationale was also half right, which is why it survived: the APPLY path genuinely takes an explicit `endpoint` argument and needs no injection. The READ path is the one that cannot be told where to look. The comment now says which half is which. Verified against the real plugins, before and after: before gcp: endpointEnvVarsFor -> [] GCP_ENDPOINT_URL after applyLiveEndpoint = undefined after gcp: endpointEnvVarsFor -> ["GCP_ENDPOINT_URL"] GCP_ENDPOINT_URL after applyLiveEndpoint = http://localhost:4588 notice: environment "local" declares endpoint http://localhost:4588 — applied to GCP_ENDPOINT_URL for this read which is now identical in shape to azure's. `endpointEnvVars` derives its list by probing `env`, so an empty `env` also meant core believed gcp had no endpoint variable — that is fixed by the same line and is covered by its own test. Gate: tsc clean, 550 tests across 63 files in lexicons/gcp + core live-endpoint and op suites.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1431. Unblocks #1211 (E·gcp) and INTENTIUS/behold#126.
The bug
FLOCI_GCP_EMULATOR.envreturned{}, sochant emulator up --lexicon gcpbooted floci-gcp, reported its endpoint, and leftGCP_ENDPOINT_URLunset.describeResourcesandobserveResourcesDeeptake their endpoint from that variable and nothing else. So every--liveread went to real GCP while an emulator sat running on :4588.Why the comment was wrong
It was right when written, and stopped being right two hours later:
9200d0d9envempty — correct at the time; GCP was observed through Config Connector over kubectl, so no ambient variable existed7f4e985eGCP_ENDPOINT_URLNothing re-read the comment. Outside tests setting it by hand, nothing in the repo wrote that variable at all — only the two readers consumed it.
The rationale was also half right, which is likely why it survived review: the apply path genuinely takes an explicit
endpointargument and needs no injection. The read path is the one that cannot be told where to look. The comment now says which half is which, so the next person to read it can tell whether it still holds.Verified against the real plugins
Not just the unit test —
endpointEnvVarsForandapplyLiveEndpointdriven with the actualgcpPlugin, before and after:Identical in shape to azure's, which is the point.
endpointEnvVarsderives its list by probingenv, so an emptyenvalso meant core believed gcp had no endpoint variable at all. Same line fixes it; covered by its own test.Gate
tscclean. 550 tests across 63 files (lexicons/gcp, corelive-endpointandopsuites), 3 new.Note for anyone running these locally on a fresh clone:
just _ensure-genfirst, or the gcp suites fail on missingsrc/generated/barrels — unrelated to this change.