Skip to content

Fix the pre-existing broken test CI baseline (Flutter pin, gen-l10n, lint gate) #19

Description

@valorengels

Context: This is a Flutter project template for small teams using AI-assisted development. Its CI test job is red on main itself — not caused by any in-flight PR — which blocks merging every feature branch. This issue tracks fixing that broken baseline.

Problem

The template's flutter-test.yml CI test job fails on main, so no PR can merge. The failure is pre-existing and unrelated to feature work.

Current behavior:

  • The CI test workflow pins Flutter 3.27.0, which resolves old dependency versions (e.g. freezed 3.0.6, analyzer 6.11.0) that fail to generate Freezed when/whenOrNull, producing analyzer errors like The method 'when' isn't defined for the type 'Result'.
  • The workflow runs flutter pub run build_runner build but never flutter gen-l10n, so the generated lib/l10n/generated/app_localizations.dart is missing in CI (the files are gitignored and not generated).
  • Even with both fixed, flutter analyze --fatal-infos fails on ~121 info-level lint findings across lib/ and test/ (style issues: require_trailing_commas, avoid_redundant_argument_values, avoid_implementing_value_types, etc.).

Desired outcome:

  • The test job passes on main: correct Flutter/dependency versions, l10n generated, and either the lint findings resolved or the --fatal-infos policy relaxed deliberately.
  • flutter test (55/55) and flutter analyze pass in CI, so feature PRs can merge.

Definitions

Term Definition Reference
Freezed A Dart code-generation package that produces sealed-union .freezed.dart files (when/whenOrNull methods) pub.dev/freezed
l10n Localization; flutter gen-l10n generates app_localizations*.dart from .arb files Flutter i18n

Solution Sketch

  • Bump the pinned Flutter version in flutter-test.yml (and the other workflows if needed) from 3.27.0 to 3.44.8, matching the repo's documented toolchain and the rest of the ecosystem.
  • Add a flutter gen-l10n step to the test workflow before flutter test (and to any build workflow that needs it).
  • Resolve the lint findings (via dart fix/dart format where automatic; manually for the rest) OR relax the --fatal-infos analyzer gate if the infos are style-only — with a documented rationale.
  • Update pubspec.lock to the working dependency resolution (verified: with Flutter 3.44.8, flutter test passes 55/55).

Prior Context

  • The repo's README.md documents the toolchain as Flutter 3.44.8, JDK 17, AGP 9.0.1, Gradle 9.1.0 — the CI's Flutter 3.27.0 pin contradicts this.

Recon Summary

Confirmed:

Revised:

  • The fix is a dependency-version + CI-config + lint-cleanup rework, not a one-line change.

Pre-requisites:

  • None — this is the fix.

Dropped:

  • Committing generated .freezed.dart/*.g.dart/l10n files (the repo deliberately gitignores them); the intended pattern is generating in CI.

Acceptance Criteria

  • flutter-test.yml runs on Flutter 3.44.8 and includes a flutter gen-l10n step.
  • The test job passes on a main branch PR (no analyzer errors, tests pass).
  • flutter analyze produces no errors/warnings (infos may remain if the --fatal-infos gate is relaxed with rationale).
  • Feature PRs can merge without hitting the pre-existing test failure.

Downstream

This issue feeds into /do-plan, then /do-build. It is the pre-requisite that unblocks merging the template's in-flight PRs (#16, #17) and any future work, since a red test baseline blocks the CI merge gate.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions