ci: commit the analyzer excludes the Flutter migrator rewrites on every pub get - #1
Conversation
…ry pub get `flutter pub get` runs the Flutter tool's `analysis_options.yaml` migrator, which appends an `analyzer.exclude` block for `build/` plus the six platform runner directories. It is the first step of both `ci.yml` and `publish.yml`, so by the time `flutter pub publish --dry-run` runs later in the same job the checkout is dirty: "1 checked-in file is modified in git", exit 65. Nothing had caught it because the last CI run in this repo predates the migrator (2026-05-21). The next run on any branch would have failed, and publish.yml shares the step, so it would have blocked a release as well. Committing the block the migrator wants makes the migrator a no-op. The hand-written comment above it survives a `pub get`, since the migrator reads the parsed YAML, finds the excludes present and skips the file. Same fix as fluttersdk/wind#178.
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
|
@kodizm review |
1 similar comment
|
@kodizm review |
|
Note Kodizm (AI-generated). May contain mistakes; verify before acting. No findings - the change is correct, and I reproduced both the failure it fixes and the fix itself. Both files in the pull request were read in full ( Why I believe it is correct:
TestsNo test change, and none is warranted - the change is analyzer configuration with no Dart behaviour attached. The existing 6 tests still pass. Separately confirming the note in the description: coverage is exactly Checks I ran
One caveat on my own process, for the record: my first dry-run reported exit 65. That was my fault, not the branch's - I made the scratch copy of the checkout before running the negative control, and because Toolchain used: Flutter 3.47.1 stable, Dart 3.13.1. Worth noting the fix is only durable while the migrator's exclusion list stays as it is - if a future Flutter version adds a directory to it, the migrator starts rewriting again. That is not a defect here, and the |
…ry pub get (#23) `flutter pub get` runs the Flutter tool's `analysis_options.yaml` migrator, which appends an `analyzer.exclude` block for `build/` plus the six platform runner directories. It is the first step of both `ci.yml` and `publish.yml`, so by the time `dart pub publish --dry-run` runs later in the same job the checkout is dirty: "1 checked-in file is modified in git", exit 65. Reproduced on a clean checkout of master, reading the exit code directly rather than through a pipe. Nothing had reported it because no CI run in this repo postdates the migrator, and publish.yml shares the step, so the next release would have been blocked too. Committing the block the migrator wants makes it a no-op. The hand-written comment above it survives a `pub get`, since the migrator reads the parsed YAML, finds the excludes present and skips the file. Same fix as fluttersdk/wind#178 and fluttersdk/wind_diagnostics_contracts#1.
What
analysis_options.yamlnow carries theanalyzer.excludeblock the Flutter tool's migrator writes, so the migrator is a no-op and a CI checkout stays clean.Why
This repo's CI has not run since 2026-05-21, which is why nothing has reported it: the next run on any branch would have failed, and it is not a cosmetic warning.
flutter pub getruns the Flutter tool'sanalysis_options.yamlmigrator:That is the first step of both
ci.ymlandpublish.yml. TheValidate publish archivestep later in the same job (ci.yml:53) then inspects the tree it was handed:Reproduced on a clean checkout of
develop, with the exit code read directly rather than through a pipe:publish.ymlshares that step in its validate job, so this would have blocked a release too, not just a PR.Reverting the file inside the workflow was rejected as the alternative: it hides the drift and leaves every contributor's tree dirty after a
pub get. The excludes are also harmless on their own terms, since this package has none of those directories.The hand-written comment above the block survives a
pub get: the migrator reads the parsed YAML, finds the excludes already present, and skips the file. Confirmed by runningpub gettwice and checkinggit status.Gates
Run locally on the branch tip, matching
ci.ymlstep for step:dart format --output=none --set-exit-if-changed lib/ test/: 2 files, 0 changed.dart analyze lib/ test/: No issues found.flutter test --coverage --timeout=30s: 6 passed.flutter pub publish --dry-runon the committed tree:Package has 0 warnings, exit 0.Note on the coverage floor
The package sits at exactly 80.00% with LH=4 of LF=5, so a single new uncovered line drops it under the gate. Not changed here, just worth knowing before the next feature lands.
Same fix upstream
Landed in
fluttersdk_windas fluttersdk/wind#178, where it had turnedLint & Testred on all four open PRs at once.