Repository navigation
Modernize: dart-define config, configurable model ids, tests, CI, cleanup - #1
Conversation
…tes and debug function - Delete jan29.md and UI_FIX_PLAN.md (dated AI-session notes) - Delete supabase/migrations/001_initial_schema.sql; the dated 20250129_initial_schema.sql is canonical. Objects that only 001 defined and that the code still uses (processing_queue, article queue trigger, handle_new_user trigger, articles.error_message, update_article_status) are preserved idempotently in 20250130_processing_queue.sql - Delete ios/Flutter '* 2.*' duplicates (not referenced by project.pbxproj) - Delete supabase/functions/test-grok debug function - Fix user-facing 'Saving to Readwise' toast in the Android share activity
…constants - Env reads SUPABASE_URL and SUPABASE_ANON_KEY via String.fromEnvironment; debug builds assert with a clear message when they are missing, release builds log and run offline as before - Podcast feed URL is derived from Env.supabaseUrl - Daily digest cron migration uses <SUPABASE_URL>/<SUPABASE_ANON_KEY> placeholders (with a Vault note) instead of a committed key - Add .env.example (app defines) and supabase/functions/.env.example (Edge Function secrets and model ids); un-ignore *.env.example - Xcode Cloud ci_post_clone.sh and validate_and_upload.sh write the defines into Generated.xcconfig with flutter build ios --config-only - Stop ignoring pubspec.lock (committed in a later change)
- Add supabase/functions/_shared/config.ts reading CLAUDE_MODEL and GROK_MODEL from the environment with defaults - Default Claude model is anthropic/claude-haiku-4.5 (confirmed against the OpenRouter model list; anthropic/claude-3.5-haiku is no longer listed) - Default Grok model stays grok-4-1-fast; override with the GROK_MODEL secret - extract-article and generate-digest use the shared values
- Raise floors to the currently resolved versions for flutter_riverpod, riverpod_annotation, riverpod_generator, go_router and supabase_flutter - Bump flutter_markdown ^0.7.7, just_audio ^0.10.6, audio_session ^0.2.4, intl ^0.20.2 and flutter_lints ^5.0.0 - Track pubspec.lock for reproducible CI and release builds - flutter analyze: 80 issues before (0 errors, 7 warnings), 56 after (0 errors, 7 warnings); no new lint rules fire
- Article, ArticleAnalysis, DailyDigest, PodcastEpisode and UserSettings JSON parsing, defaults and round-trips - RestrictedDomains provider detection and login URLs - Env behaviour for a build without dart-defines - 27 tests, flutter test passes
- Flutter 3.27.3 (matches Xcode Cloud): pub get, analyze, test - Dependabot for pub and github-actions, weekly - No Deno job: deno lint (33 problems) and deno check (13 pre-existing type errors) currently fail on the Edge Functions
- Document dart-define setup, Edge Function secrets, model env vars, Xcode Cloud and local release flow - Describe the actual pipeline (share extension, processing queue, extract-article, generate-digest, podcast playback) - Fix the Claude badge (Haiku 4.5 via OpenRouter) and add App Store, website and CI links
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review (automated daily pass): CI is green (Flutter analyze and test), and the dart-define config move is the right direction. Not merging yet because the change is large and release-affecting. To meet the bar:
|
|
Automated daily PR review (2026-11-04). CI is green and the config work looks sound, but I'm not auto-merging. Why hold: 32 files and +2208/-1514, and it changes the release path ( To meet the bar:
Happy to merge once 1 and 2 are done. |
|
CI is green, but holding the merge. Before it lands: (1) set SUPABASE_URL / SUPABASE_ANON_KEY in the Xcode Cloud workflow environment, since ci_post_clone.sh now fails fast without them; (2) apply the new 20250130_processing_queue.sql on the Supabase project, because the 001 migration was deleted; (3) test the GROK_MODEL default, since grok-4-1-fast is no longer listed by xAI. Once these are confirmed, squash-merge. |
What changed
Secrets and config
lib/core/config/env.dartreadsSUPABASE_URL/SUPABASE_ANON_KEYviaString.fromEnvironment. Debug builds assert with a clear message listing the missing defines; release builds log and run offline as before.Env.ensureConfigured()throws aStateErrorfor callers that want a hard failure.UserSettings.podcastFeedUrlderives fromEnv.supabaseUrlinstead of a hardcoded project URL.supabase/migrations/20260205_setup_daily_digest_cron.sqluses<SUPABASE_URL>/<SUPABASE_ANON_KEY>placeholders with a comment on substituting them or using Supabase Vault. No history rewrite; the old anon key remains in git history (public by design)..env.example(app defines only) andsupabase/functions/.env.example(Edge Function secrets and model ids). Kept them separate on purpose: everything in the app.envis compiled into the binary, so server-side keys must not go there..gitignoreun-ignores*.env.example.ios/ci_scripts/ci_post_clone.shnow requiresSUPABASE_URL/SUPABASE_ANON_KEYfrom the Xcode Cloud workflow environment and runsflutter build ios --config-only --release --no-codesign --dart-define=...afterflutter pub getsoGenerated.xcconfigcarriesDART_DEFINESinto the archive (fails fast if it does not).ios/scripts/validate_and_upload.shdoes the same from.envvia--dart-define-from-file. Neither script ranflutter build iosbefore; the archive step is unchanged.Model ids
supabase/functions/_shared/config.tsexposesCLAUDE_MODELandGROK_MODELfromDeno.envwith defaults;extract-articleandgenerate-digestuse them.anthropic/claude-haiku-4.5, confirmed againsthttps://openrouter.ai/api/v1/models(the previousanthropic/claude-3.5-haikuis no longer in OpenRouter's list, so the deployed functions were likely failing on analysis).grok-4-1-fast.https://docs.x.ai/docs/modelsno longer lists that id (current general models there:grok-4.6,grok-4.5,grok-4.3,grok-4.20; the only*-fastids aregrok-code-fast-*). I could not confirm which one supportsx_searchwithout an API key, so the default is unchanged and should be overridden withsupabase secrets set GROK_MODEL=...after a quick test.Dead files
jan29.md,UI_FIX_PLAN.md,ios/Flutter/Flutter 2.podspec,ios/Flutter/Generated 2.xcconfig,ios/Flutter/flutter_export_environment 2.sh(grep confirmedproject.pbxprojdoes not reference the" 2"names), andsupabase/functions/test-grok/.supabase/migrations/001_initial_schema.sql. Diff against20250129_initial_schema.sqlshowed 001 is NOT a subset: it alone definedprocessing_queue(whichprocess-queuereads and writes), theon_article_created -> queue_article_processingtrigger that feeds the queue, theon_auth_user_created -> handle_new_usertrigger that createsuser_settings,articles.error_message,update_article_status(), and aprocess-article-queuepg_cron entry with placeholder URLs. The still-used objects are preserved idempotently in a new20250130_processing_queue.sqlso a freshsupabase db pushyields a schema the functions can run against. The pg_cron entries from 001 were not carried over (the digest cron has its own migration; the per-minute queue cron was placeholder-only)..gitignorealready coveredios/Flutter/Generated.xcconfig,flutter_export_environment.shand.env.Deps
pubspec.lockwas gitignored; it is now tracked for reproducible CI and release builds.Tests and CI
test/with 27 unit tests: model JSON parsing/defaults/round-trips (Article, ArticleAnalysis, DailyDigest, PodcastEpisode, UserSettings),RestrictedDomainsprovider detection, andEnvbehaviour without defines..github/workflows/ci.yml: Flutter 3.27.3 (matchesci_post_clone.sh),pub get,analyze,test..github/dependabot.ymlfor pub and github-actions (no package.json in the repo, so no npm entry).Docs and naming
com.readwise.shareandsupabase/config.tomlproject_id, both non-user-facing and left alone.What was verified
flutter analyze(before, origin/main)flutter analyze(after)prefer_const_constructors; no new rules fire; nothing intest/)flutter testflutter pub get/flutter pub upgradedeno check supabase/functions/_shared/config.tsdeno checkon the three functionscatch (error)unknown-typing)deno lint supabase/functions/_shared/config.tssh -n/bash -non both iOS scriptsNot verified: an actual Xcode Cloud run or
flutter build ios(needs signing); runtime behaviour of just_audio 0.10 / audio_session 0.2 on device.What was skipped and why
deno lintreports 33 problems (22no-explicit-any, 8no-unused-vars, 2no-empty, 1prefer-const) anddeno check13 type errors on the existing functions, so a job would be red on day one.flutter analyze --no-fatal-warningsis passed in CI because of 7 pre-existing warnings (unused imports/fields/locals inarticle_detail_screen.dart,discover_card.dart,web_login_screen.dart).Follow-ups
SUPABASE_URLandSUPABASE_ANON_KEYon the Xcode Cloud workflow before the next cloud build, then confirmDART_DEFINESshows up in the post-clone log.GROK_MODELafter testingx_searchagainst a current xAI model id.--no-fatal-warningsfrom CI.catchblocks (error: unknown) sodeno checkpasses, then add a Deno job.generate-podcastandpodcast-feedfunctions and apodcast_episodestable plususer_settings.podcast_tokenthat are not in this repo (no migration or function source). Commit them or document where they live.supabase_flutterdeprecatesanonKeyin favour ofpublishableKey.