Skip to content

fix: ignore unrelated build.yaml files during CLI discovery - #795

Open
KuroGeo wants to merge 1 commit into
FlutterGen:mainfrom
KuroGeo:fix/ignore-unrelated-build-config
Open

KuroGeo wants to merge 1 commit into
FlutterGen:mainfrom
KuroGeo:fix/ignore-unrelated-build-config

Conversation

@KuroGeo

@KuroGeo KuroGeo commented Nov 5, 2026

Copy link
Copy Markdown

What does this change?

The CLI currently passes every discovered package-local build.yaml as an explicit build file. If it configures only another builder, FlutterGen generates the requested assets and exits successfully but logs SEVERE: ... does not contain valid options. This also happens for workspace members.

Let the core configuration loader handle implicit discovery and look beside the selected pubspec. It only uses a discovered file when it contains FlutterGen options. Explicit --build inputs keep their existing diagnostics and precedence, and valid package-local options still work when --config points outside the working directory.

Related to #702. The current build_runner implementation already consumes BuilderOptions directly; I reproduced and fixed the remaining CLI path on current main.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Validation

On macOS arm64, Flutter 3.44.2 / Dart 3.12.2:

  • dart run melos test: 106 passed across the command, core, runner and Flutter example suites. Unmodified baseline: 102 passed.
  • dart run melos test:xml-matrix: 90 passed with xml 6.x and 90 with xml 7.x.
  • dart run melos analyze: all six packages passed.
  • Repository Dart format check and git diff --check: passed.
  • Generated test goldens and examples through the CLI and build_runner, including workspace mode: no tracked output differences.

Before the production change, the two CLI regressions emitted SEVERE and the new package-local core discovery regression selected the wrong output directory. After the change they pass. The existing fallback test now writes its fixture beside the pubspec and verifies a freshly generated output path; it also fails on the original core source. A control verifies that an explicitly selected build file without options still reports SEVERE.

Windows/Linux CI and native application builds were not run locally. The full host test suite, including the existing build_runner workspace integration tests and Flutter widget tests, was run without adding skips or changing timeouts.

Checklist

AI assistance: this patch and its tests were developed and reviewed with OpenAI Codex. The validation results above were run locally; upstream review and CI remain pending.

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