Skip to content

refactor(create): declare template vars via resolver map - #1787

Draft
marcossevilla wants to merge 3 commits into
mainfrom
refactor/template-var-resolvers
Draft

marcossevilla wants to merge 3 commits into
mainfrom
refactor/template-var-resolvers

Conversation

@marcossevilla

@marcossevilla marcossevilla commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Status

READY

Description

Part 1/3 of stack #1790 (template vars check).

Template vars were built imperatively in getTemplateVars() with this is X branches and per-command overrides, so the set of vars a command handles was not declared anywhere.

  • Adds CreateSubCommand.templateVarResolvers: a map from brick var name to a lazy resolver. OrgName, Publishable, Workspace and the subcommands extend it with {...super.templateVarResolvers, ...}.
  • getTemplateVars() is now @nonVirtual and computed from the map, dropping null results so unset optional vars (e.g. application_id) still fall back to template defaults.
  • Resolvers are closures, so the handled var names can be read without parsing args, which the next PR relies on.

No behavior change: existing exact vars assertions pass unchanged.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

Template vars were built imperatively in getTemplateVars() with `this is X`
branches and per-command overrides, so the set of vars a command handles
was not declared anywhere.

Introduce CreateSubCommand.templateVarResolvers, a map from brick var name
to a lazy resolver. Mixins and subcommands extend it, and getTemplateVars()
is now @nonvirtual and computed from it, dropping null results so unset
optional vars (e.g. application_id) still fall back to template defaults.

Because resolvers are closures, the handled var names can be read without
parsing arguments, which enables checking them against bundle vars.
@marcossevilla
marcossevilla added this pull request to stack #1790 October 29, 2026 12:26
@marcossevilla marcossevilla changed the title refactor/template var resolvers refactor(create): declare template vars via resolver map Oct 29, 2026

This branch has not been deployed

No deployments
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