You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,7 @@ After dependency upgrades (e.g. `flutter_timezone`), run at least `flutter pub g
121
121
3. Ensure **all CI jobs pass**, including **Build Android APK**. If you cannot build APK locally, push and check the PR pipeline. Build APK is the only gate for Android config (desugaring, etc.).
122
122
4. Do not downgrade plugins with native code to versions that use the old Flutter embedding (e.g. `flutter_timezone` must stay **^5.0.0** or higher; see [docs/DEPENDENCIES.md](docs/DEPENDENCIES.md)).
123
123
124
-
**"N packages have newer versions" during build:**Run `make outdated` (or `flutter pub outdated`) to see which dependencies can be updated. Prefer updating direct dependencies and following the upgrade checklist above so the message stays minimal. See [docs/DEPENDENCIES.md §6](docs/DEPENDENCIES.md) for details.
124
+
**"N packages have newer versions" during build:**A **test** (`test/deps_no_outdated_message_test.dart`) and a **CI step** (`script/check_no_outdated_deps.sh`) fail when this message appears. To fix: run `make outdated` (or `flutter pub outdated`), update `pubspec.yaml` or `dependency_overrides`, then `make check-deps` or `make test`. See [docs/DEPENDENCIES.md §6](docs/DEPENDENCIES.md).
125
125
126
126
---
127
127
@@ -136,6 +136,7 @@ What the guidelines require is enforced as follows. **If it can be automated, it
136
136
| Unit tests pass |**CI Unit tests** — `flutter test test/domain test/storage test/router test/l10n`. |
.PHONY: help run run-chrome build-android build-ios run-chrome-docker test test-unit test-widget test-integration clean deps gen-l10n analyze format check outdated
4
+
.PHONY: help run run-chrome build-android build-ios run-chrome-docker test test-unit test-widget test-integration clean deps gen-l10n analyze format check check-deps outdated
5
5
6
6
help:
7
7
@echo "Take Your Meds — targets:"
@@ -19,6 +19,7 @@ help:
19
19
@echo " analyze Run static analysis (flutter analyze lib test)"
20
20
@echo " format Format lib and test (dart format). Run before every commit."
21
21
@echo " check Same as CI Lint job: analyze + format check. Fails if not formatted."
22
+
@echo " check-deps Fail if 'flutter pub get' reports packages with newer versions incompatible with constraints."
22
23
@echo " outdated List outdated packages (flutter pub outdated). Run periodically to keep deps current."
23
24
@echo " clean Clean build artifacts"
24
25
@@ -41,7 +42,7 @@ test:
41
42
flutter test
42
43
43
44
test-unit:
44
-
flutter test test/domain test/storage test/router test/l10n
45
+
flutter test test/domain test/storage test/router test/l10n test/deps_no_outdated_message_test.dart
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,7 @@ Key paths:
69
69
|`make analyze`| Run static analysis (lib + test) |
70
70
|`make format`| Format `lib` and `test` (run before every commit; CI checks this) |
71
71
|`make check`| Same as CI Lint: analyze + format check |
72
+
|`make check-deps`| Fail if `flutter pub get` reports "packages have newer versions incompatible with constraints" (same as CI; see test `deps_no_outdated_message_test.dart`) |
72
73
|`make outdated`| List outdated packages; run periodically to keep deps current (see docs/DEPENDENCIES.md) |
Copy file name to clipboardExpand all lines: docs/DEPENDENCIES.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,11 +92,17 @@ Summary: **Dependency upgrades that touch native code must be validated by a ful
92
92
93
93
When you run `flutter pub get` or build the app, you may see: *"N packages have newer versions incompatible with dependency constraints. Try \`flutter pub outdated\` for more information."*
94
94
95
-
**What to do:**
95
+
**Enforcement:** A **test** and a **CI step** fail when this message appears, so every developer and CI see the failure until it is fixed:
96
96
97
-
1.**Run `flutter pub outdated`** (or `make outdated` if available). It lists direct and transitive dependencies and shows which can be upgraded within current constraints ("Upgradable") or need a constraint change ("Resolvable" / "Latest").
98
-
2.**Prioritize direct dependencies.** Update `pubspec.yaml` constraints for our direct dependencies so they resolve to current, compatible versions. Follow the upgrade checklist in §3 and the native-plugin rules in §2.
99
-
3.**Transitive dependencies** (e.g. `characters`, `meta`, `matcher`) are pulled in by the SDK or other packages. We do not list them in `pubspec.yaml`; they are upgraded when we upgrade Flutter or the direct packages. Do not add overrides unless necessary to fix a security or build issue.
100
-
4.**After any dependency change:** run `make format`, `make check`, `make test`, and ensure CI (including Build Android APK) passes.
97
+
-**Test:**`test/deps_no_outdated_message_test.dart` runs `flutter pub get` and fails if the output contains that message. It is run with unit tests (`make test-unit` or `flutter test test/... test/deps_no_outdated_message_test.dart`).
98
+
-**CI:** The Lint job runs `script/check_no_outdated_deps.sh` after `flutter pub get`; the script exits 1 if the message is present.
99
+
-**Locally:** Run `make check-deps` to run the same check without running the full test suite.
101
100
102
-
This keeps the "N packages have newer versions" message to a minimum and avoids accumulating technical debt. Prefer upgrading one or a few related packages per change, with tests and CI green.
101
+
**What to do when the test or check fails:**
102
+
103
+
1.**Run `flutter pub outdated`** (or `make outdated`). It lists which packages have newer versions and whether they are "Upgradable" or need a constraint change.
104
+
2.**Update direct dependencies** in `pubspec.yaml` to compatible newer versions where possible. Follow the upgrade checklist in §4.
105
+
3.**Transitive dependencies** that still show "incompatible with constraints" can be pinned to a newer version via **dependency_overrides** in `pubspec.yaml` (see current overrides in this project for characters, matcher, meta, etc.). Use overrides sparingly and only for transitive deps we cannot fix by upgrading direct deps.
106
+
4. After changes: run `make format`, `make check`, `make test` (or at least `make check-deps`), and ensure CI passes.
107
+
108
+
This keeps the "N packages have newer versions" message gone and ensures the test and CI stay green.
Copy file name to clipboardExpand all lines: test/README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,10 @@ This file describes what each test file and each test does. Use it for QA and on
38
38
-**notification action labels** — The strings for "OK", "Skip", "Postpone 10 min", "Postpone 30 min" come from the app's localization (ARB), not hardcoded.
39
39
-**notification body** — The reminder body text ("Time to take your medication") also comes from localization.
40
40
41
+
### `deps_no_outdated_message_test.dart` — No "packages have newer versions" message
42
+
43
+
-**pub get does not report packages with newer versions incompatible with constraints** — Runs `flutter pub get` and fails if the output contains the "packages have newer versions incompatible with dependency constraints" message. Ensures developers and CI see a failing test until dependencies are updated (run `make outdated`, update pubspec or dependency_overrides). Also enforced by CI step `script/check_no_outdated_deps.sh` and locally by `make check-deps`.
0 commit comments