Skip to content

fix(platform-outputs): actually derive the version the variables promise - #224

Merged
danielgines merged 1 commit into
mainfrom
fix/platform-outputs-derives-version
Aug 23, 2026
Merged

fix(platform-outputs): actually derive the version the variables promise#224
danielgines merged 1 commit into
mainfrom
fix/platform-outputs-derives-version

Conversation

@danielgines

Copy link
Copy Markdown
Member

As descrições de platform_version e platform_revision dizem para deixar vazio que o módulo deriva do arquivo VERSION no ref clonado. Ele não derivava.

A derivação vive em providers/aws e providers/azure, que leem o arquivo e passam o resultado. Quem consome modules/platform-outputs diretamente recebia string vazia — e uma descrição dizendo que esse era o caminho recomendado.

Por que vazio não é inofensivo

platform-root usa platformVersion como targetRevision da própria source $values. Vazio resolve para nada, e toda Application filha falha num value file que não consegue ler.

Foi encontrado assim: consumindo o módulo direto num deployment DigitalOcean, o ConfigMap de handoff saiu com platformVersion vazio.

A correção

O módulo está dois diretórios abaixo da raiz do repo — mesma profundidade de providers/<name> — então o caminho relativo é o mesmo que aqueles providers já usam.

Guardado com fileexists em vez de file() puro: quem vendorizar só este diretório não tem VERSION acima, e isso deve degradar para o comportamento anterior em vez de quebrar o plan.

Compatibilidade

Entrada explícita continua vencendo. providers/aws/main.tf:115 passa local.module_version, então segue idêntico. Ninguém que já passa o valor muda de comportamento.

Divulgação: fui eu que introduzi isso ao extrair o módulo na v0.73.0 — trouxe a descrição do nível do provider e deixei a lógica para trás.

Both variable descriptions say to leave the value empty and the module will
derive it from the VERSION file at the cloned source ref. It did not. The
derivation lives in providers/aws and providers/azure, which read the file and
pass the result in — so a caller consuming modules/platform-outputs directly
got an empty string and a description telling them that was the recommended
path.

Empty is not harmless here. platform-root uses platformVersion as the
targetRevision of its $values source, so it resolves to nothing and every child
Application fails on a value file it cannot read.

The module sits two directories below the repository root, the same depth as
providers/<name>, so the relative path is the one those providers already use.
Guarded with fileexists rather than a bare file(): vendoring this directory
alone should degrade to the old behaviour, not fail the plan.

Explicit input still wins, so every existing caller is unchanged.
@danielgines
danielgines merged commit 0b0471b into main Aug 23, 2026
2 checks passed
@danielgines
danielgines deleted the fix/platform-outputs-derives-version branch August 23, 2026 04:46
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