Skip to content

fix(installer): apply --set core overrides before config collection - #2671

Merged
alexeyv merged 1 commit into
mainfrom
fix/set-core-output-folder
Aug 2, 2026
Merged

fix(installer): apply --set core overrides before config collection#2671
alexeyv merged 1 commit into
mainfrom
fix/set-core-output-folder

Conversation

@alexeyv

@alexeyv alexeyv commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

What

--set core.<key> now takes effect during config collection instead of only as a post-install TOML patch.

Why

Core values are dependency-bearing: module artifact paths are built from core.output_folder during collection, and the output directory is created from those paths. Patching the key in afterwards left three sources of truth disagreeing.

On main, --set core.output_folder=generated:

before after
_bmad/core/config.yaml generated generated
_bmad/bmm/config.yaml paths {project-root}/_bmad-output/… {project-root}/generated/…
directory created _bmad-output/ generated/

Exit code 0, no warning — BMAD then wrote artifacts into the folder the user had explicitly overridden. The docs present --set core.<key> and the legacy shortcuts as equivalent, and label --set the preferred form, so this was reachable by following the documented advice.

How

Fold --set core.<key> into the corresponding option fields (--user-name, --output-folder, …) before anything reads them, so both spellings feed the same collection step. Non-core overrides keep the existing post-install patch path unchanged.

Testing

  • New test suite 50 (6 assertions) covering core seeding, dependent module-path resolution, parity with the legacy flag, and that non-core --set still reaches the patch step. Reverting ui.js alone fails 4 of the 6 and passes the 2 guard assertions.
  • Manual battery across plain --yes, legacy flag, --set core.output_folder, --set core.user_name, --set bmm.user_skill_level, and a combined core+bmm run — non-core paths unchanged.
  • Verified the documented verbatim-value behaviour still holds: --set 'core.output_folder={project-root}/out' is written unrendered and resolves correctly.
  • HUSKY=0 npm ci && npm run quality green on the pushed HEAD (428 assertions, 0 failures).

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alexeyv has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The installer now applies --set core.* values during configuration collection. Core overrides control dependent paths and take precedence over legacy options. New tests cover precedence, defaults, path propagation, and non-core override routing.

Changes

Core override collection

Layer / File(s) Summary
Map and validate core overrides
tools/installer/ui.js, test/test-installation-components.js
collectModuleConfigs maps core username, language, and output-folder overrides to legacy option fields without mutating the input. Test Suite 50 validates precedence, defaults, dependent paths, and post-install handling.Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: bmadcode, dracic

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes applying core --set overrides before installer configuration collection.
Description check ✅ Passed The description explains the core override fix, its impact, implementation, and testing, all of which match the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/set-core-output-folder

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tools/installer/ui.js`:
- Around line 817-829: The collection logic around coreSetToOption must apply
every supported setOverrides.core key, including project_name, while preserving
--set precedence over legacy options; update tools/installer/ui.js lines 817-829
accordingly. Add a test assertion in test/test-installation-components.js lines
3820-3849 confirming collectedConfig.core.project_name contains the supplied
override.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 18d4a239-ce06-4b32-83a8-4dae3c3df04d

📥 Commits

Reviewing files that changed from the base of the PR and between 49c608f and 70cd78d.

📒 Files selected for processing (2)
  • test/test-installation-components.js
  • tools/installer/ui.js

Comment thread tools/installer/ui.js Outdated
Comment on lines +817 to +829
const coreSetToOption = {
user_name: 'userName',
communication_language: 'communicationLanguage',
document_output_language: 'documentOutputLanguage',
output_folder: 'outputFolder',
};
const fromSet = {};
for (const [key, optionField] of Object.entries(coreSetToOption)) {
if (setOverrides.core[key] !== undefined) fromSet[optionField] = setOverrides.core[key];
}
// --set is the preferred form, so it wins if a legacy shortcut sets the
// same key. Rebind rather than mutate — `options` belongs to the caller.
options = { ...options, ...fromSet };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Apply every supported core override during collection.

project_name is a core key, but coreSetToOption omits it. Therefore --set core.project_name=... stays at the post-install patch stage and collectedConfig.core.project_name retains the default or prompted value.

  • tools/installer/ui.js#L817-L829: Merge all supported setOverrides.core keys into the collection seed. Preserve --set precedence over legacy options.
  • test/test-installation-components.js#L3820-L3849: Add a core.project_name assertion that verifies the collected core configuration contains the override.
📍 Affects 2 files
  • tools/installer/ui.js#L817-L829 (this comment)
  • test/test-installation-components.js#L3820-L3849
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/installer/ui.js` around lines 817 - 829, The collection logic around
coreSetToOption must apply every supported setOverrides.core key, including
project_name, while preserving --set precedence over legacy options; update
tools/installer/ui.js lines 817-829 accordingly. Add a test assertion in
test/test-installation-components.js lines 3820-3849 confirming
collectedConfig.core.project_name contains the supplied override.

@alexeyv
alexeyv force-pushed the fix/set-core-output-folder branch from 70cd78d to 27d05a0 Compare August 2, 2026 11:44

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alexeyv has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

`--set core.<key>` was applied only as a post-install TOML patch, but core
values are dependency-bearing: module artifact paths are built from
output_folder during config collection, the output directory is created
from those paths, and each module's config.yaml snapshots the core values
at generate time. A patch that lands after all of that leaves the sources
disagreeing.

`--set core.output_folder=generated` produced output_folder: generated in
core config, BMM paths under _bmad-output, and a _bmad-output/ directory
on disk. `--set core.project_name=Foo` left BMM's copy on the default.
The docs present --set core.<key> and the legacy shortcuts as equivalent
and label --set the preferred form, so both were reachable by following
the documented advice.

Seed core config from setOverrides.core alongside the legacy shortcut
flags, so every core key takes effect during collection rather than only
the four that have a dedicated flag. Non-core overrides keep the existing
post-install patch path.
@alexeyv
alexeyv force-pushed the fix/set-core-output-folder branch from 27d05a0 to b29fe3d Compare August 2, 2026 12:00

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alexeyv has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@alexeyv
alexeyv merged commit 770d425 into main Aug 2, 2026
5 checks passed
@alexeyv
alexeyv deleted the fix/set-core-output-folder branch August 2, 2026 12:23
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