diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eeeb9f5..8c570b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,11 +5,6 @@ on: branches: [main] pull_request: -# The Flutter app lives in coffee_quest/; the repo root holds only docs. -defaults: - run: - working-directory: coffee_quest - env: FLUTTER_VERSION: "3.44.1" diff --git a/docs/plans/fix-ci-working-directory.md b/docs/plans/fix-ci-working-directory.md new file mode 100644 index 0000000..febb796 --- /dev/null +++ b/docs/plans/fix-ci-working-directory.md @@ -0,0 +1,199 @@ +# Plan: Make CI run from the repo root after the project restructure + +> **Executor instructions**: Follow this plan step by step. Run every verification +> command and confirm the expected result before moving on. If anything under +> "STOP conditions" occurs, stop and report — do not improvise. +> +> **Drift check (run first)**: `git diff --stat 071b8b4..HEAD -- .github/workflows/ci.yml` +> If `.github/workflows/ci.yml` changed since this plan was written, compare the +> "Current state" excerpt below against the live file before editing; on a +> mismatch, treat it as a STOP condition. + +## Status + +- **Priority**: P1 (CI is fully red on every push/PR) +- **Effort**: S +- **Risk**: LOW +- **Depends on**: none +- **Category**: dx / ci +- **Planned at**: commit `071b8b4`, 2026-06-14 + +## Why this matters + +The `chore: project restructure` commit moved the Flutter app from `coffee_quest/` +to the repo root, but `.github/workflows/ci.yml` still sets +`working-directory: coffee_quest` as a job-wide default. That directory no longer +exists, so the runner fails before any step runs: + +``` +Error: An error occurred trying to start process '/usr/bin/bash' with working +directory '/home/runner/work/brewpath/brewpath/coffee_quest'. No such file or directory +``` + +All three CI jobs (`format`, `analyze & test`, `iOS build`) fail. Removing the stale +default makes every step run from the checkout root, where `pubspec.yaml`, `lib/`, +`test/`, and `integration_test/` now live. After this lands, CI is green again. + +## Current state + +- `.github/workflows/ci.yml` — the only workflow this repo owns. (The many + `*.yml` files under `build/ios/SourcePackages/...` are vendored dependency + workflows; GitHub does not run them. Do **not** touch them.) +- `pubspec.yaml` (package name still `coffee_quest`), `lib/`, `test/`, and + `integration_test/` are all at the repo root — confirmed by `ls` at root. +- The broken section, exactly as it exists today (`.github/workflows/ci.yml:1-14`): + +```yaml +name: CI + +on: + push: + branches: [main] + pull_request: + +# The Flutter app lives in coffee_quest/; the repo root holds only docs. +defaults: + run: + working-directory: coffee_quest + +env: + FLUTTER_VERSION: "3.44.1" +``` + +Every `run:` step below this inherits `working-directory: coffee_quest`. The fix is +to delete the now-false comment **and** the `defaults:` block so steps run at root. +No `run:` step references a `coffee_quest/`-relative path, so nothing else needs to +change — all paths (`lib`, `test`, `integration_test`, `build/ios/iphoneos/Runner.app`) +are already correct relative to the root. + +## Commands you will need + +| Purpose | Command | Expected on success | +|--------------------|------------------------------------------------------------------------------------------|----------------------------| +| YAML parse check | `python3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))"` | exit 0, no output | +| Confirm fix | `grep -n "working-directory" .github/workflows/ci.yml` | no matches (exit 1) | +| Format check | `dart format --output=none --set-exit-if-changed lib test integration_test` | exit 0 | +| Deps | `flutter pub get` | exit 0 | +| Analyze | `flutter analyze` | exit 0, "No issues found!" | +| Metrics gate | `dart run dart_code_linter:metrics analyze lib --set-exit-on-violation-level=warning` | exit 0 | +| Tests | `flutter test` | all pass | +| iOS build (macOS) | `flutter build ios --release --no-codesign` | exit 0 | + +`actionlint` is **not installed** in this environment — use the `python3` YAML parse +above as the local syntax check. GitHub validates full workflow syntax on push. + +## Scope + +**In scope** (the only file to modify): +- `.github/workflows/ci.yml` + +**Out of scope** (do NOT touch): +- Any `*.yml` under `build/` — vendored dependency workflows, not run by this repo. +- `CLAUDE.md`, `AGENTS.md`, `README.md` — they still describe the old `coffee_quest/` + layout and are now inaccurate, but fixing docs is a separate follow-up (see + Maintenance notes). Do not edit them in this plan. +- Application code, tests, `pubspec.yaml` — this is a config-only change. + +## Git workflow + +- Create a branch: `git checkout -b fix/ci-working-directory`. +- One commit; message style is conventional commits (see `git log --oneline`, e.g. + `chore: project restructure`). Suggested: `ci: run workflow from repo root after restructure`. +- Do **not** push or open a PR unless the operator explicitly asks. (Verification + step 4 below requires a push; only perform it on instruction.) + +## Steps + +### Step 1: Remove the stale comment and `working-directory` default + +Edit `.github/workflows/ci.yml` so the top of the file (lines 1–14 above) becomes +**exactly**: + +```yaml +name: CI + +on: + push: + branches: [main] + pull_request: + +env: + FLUTTER_VERSION: "3.44.1" +``` + +That is: delete the line `# The Flutter app lives in coffee_quest/; the repo root +holds only docs.` and the three lines `defaults:` / `run:` / `working-directory: +coffee_quest`, leaving a single blank line between `pull_request:` and `env:`. Do +not change anything below `env:`. + +**Verify**: +- `grep -n "working-directory" .github/workflows/ci.yml` → no matches (exit 1). +- `grep -n "coffee_quest" .github/workflows/ci.yml` → no matches (exit 1). +- `python3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))"` → exit 0. + +## Verification Plan + +- [ ] Verification 1 — Workflow still parses + - `python3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))"` + - Expected: exit 0, no error. + +- [ ] Verification 2 — Each CI command succeeds from the repo root + - Run, in order, from the repo root: the Format check, Deps, Analyze, Metrics + gate, and Tests commands from the table above. + - Expected: every command exits 0; no "No such file or directory" / missing-path errors. + - If `flutter`/`dart` are not on PATH, STOP and report (see STOP conditions) — + do not attempt to install a toolchain. + +- [ ] Verification 3 — iOS build job (macOS hosts only) + - `flutter build ios --release --no-codesign` then `ls -la build/ios/iphoneos/Runner.app`. + - Expected: build exits 0 and `build/ios/iphoneos/Runner.app` exists. + - If not on macOS, skip and note "skipped — not a darwin host"; GitHub's + `macos-latest` runner covers it in Verification 4. + +- [ ] Verification 4 — CI is green on GitHub (only after an authorized push) + - Push the branch / open a PR, then watch the `CI` run (e.g. `gh run watch`). + - Expected: all three jobs — `format`, `analyze & test`, `iOS build` — finish with + a ✓ in the run summary, and the working-directory error is gone. If a job fails + only on an infra/transient error (timeout, runner pull failure), re-run it once + before treating it as a real failure. + +## Test Plan + +- No new or changed unit tests: this is a CI-config-only change with no application + code touched. Adding tests here would be scope creep. +- The required project test is the **existing** suite passing from the new root: + `flutter test` (Verification 2) locally and in the `analyze & test` job + (Verification 4). DoD: suite passes in both. + +## Done criteria + +ALL must hold: + +- [ ] `grep -n "working-directory" .github/workflows/ci.yml` returns no matches. +- [ ] `grep -n "coffee_quest" .github/workflows/ci.yml` returns no matches. +- [ ] `python3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))"` exits 0. +- [ ] `git status --porcelain` shows only `.github/workflows/ci.yml` modified. +- [ ] (After authorized push) all three CI jobs are green. + +## STOP conditions + +Stop and report back (do not improvise) if: + +- The drift check shows `.github/workflows/ci.yml` no longer matches the "Current + state" excerpt (someone already edited it). +- `flutter` or `dart` is not installed / not on PATH — report it; do not install a toolchain. +- A `coffee_quest/` directory still exists at the repo root, or `pubspec.yaml` is + **not** at the root — the restructure assumption is wrong; re-confirm before editing. +- Verification 2 surfaces `flutter analyze`, metrics, or test failures that are not + path/working-directory related — these are likely pre-existing issues unrelated to + this fix; report them rather than fixing them under this plan. + +## Maintenance notes + +- Follow-up (deferred, not in this plan): `CLAUDE.md`, `AGENTS.md`, and `README.md` + still describe the `coffee_quest/` subdirectory and instruct running flutter/dart + commands from there. They are now inaccurate and should be updated separately. +- If the app is ever moved back into a subdirectory, the `working-directory` default + must be reintroduced (or per-step `working-directory:` added). +- Reviewer should confirm the diff touches only `.github/workflows/ci.yml` and that + no `run:` step relies on a `coffee_quest/`-relative path. diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 3ed4c94..38e2de1 100644 --- a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/app-check.git", "state" : { - "revision" : "61b85103a1aeed8218f17c794687781505fbbef5", - "version" : "11.2.0" + "revision" : "bb4002485ff867768dec13bf904a2ddb050bd1b1", + "version" : "11.3.0" } }, { @@ -59,8 +59,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleUtilities.git", "state" : { - "revision" : "60da361632d0de02786f709bdc0c4df340f7613e", - "version" : "8.1.0" + "revision" : "c46e5f8b7c23265f17c24ca7f9fa1b13ded7a822", + "version" : "8.1.1" } }, { @@ -104,8 +104,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/nanopb.git", "state" : { - "revision" : "b7e1104502eca3a213b46303391ca4d3bc8ddec1", - "version" : "2.30910.0" + "revision" : "3851d94a41890dea16dc3db34caf60e585cb4163", + "version" : "2.30910.1" } }, { @@ -113,8 +113,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/promises.git", "state" : { - "revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac", - "version" : "2.4.0" + "revision" : "f4a19a3c313dc2616c70bb49d29a799fb16be837", + "version" : "2.4.1" } } ], diff --git a/pubspec.lock b/pubspec.lock index 24f4060..35f3cf5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: analyzer_buffer - sha256: bf559bc54530827a92cc4d9ee340fc76b4f17f386218c2b9e7cd33ed468a7e4d + sha256: "445b77e2054fa3e8c8a8ef1b5e9e6b23bb8028fffd34b5e60eaef315b7750674" url: "https://pub.dev" source: hosted - version: "0.3.2" + version: "0.3.3" analyzer_plugin: dependency: transitive description: @@ -213,10 +213,10 @@ packages: dependency: transitive description: name: coverage - sha256: "5da775aa218eaf2151c721b16c01c7676fbfdd99cebba2bf64e8b807a28ff94d" + sha256: "956a3de0725ca232ad353565a8290d3357592bf4250f6f298a185e2d949c5d3d" url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.15.1" crypto: dependency: transitive description: @@ -253,18 +253,18 @@ packages: dependency: "direct main" description: name: drift - sha256: "8033500116b24398fba0cca0369cc31678cd627c01e41753a61186911cea743e" + sha256: "6cc0b623c0e83f7080524d8396e9301b1d78b9c66a4fdceeb0f798211303254c" url: "https://pub.dev" source: hosted - version: "2.33.0" + version: "2.34.0" drift_dev: dependency: "direct dev" description: name: drift_dev - sha256: b3dd5b75e30522a91da8abda9f5bb17230cb038097f6d15fa75d42bb563428aa + sha256: "9cfff1576b49725da0d32c040651a41ae195e8c4af8d8da301593e41d7abc2f7" url: "https://pub.dev" source: hosted - version: "2.33.0" + version: "2.34.0" drift_flutter: dependency: "direct main" description: @@ -415,10 +415,10 @@ packages: dependency: "direct main" description: name: flutter_riverpod - sha256: "4e166be88e1dbbaa34a280bdb744aeae73b7ef25fdf8db7a3bb776760a3648e2" + sha256: "9255e1e3ad6e38906a1b4f8287678f95f378744c5b46b1985588543f3f19046e" url: "https://pub.dev" source: hosted - version: "3.3.1" + version: "3.3.2" flutter_test: dependency: "direct dev" description: flutter @@ -542,10 +542,10 @@ packages: dependency: transitive description: name: in_app_purchase_android - sha256: "0585b7a762eb14b32187467c4bcadfab68d9978ae4b64d4164c54f06aaf73005" + sha256: eb8f551039481d1b265f12fa54f5ab5dd4f13ec5444a468b85a3793517a37fda url: "https://pub.dev" source: hosted - version: "0.5.0+2" + version: "0.5.1" in_app_purchase_platform_interface: dependency: transitive description: @@ -739,10 +739,10 @@ packages: dependency: "direct main" description: name: path_provider - sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" + sha256: a7f4874f987173da295a61c181b8ee71dab59b332a486b391babf26a1b884825 url: "https://pub.dev" source: hosted - version: "2.1.5" + version: "2.1.6" path_provider_android: dependency: transitive description: @@ -771,10 +771,10 @@ packages: dependency: transitive description: name: path_provider_platform_interface - sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + sha256: "484838772624c3a4b94f1e44a3e19897fee738f2d5c4ce448443b0417f7c9dda" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" path_provider_windows: dependency: transitive description: @@ -867,10 +867,10 @@ packages: dependency: transitive description: name: riverpod - sha256: "8c22216be8ad3ef2b44af3a329693558c98eca7b8bd4ef495c92db0bba279f83" + sha256: "17100416c51db7810c71a7bb2c34d1f881faa0074fd452afb0c4db6f8f126c76" url: "https://pub.dev" source: hosted - version: "3.2.1" + version: "3.3.2" riverpod_analyzer_utils: dependency: transitive description: @@ -883,18 +883,18 @@ packages: dependency: "direct main" description: name: riverpod_annotation - sha256: "16471a1260b94e939394d78f1c63a9350936ac4a68c9fbdab40be47268c0b04f" + sha256: "674dbb26e2db3d9253166faf4758c796af14146b8fbcf5e7102bc8a04cd359b8" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.0.3" riverpod_generator: dependency: "direct dev" description: name: riverpod_generator - sha256: "787d28dbbdff143ca941f2f7f0981f4beab7555ae53cbedc9f861f4c2c580d4d" + sha256: "54d790c3fee1ae281c448801bfdbfaa9fd961a9d3998494e0fcd9ee32184d7eb" url: "https://pub.dev" source: hosted - version: "4.0.4-dev.1" + version: "4.0.4" shelf: dependency: transitive description: @@ -984,10 +984,10 @@ packages: dependency: transitive description: name: sqlite3 - sha256: "9488c7d2cdb1091c91cacf7e207cff81b28bff8e366f042bad3afe7d34afe189" + sha256: "37356bcb56ce0d9404d602c41e4bdb7765e7e9732a3e47adb3d98c556a6abdad" url: "https://pub.dev" source: hosted - version: "3.3.2" + version: "3.3.3" sqlite3_flutter_libs: dependency: "direct main" description: @@ -1000,10 +1000,10 @@ packages: dependency: transitive description: name: sqlparser - sha256: ecdc06d4a7d79dcbc928d99afd2f7f5b0f98a637c46f89be83d911617f759978 + sha256: "40bdddb306a727be9ce510bd2d2b9a6c9db6c586d846ef7b22e3990a2b24f02d" url: "https://pub.dev" source: hosted - version: "0.44.4" + version: "0.44.5" stack_trace: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 46c90fc..e6d1198 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,20 +1,20 @@ name: coffee_quest description: Coffee Quest — Duolingo-style coffee education app. -publish_to: 'none' +publish_to: "none" version: 1.0.0+3 environment: # Floor raised 3.3.0 → 3.8.0: required by json_serializable 6.13.x. - sdk: '>=3.8.0 <4.0.0' - flutter: '>=3.22.0' + sdk: ">=3.8.0 <4.0.0" + flutter: ">=3.22.0" dependencies: flutter: sdk: flutter # State management - flutter_riverpod: ^3.3.1 - riverpod_annotation: ^4.0.2 + flutter_riverpod: ^3.3.2 + riverpod_annotation: ^4.0.3 # Navigation go_router: ^17.2.3 @@ -66,7 +66,7 @@ dev_dependencies: build_runner: ^2.15.0 # riverpod_generator / freezed: analyzer-12 support ships on the -dev line # (stable is still analyzer ^9 / <11). - riverpod_generator: ^4.0.4-dev.1 + riverpod_generator: ^4.0.4 freezed: ^3.2.6-dev.1 json_serializable: ^6.14.0 drift_dev: ^2.33.0