fix(nullplatform): fail template fetches that do not return 200 - #482
Merged
Conversation
A non-2xx response is not an error for the http provider, so a renamed or missing template flowed on as if the response body were the template: gomplate passed it through and jq died with `parse error: Expected string key before ':'`, four layers away from the file that caused it. Since the branch defaults track a moving ref, an upstream rename can break an already-applied state with no change in the caller's configuration. Assert `status_code == 200` on every template fetch in scope_definition, service_definition, scope_definition_agent_association and parameter_storage_definition, so the failure names the URL instead.
…ables The tflint-unused-declarations job lints every changed module, so this PR surfaced debt it did not introduce: np_api_key in parameter_storage_definition and github_repo_url/github_ref in scope_definition_agent_association are declared and unused on main too. None of the three can be deleted, which is what tflint marks as [Fixable]: - np_api_key is published and passed by consumers for interface consistency across the parameter-storage modules. The provider is configured at the root, which is why nothing inside the module references it. - github_repo_url and github_ref are published inputs with defaults, superseded by repository_notification_channel/_branch, which is what the template fetch actually uses. Dropping either breaks any consumer that sets it. Annotate all three with the rationale inline. Removing them belongs in a major version bump with coordinated consumer updates, not here.
Same content in half the lines: the why stays, the retelling of the failure chain goes. No functional change — comments only.
timossileandro
self-requested a review
August 7, 2026 18:36
sebasnallar
approved these changes
Aug 7, 2026
…atus-check # Conflicts: # nullplatform/scope_definition_agent_association/variables.tf
This was referenced Aug 7, 2026
sebastiancorrea81
added a commit
that referenced
this pull request
Aug 7, 2026
🤖 I have created a release *beep* *boop* --- ## [6.11.0](v6.10.0...v6.11.0) (2026-08-07) ### Features * **agent:** worker orchestration passthrough + chart 2.37.0 ([#478](#478)) ([6758a95](6758a95)) * **service_definition:** allow pinning specs to a tag or commit SHA ([#470](#470)) ([15b6d47](15b6d47)) ### Bug Fixes * **azure/vnet:** let a subnet declare its route table ([#475](#475)) ([d2a5faf](d2a5faf)) * **docs:** update usage example to a current release tag ([a167934](a167934)) * **docs:** update usage example to a current release tag ([#484](#484)) ([ed6f5b0](ed6f5b0)) * **nullplatform:** fail template fetches that do not return 200 ([#482](#482)) ([c47b78b](c47b78b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
What
Every template fetch in
scope_definition,service_definition,scope_definition_agent_associationandparameter_storage_definitionnowasserts
status_code == 200through apostcondition.Why
A non-2xx response is not an error for the
httpprovider, so a renamed ormissing template flowed on as if the response body were the template:
gomplate passed it through and jq died with
four layers away from the file that caused it — that
:is the one in404: Not Found. Thetry(..., "{}")wrapped aroundresponse_bodydoes nothelp, because there was no error to catch.
Not hypothetical:
nullplatform/scopesrenamedkill-instances.json.tpltokill-instance.json.tpl, and since the branch defaults track a moving ref(
refs/heads/main), that broke the plan of an already-applied state with nochange in the caller's configuration.
After
Verification
the message names the URL.
Plan: 5 to add, 0 to change, 0 to destroy, nopostcondition triggered.
pre-commit run --fileson the four changed files:tofu-fmt,tofu-validate,tofu test,trailing-whitespace,detect-private-keyallpass;
commitlintpasses on the commit.pre-commit run --all-filesexits 1 onmainbefore this branch:infrastructure/aws/vpc/main.tfandnullplatform/asset/ecr/main.tfareunformatted, and
infrastructure/gcp/gkecannot resolvehashicorp/googleunder
-lockfile=readonly. Confirmed on a pristineorigin/mainworktree, soit is not caused by this change. The four modules touched here validate clean
in that same run (73 validated, 72 valid, the one failure being
gcp/gke).Not included
No test pins this behaviour: none of the four modules has a
tests/suite, andadding one needs
mock_provider "http"returning a chosenstatus_codeplus amocked body that the downstream
data.external(gomplate/jq) can survive. Wortha follow-up rather than stretching this change.