Skip to content

feat(manifest): expand env vars in foundational-store input#840

Open
maoueh wants to merge 1 commit into
developfrom
feature/allow-env-vars-expansion-in-manifest
Open

feat(manifest): expand env vars in foundational-store input#840
maoueh wants to merge 1 commit into
developfrom
feature/allow-env-vars-expansion-in-manifest

Conversation

@maoueh

@maoueh maoueh commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds environment variable expansion ($VAR / ${VAR}) for the foundational-store module input in substreams.yaml. This lets a manifest be authored/pushed with a placeholder that is resolved at pack/load time:

modules:
  - name: my_module
    inputs:
      - foundational-store: $DEPLOYMENT_ID

This is a convenience at read time only — the generated .spkg always embeds the resolved, hard-coded value, never the $VAR reference.

Behavior

  • Variable present (even empty) → its value is used.
  • Variable absent → hard error listing the missing name(s), instead of silently substituting an empty string.

The same stricter (error-on-undefined) behavior is now also applied to the pre-existing expansion of imports and protobuf.importPaths, which previously used os.ExpandEnv (silent empty substitution).

Changes

  • New strict expandEnvVars helper (os.Expand + os.LookupEnv, errors on undefined).
  • Wired into expandManifestVariables (main Convert pipeline) for imports, protobuf import paths, and the new foundational-store inputs.
  • Mirrored in the standalone LoadManifestFile helper for consistency.
  • Docs: new "Environment variables" section in the manifest reference, with a caveat about the packaged .spkg embedding the resolved value.
  • CHANGELOG updated (Added + Changed).

Tests

  • Strict expander: present / present-empty / absent (single + multiple missing) / no-$.
  • foundational-store expansion: happy path + undefined-var error path.

⚠️ Behavior change: undefined env vars in imports / protobuf.importPaths now fail loud instead of expanding to an empty string.

Add strict environment variable expansion ($VAR / ${VAR}) for the
foundational-store module input, resolved at pack/load time so a
manifest can carry a placeholder (e.g. $DEPLOYMENT_ID) filled in later.
The generated .spkg always embeds the resolved value.

Undefined variables now error out instead of silently expanding to an
empty string; the same stricter behavior is applied to the existing
imports and protobuf.importPaths expansion.
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