Repository navigation
test(create): fail when template bundle vars drift from the CLI - #1788
Draft
marcossevilla wants to merge 2 commits into
Draft
marcossevilla wants to merge 2 commits into
marcossevilla wants to merge 2 commits into
Conversation
3 of 7 tasks
marcossevilla
force-pushed
the
test/template-vars-check
branch
3 times, most recently
from
November 2, 2026 15:58
1d19191 to
98c773e
Compare
Template bundles are regenerated by automated bump PRs, so new bundle vars could land without the CLI passing them. Add a unit test that checks every create subcommand's templateVarResolvers against its templates' bundle vars in both directions, plus Template.defaultedVars as the explicit allowlist for vars intentionally left to the template default. flame_game's application_id is allowlisted since the template derives it from org_name and project_name. flutter_plugin now passes dart_fix_output: true; the var is only read by the post_gen hook, which the CLI never runs, so generated output is unchanged. This check fails on purpose for the org_name var of app_ui_package, dart_cli, dart_package and flutter_package until the follow-up that adds --org-name to those subcommands.
List org_name as defaulted for the package and CLI templates until they pass it, and move dart_fix_output to FlutterPluginTemplate.defaultedVars since very_good create never runs the brick's post_gen hook. Addresses FINDING-01, FINDING-07, FINDING-08 from review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
marcossevilla
force-pushed
the
test/template-vars-check
branch
from
November 3, 2026 10:18
98c773e to
138fbe5
Compare
This branch has not been deployed
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.
Status
READY
Description
Part 2/3 of stack #1790. Green on its own; can merge before #1789.
Template bundles are regenerated by automated bump PRs (
bump_templates.yaml), so new bundle vars can land without the CLI passing them. This adds a unit test (run by the existing CI) that checks, for everyvery_good createsubcommand and template:templateVarResolversand not listed inTemplate.defaultedVars→ fail.defaultedVarsentries the bundle does not declare → fail.Failure messages name the subcommand, template, bundle, vars, and how to fix them.
Also:
Template.defaultedVars(empty by default): bundle vars the CLI intentionally does not pass. Mason does not apply brick defaults, so each listed var must be derived by the brick'spre_genhook or be safe to render empty.flame_gamelistsapplication_id, which itspre_genhook derives fromorg_nameandproject_name.flutter_pluginlistsdart_fix_output. It only gates the brick'spost_genhook, whichvery_good createnever runs;onGenerateCompletealready applies the fixes.app_ui_package,dart_cli,dart_packageandflutter_packagelistorg_namefor now, which documents today's behavior (an empty copyright holder inLICENSE). feat(create): add --org-name to package and cli subcommands #1789 passes it and removes these entries.No behavior change.
Type of Change