Skip to content

Conversation

@ShashwatXD
Copy link
Contributor

@ShashwatXD ShashwatXD commented Aug 28, 2025

Fixes #423

Describe the changes you have made in this PR -
Upgraded gradle wrapper to 8.7 and android gradle plugin to 8.6.0 along with the required upgrades.

temporary dependency_overrides:

-applied for build_runner and mockito

-Reason: current stable Dart (3.9) cannot resolve analyzer ≥6.9 which depends on macros from Dart 3.10+

-effect: keeps pub get working locally on Dart 3.9

NOTE: overrides are only a stopgap and can be removed once Flutter stable ships Dart 3.10+

Summary by CodeRabbit

  • New Features

    • Added Facebook login (sign-in and logout) and corresponding UI button.
  • Chores

    • Updated Android toolchain (SDK, Gradle, plugin versions) and build pipeline to embed Facebook app ID/name at build time.
    • Lowered iOS deployment target to 11.0.
    • Removed Windows desktop build/runner support and related artifacts.
    • CI/CD workflows adjusted for preview artifacts and test/build changes.

@coderabbitai
Copy link

coderabbitai bot commented Aug 28, 2025

Walkthrough

Adds Facebook OAuth support across app code and platform configs, injects FB_APP_ID/FB_APP_NAME as build-time dart-defines in CI/CD, upgrades Android Gradle/tooling, lowers iOS deployment target, modifies tests/utilities, and removes the entire Windows desktop build/runner and generated plugin registration.

Changes

Cohort / File(s) Summary of changes
Android build & Gradle
android/app/build.gradle, android/gradle/wrapper/gradle-wrapper.properties, android/settings.gradle
Bumped compileSdkVersion 35→36 and targetSdkVersion 33→34; replaced lintOptionslint; prepopulated and enhanced environmentVariables to parse --dart-define pairs and add FB keys; added resValue strings for FB IDs; Gradle wrapper → 8.7; AGP version → 8.6.0.
Android manifest (Facebook)
android/app/src/main/AndroidManifest.xml
Added Facebook metadata (com.facebook.sdk.ApplicationId), com.facebook.FacebookActivity, and com.facebook.CustomTabActivity with intent-filter using fb_login_protocol_scheme.
iOS project & plists
ios/Podfile, ios/Flutter/AppFrameworkInfo.plist, ios/Runner.xcodeproj/..., ios/Runner/Info.plist
Lowered iOS deployment target 12.0→11.0; reworked Pod/xcconfig and embed script phases in Xcode project; added Facebook URL scheme, FacebookAppID, FacebookDisplayName, FacebookClientToken, and LSApplicationQueriesSchemes in Info.plist.
CI / CD workflows
.github/workflows/ci.yml, .github/workflows/cd.yml
Injected FB_APP_ID/FB_APP_NAME env vars from secrets and passed as --dart-define to Flutter builds (Android/iOS/Windows); adjusted build matrices, artifact paths, preview APK flow, test randomization, and other workflow refinements.
Flutter deps & metadata
pubspec.yaml, .metadata
Added flutter_facebook_auth: ^6.0.4 (and related dependency overrides/changes); updated .metadata revision/channel values.
App compile-time config
lib/config/environment_config.dart
Added compile-time constants FB_APP_NAME and FB_APP_ID via String.fromEnvironment.
Auth enum & models
lib/enums/auth_type.dart, lib/models/cv_contributors.dart
Added AuthType.FACEBOOK and mapping; removed helper circuitVerseContributorsFromList(...).
Auth UI & viewmodels
lib/ui/views/authentication/components/auth_options_view.dart, lib/viewmodels/authentication/auth_options_viewmodel.dart, lib/viewmodels/cv_landing_viewmodel.dart
Added Facebook login button and facebookAuth flow, FB_OAUTH state key, persist AuthType.FACEBOOK, and call FacebookAuth.instance.logOut() on logout when applicable.
API & services
lib/services/API/contributors_api.dart
Use jsonEncode(_jsonResponse) with circuitVerseContributorsFromJson; added dart:convert import and generalized exception handling.
Tests & utils
test/ui_tests/groups/update_assignment_view_test.dart, test/utils_tests/image_test_utils.dart
Scoped mock registrations inside tests; simplified mocked HttpClient by removing many low-level stubs.
Windows platform removal
multiple windows/* files (see below)
Removed entire Windows desktop support: windows/CMakeLists.txt, windows/flutter/CMakeLists.txt, windows/flutter/generated_plugin_registrant.*, windows/flutter/generated_plugins.cmake, windows/runner/* (main, window, win32 wrapper, resources, RC, manifest, utils), and cleared windows/.gitignore. Many public targets, functions, classes, and install rules deleted.
Misc / other
various small edits
Minor formatting and build-script adjustments; keystore blocks preserved.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

Suggested reviewers

  • hardik17771
  • tachyons

Pre-merge checks (4 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The pull request contains significant out-of-scope changes beyond the AGP and Gradle upgrades specified in issue #423. While the core build system upgrades are appropriate, the PR includes extensive Facebook OAuth integration (new dependencies, Android manifest changes, iOS configuration, authentication viewmodels, UI components), complete removal of Windows platform support, iOS deployment target changes from 12.0 to 11.0, CI/CD workflow modifications to include Facebook credentials, and various other unrelated changes like test randomization and contributor API refactoring. These substantial additions and modifications extend far beyond the scope of simply upgrading build tool versions to remove warnings and maintain compatibility. The PR should be split into separate focused pull requests: one for the AGP/Gradle upgrades as originally intended, and separate PRs for Facebook OAuth integration, Windows platform removal, iOS deployment target changes, and other unrelated modifications. This would make the changes easier to review, test, and maintain, while ensuring each PR has a clear, focused objective that aligns with its linked issues.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "build(android): upgrade AGP to 8.6.0, Gradle to 8.7 and raise minSdk to 23" accurately describes the main changes in the pull request. The changeset shows upgrades to the Android Gradle Plugin from 8.2.1 to 8.6.0 in settings.gradle, Gradle wrapper from 8.5 to 8.7 in gradle-wrapper.properties, and various SDK version updates including compileSdkVersion from 35 to 36 and targetSdkVersion from 33 to 34. While the title mentions raising minSdk to 23, the actual changes show targetSdk being raised to 34, but the core intent of upgrading build tools is clearly conveyed and matches the primary objective.
Linked Issues Check ✅ Passed The code changes successfully address the primary objectives from linked issue #423. The PR upgrades the Android Gradle Plugin from version 8.2.1 to 8.6.0 in android/settings.gradle and updates the Gradle wrapper from 8.5 to 8.7 in android/gradle/wrapper/gradle-wrapper.properties, directly fulfilling the requirement to update project build configuration files to newer versions. These changes remove build warnings and prevent future compatibility issues as requested. Additionally, the PR updates various SDK versions (compileSdkVersion from 35 to 36, targetSdkVersion from 33 to 34) and includes dependency overrides to maintain build stability during the transition.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
android/gradle/wrapper/gradle-wrapper.properties (1)

6-6: AGP 8.6.0 ⇄ Gradle 8.7 pairing looks right; consider switching to -bin.zip.

Functionally OK. If you don’t need sources/javadoc in CI, prefer the smaller distribution to speed up downloads.

Apply if desired:

-distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
pubspec.yaml (1)

81-82: Document temporary overrides; plan removal when Dart ≥ 3.10 lands in Flutter stable.

Add context so future maintainers know why these pins exist and when to remove them.

 dependency_overrides:
-  build_runner: ^2.4.13
+  # TEMP: Keep analyzer < 6.9 due to Dart 3.9 (no macros). Remove when Flutter stable ships Dart ≥ 3.10.
+  build_runner: ^2.4.13
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fbe4595 and 94826a1.

⛔ Files ignored due to path filters (1)
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .gitignore (1 hunks)
  • android/app/build.gradle (2 hunks)
  • android/gradle/wrapper/gradle-wrapper.properties (1 hunks)
  • android/settings.gradle (1 hunks)
  • pubspec.yaml (3 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
pubspec.yaml

[error] 75-75: trailing spaces

(trailing-spaces)


[error] 114-114: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (6)
.gitignore (1)

24-24: Ignoring .vscode is fine; proceed.

Good call to keep editor-specific settings out of VCS.

android/settings.gradle (1)

21-21: No changes needed: Kotlin Gradle Plugin 2.1.10 is officially supported by AGP 8.6.0.

pubspec.yaml (1)

63-63: No production imports of mockito detected; safe to move to dev_dependencies

android/app/build.gradle (3)

74-76: Lint DSL migration looks correct.

lintOptions → lint with same rules is AGP 8.x-compatible.


80-82: Ensure minSdkVersion ≥ 23
Double-check that flutter.minSdkVersion resolves to at least 23 and satisfies any plugin requirements; if it resolves below 23, explicitly set minSdkVersion = 23 to avoid runtime failures.


58-58: Verify Android API level 36 availability on CI
sdkmanager wasn’t found during automated checks; manually confirm that API 36 is installed on your CI image. If it isn’t, revert compileSdkVersion to 35 until SDK 36 is generally available.
Location: android/app/build.gradle:58

transparent_image: ^2.0.0
url_launcher: ^6.3.2
flutter_facebook_auth: ^6.0.4
mockito: ^5.4.5
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Move mockito to dev_dependencies and drop the override or align versions.

Mockito is test-only; keeping it under dependencies bloats the runtime graph and conflicts with the override (5.4.4 vs ^5.4.5).

Apply:

   flutter_facebook_auth: ^6.0.4
-  mockito: ^5.4.5
+
@@
 dev_dependencies:
   build_runner: ^2.5.4
   flutter_lints: ^6.0.0
   flutter_test:
     sdk: flutter
   hive_generator: ^2.0.0
+  mockito: ^5.4.4
@@
 dependency_overrides:
   build_runner: ^2.4.13
-  mockito: 5.4.4
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
mockito: ^5.4.5
flutter_facebook_auth: ^6.0.4
dev_dependencies:
build_runner: ^2.5.4
flutter_lints: ^6.0.0
flutter_test:
sdk: flutter
hive_generator: ^2.0.0
mockito: ^5.4.4
dependency_overrides:
build_runner: ^2.4.13
🤖 Prompt for AI Agents
In pubspec.yaml around line 63, mockito is listed under dependencies with
version ^5.4.5 while an override pins 5.4.4; move mockito from dependencies into
dev_dependencies (since it is test-only) and either remove the
dependency_override for mockito or update it to match ^5.4.5 so the versions
align; ensure pubspec.yaml has no runtime dependency on mockito and that the
dev_dependencies entry uses the intended version constraint.

- asset: assets/fonts/Poppins/Poppins-Regular.ttf
- asset: assets/fonts/Poppins/Poppins-Italic.ttf
style: italic
style: italic No newline at end of file
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add newline at EOF to satisfy linters.

-          style: italic
+          style: italic
+
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
style: italic
style: italic
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 114-114: no new line character at the end of file

(new-line-at-end-of-file)

🤖 Prompt for AI Agents
In pubspec.yaml around line 114, the file currently ends with "style: italic"
and lacks a trailing newline which fails linters; open the file and add a single
newline character at EOF so the file ends with a blank line after "style:
italic", save and re-run linters.

@ShashwatXD ShashwatXD changed the title Build upgrade agp build(android): upgrade AGP to 8.6.0, Gradle to 8.7 and raise minSdk to 23 Aug 30, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 12

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.github/workflows/cd.yml (1)

223-246: Quote dart-define values (spaces/special chars) and fail fast on unset secrets.

Unquoted values can split; add set -euo pipefail and quote FB defines.

       run: |
+        set -euo pipefail
         # Get version code from run number
         VERSION_CODE=${{ github.run_number }}
@@
-          flutter build appbundle --release \
+          flutter build appbundle --release \
             --build-name=${{ env.VERSION }} \
             --build-number=$VERSION_CODE \
-            --dart-define=FB_APP_ID=$FB_APP_ID \
-            --dart-define=FB_APP_NAME=$FB_APP_NAME \
+            --dart-define=FB_APP_ID="$FB_APP_ID" \
+            --dart-define=FB_APP_NAME="$FB_APP_NAME" \
             --dart-define=GITHUB_OAUTH_CLIENT_ID=$GH_OAUTH_CLIENT_ID \
             --dart-define=GITHUB_OAUTH_CLIENT_SECRET=$GH_OAUTH_CLIENT_SECRET
@@
-          flutter build apk --release \
+          flutter build apk --release \
             --build-name=${{ env.VERSION }} \
             --build-number=$VERSION_CODE \
-            --dart-define=FB_APP_ID=$FB_APP_ID \
-            --dart-define=FB_APP_NAME=$FB_APP_NAME \
+            --dart-define=FB_APP_ID="$FB_APP_ID" \
+            --dart-define=FB_APP_NAME="$FB_APP_NAME" \
             --dart-define=GITHUB_OAUTH_CLIENT_ID=$GH_OAUTH_CLIENT_ID \
             --dart-define=GITHUB_OAUTH_CLIENT_SECRET=$GH_OAUTH_CLIENT_SECRET
lib/viewmodels/cv_landing_viewmodel.dart (1)

99-107: Await logout to complete before UI updates.

onLogout() is async but isn’t awaited in onLogoutPressed, leading to racy state/snackbar. Change onLogout() to return Future<void> and await it here.

Apply:

-      onLogout();
+      await onLogout();
♻️ Duplicate comments (3)
pubspec.yaml (3)

75-75: Remove trailing whitespace.

-  
+

114-114: Add newline at end of file.

-          style: italic
+          style: italic
+

62-63: Move mockito to dev_dependencies.

Mockito is a testing library and should be in dev_dependencies rather than regular dependencies. This also creates a version conflict with the override at line 82.

Apply this fix:

  url_launcher: ^6.3.2
  flutter_facebook_auth: ^6.0.4
-  mockito: ^5.4.5

  http: any

Then add to dev_dependencies section:

  flutter_test:
    sdk: flutter
  hive_generator: ^2.0.0
+  mockito: ^5.4.4
🧹 Nitpick comments (15)
android/gradle/wrapper/gradle-wrapper.properties (1)

6-6: Optional: add distributionSha256Sum for supply-chain hardening.

Regenerate the wrapper (./gradlew wrapper --gradle-version 8.7 --distribution-type all) to populate distributionSha256Sum.

.github/workflows/cd.yml (1)

239-239: Trim trailing whitespace.

yaml-lint flagged trailing spaces on this line.

ios/Runner/Info.plist (1)

57-57: Ensure FACEBOOK_CLIENT_TOKEN is defined or remove the key.

If $(FACEBOOK_CLIENT_TOKEN) isn’t set, the app may ship with a literal or empty token.

lib/enums/auth_type.dart (1)

3-9: Adding enum value mid-list can break persisted ordinals; verify storage and consider appending instead.

If AuthType is ever persisted/serialized by index, inserting FACEBOOK between existing values can mis-map older data. If you’re storing string names via authTypeValues you’re fine; otherwise, append the new value to the end or migrate persisted data.

Possible safer reordering:

-enum AuthType { EMAIL, FACEBOOK, GOOGLE, GITHUB }
+enum AuthType { EMAIL, GOOGLE, GITHUB, FACEBOOK }
lib/viewmodels/cv_landing_viewmodel.dart (2)

46-49: Comment nit: double period.

Apply:

-    // Perform facebook logout if auth type is facebook..
+    // Perform Facebook logout if auth type is facebook.

41-57: Change onLogout signature to Future and capture authType before clearing storage.

Capture the original authType in a local variable, then clear isLoggedIn, currentUser, and token, and branch on that saved value for provider-specific logout. Marking the method as Future<void> aligns with async best practices. Optionally, clear authType after sign-out to avoid stale state.

lib/config/environment_config.dart (1)

31-34: Provide defaults to avoid hard compile-time requirement for dart-defines in local/test builds.

Without defaultValue, some toolchains fail when the define is absent. Match existing pattern if intentional; otherwise add empty defaults.

Apply:

-  static const String FB_APP_NAME = String.fromEnvironment('FB_APP_NAME');
-  static const String FB_APP_ID = String.fromEnvironment('FB_APP_ID');
+  static const String FB_APP_NAME =
+      String.fromEnvironment('FB_APP_NAME', defaultValue: '');
+  static const String FB_APP_ID =
+      String.fromEnvironment('FB_APP_ID', defaultValue: '');

Ensure CI/test workflows pass these via --dart-define or rely on these defaults.

test/ui_tests/groups/update_assignment_view_test.dart (2)

118-131: Prefer final for mocks and keep registrations concise.

Apply:

-      var dialogService = MockDialogService();
+      final dialogService = MockDialogService();
       locator.registerSingleton<DialogService>(dialogService);
@@
-      var updateAssignmentViewModel = MockUpdateAssignmentViewModel();
+      final updateAssignmentViewModel = MockUpdateAssignmentViewModel();
       locator.registerSingleton<UpdateAssignmentViewModel>(
         updateAssignmentViewModel,
       );

154-165: Simulate real tap and avoid fixed 5s wait.

Use tester.tap and pumpAndSettle to reduce flakiness and speed up tests.

Apply:

-      Widget widget = buttonFinder.evaluate().first.widget;
-      (widget as CVPrimaryButton).onPressed!();
-      await tester.pumpAndSettle();
-      await tester.pump(const Duration(seconds: 5));
+      await tester.tap(buttonFinder);
+      await tester.pumpAndSettle();
lib/services/API/contributors_api.dart (1)

20-27: Maintain compatibility with both list and wrapped payloads; avoid needless encode/decode if possible.

Current code assumes a top-level list and does a JSON round-trip. Prefer handling both shapes explicitly; optionally reintroduce a fromList converter to parse without stringify.

Apply:

-      return circuitVerseContributorsFromJson(jsonEncode(_jsonResponse));
+      final res = _jsonResponse;
+      if (res is List) {
+        return circuitVerseContributorsFromJson(jsonEncode(res));
+      } else if (res is Map && res['contributors'] is List) {
+        return circuitVerseContributorsFromJson(jsonEncode(res['contributors']));
+      } else {
+        throw Failure(Constants.BAD_RESPONSE_FORMAT);
+      }

Optional further improvement (model-level): add a circuitVerseContributorsFromList(List<dynamic>) to avoid jsonEncode + parse.

Also, confirm ApiUtils.get sets a GitHub-compatible User-Agent; if not, add one to headers to prevent 403s.

lib/viewmodels/authentication/auth_options_viewmodel.dart (1)

35-35: Add null safety check for access token.

While the code uses the non-null assertion operator (!), it would be safer to explicitly handle the case where the access token might be null.

-            _storage.token = await _userApi.oauthSignup(
-              accessToken: result.accessToken!.token,
-              provider: 'facebook',
-            );
+            final accessToken = result.accessToken?.token;
+            if (accessToken == null) {
+              throw Failure('Facebook access token is null');
+            }
+            _storage.token = await _userApi.oauthSignup(
+              accessToken: accessToken,
+              provider: 'facebook',
+            );
.github/workflows/ci.yml (2)

104-104: Confirm macOS runner pinning for iOS builds

macos-latest can jump Xcode versions unexpectedly. If you rely on a specific Xcode, pin the image; otherwise keep latest.

Optional pin:

-          - platform: macos-latest
+          - platform: macos-14

171-171: Trim trailing spaces flagged by linters

Lines 171, 213, 214, and 218 have trailing spaces. Please remove to satisfy YAMLlint.

Also applies to: 213-214, 218-218

.metadata (1)

16-20: Windows platform entry removed; web added — was this intentional?

Workflows still build Windows. If Windows support is still desired, confirm this .metadata change won’t affect future flutter migrate operations.

ios/Runner.xcodeproj/project.pbxproj (1)

394-394: iOS deployment target lowered to 11.0 — recheck pod/App Store requirements

Many modern SDKs require iOS 12+ or 13+. Confirm Cocoapods resolve cleanly and that your distribution target satisfies App Store policy.

If needed, bump:

-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 13.0;

Also applies to: 480-480, 530-530

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1b182bc and 5f12281.

⛔ Files ignored due to path filters (3)
  • ios/Podfile.lock is excluded by !**/*.lock
  • pubspec.lock is excluded by !**/*.lock
  • windows/runner/resources/app_icon.ico is excluded by !**/*.ico
📒 Files selected for processing (38)
  • .github/workflows/cd.yml (2 hunks)
  • .github/workflows/ci.yml (4 hunks)
  • .metadata (1 hunks)
  • android/app/build.gradle (5 hunks)
  • android/app/src/main/AndroidManifest.xml (1 hunks)
  • android/gradle/wrapper/gradle-wrapper.properties (1 hunks)
  • android/settings.gradle (1 hunks)
  • ios/Flutter/AppFrameworkInfo.plist (1 hunks)
  • ios/Podfile (1 hunks)
  • ios/Runner.xcodeproj/project.pbxproj (11 hunks)
  • ios/Runner/Info.plist (2 hunks)
  • lib/config/environment_config.dart (1 hunks)
  • lib/enums/auth_type.dart (1 hunks)
  • lib/models/cv_contributors.dart (0 hunks)
  • lib/services/API/contributors_api.dart (2 hunks)
  • lib/ui/views/authentication/components/auth_options_view.dart (2 hunks)
  • lib/viewmodels/authentication/auth_options_viewmodel.dart (2 hunks)
  • lib/viewmodels/cv_landing_viewmodel.dart (2 hunks)
  • pubspec.yaml (4 hunks)
  • test/ui_tests/groups/update_assignment_view_test.dart (2 hunks)
  • test/utils_tests/image_test_utils.dart (0 hunks)
  • windows/.gitignore (0 hunks)
  • windows/CMakeLists.txt (0 hunks)
  • windows/flutter/CMakeLists.txt (0 hunks)
  • windows/flutter/generated_plugin_registrant.cc (0 hunks)
  • windows/flutter/generated_plugin_registrant.h (0 hunks)
  • windows/flutter/generated_plugins.cmake (0 hunks)
  • windows/runner/CMakeLists.txt (0 hunks)
  • windows/runner/Runner.rc (0 hunks)
  • windows/runner/flutter_window.cpp (0 hunks)
  • windows/runner/flutter_window.h (0 hunks)
  • windows/runner/main.cpp (0 hunks)
  • windows/runner/resource.h (0 hunks)
  • windows/runner/runner.exe.manifest (0 hunks)
  • windows/runner/utils.cpp (0 hunks)
  • windows/runner/utils.h (0 hunks)
  • windows/runner/win32_window.cpp (0 hunks)
  • windows/runner/win32_window.h (0 hunks)
💤 Files with no reviewable changes (19)
  • test/utils_tests/image_test_utils.dart
  • windows/flutter/generated_plugin_registrant.h
  • windows/.gitignore
  • windows/runner/resource.h
  • windows/runner/runner.exe.manifest
  • windows/runner/utils.h
  • lib/models/cv_contributors.dart
  • windows/runner/win32_window.h
  • windows/runner/flutter_window.h
  • windows/flutter/generated_plugins.cmake
  • windows/runner/CMakeLists.txt
  • windows/runner/main.cpp
  • windows/runner/utils.cpp
  • windows/flutter/CMakeLists.txt
  • windows/flutter/generated_plugin_registrant.cc
  • windows/runner/Runner.rc
  • windows/runner/flutter_window.cpp
  • windows/CMakeLists.txt
  • windows/runner/win32_window.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • android/settings.gradle
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-06-17T13:11:01.586Z
Learnt from: JatsuAkaYashvant
PR: CircuitVerse/mobile-app#381
File: test/ui_tests/groups/my_groups_view_test.dart:136-148
Timestamp: 2025-06-17T13:11:01.586Z
Learning: When mocking async methods in Flutter/Dart tests, always use `thenAnswer((_) async {})` or `thenAnswer((_) => Future.value())` instead of `thenReturn(null)` to maintain the async contract and prevent runtime errors when production code awaits the result.

Applied to files:

  • test/ui_tests/groups/update_assignment_view_test.dart
🪛 YAMLlint (1.37.1)
.github/workflows/cd.yml

[error] 239-239: trailing spaces

(trailing-spaces)

.github/workflows/ci.yml

[error] 171-171: trailing spaces

(trailing-spaces)


[error] 213-213: trailing spaces

(trailing-spaces)


[error] 214-214: trailing spaces

(trailing-spaces)


[error] 218-218: trailing spaces

(trailing-spaces)

pubspec.yaml

[error] 75-75: trailing spaces

(trailing-spaces)


[error] 114-114: no new line character at the end of file

(new-line-at-end-of-file)

🪛 actionlint (1.7.7)
.github/workflows/ci.yml

222-222: input "github-token" is not defined in action "softprops/action-gh-release@v2". available inputs are "append_body", "body", "body_path", "discussion_category_name", "draft", "fail_on_unmatched_files", "files", "generate_release_notes", "make_latest", "name", "prerelease", "preserve_order", "repository", "tag_name", "target_commitish", "token"

(action)


223-223: input "parallel-finished" is not defined in action "softprops/action-gh-release@v2". available inputs are "append_body", "body", "body_path", "discussion_category_name", "draft", "fail_on_unmatched_files", "files", "generate_release_notes", "make_latest", "name", "prerelease", "preserve_order", "repository", "tag_name", "target_commitish", "token"

(action)

🔇 Additional comments (20)
android/gradle/wrapper/gradle-wrapper.properties (1)

6-6: LGTM: Gradle 8.7 matches AGP 8.6.0 requirements.

test/ui_tests/groups/update_assignment_view_test.dart (1)

124-124: Confirm popDialog’s return type; use thenAnswer for async methods.

If popDialog() returns Future<void>, mock with thenAnswer((_) async {}) to preserve async contract (see prior learning).

Apply if async:

-      when(dialogService.popDialog()).thenReturn(null);
+      when(dialogService.popDialog()).thenAnswer((_) async {});
lib/viewmodels/authentication/auth_options_viewmodel.dart (1)

24-70: LGTM! Well-structured Facebook OAuth implementation.

The Facebook authentication flow follows the same pattern as the existing Google and GitHub auth methods, with proper error handling and state management.

lib/ui/views/authentication/components/auth_options_view.dart (2)

34-45: Facebook auth UI implementation looks good.

The Facebook authentication UI follows the same pattern as Google and GitHub, maintaining consistency in the codebase.


97-97: Resolved: Facebook icon asset exists
Asset assets/icons/facebook_icon.png verified present; no changes required.

android/app/build.gradle (4)

26-38: Environment variables implementation looks good.

The implementation for handling dart-defines and Facebook configuration is well-structured. The URL decoding and map conversion properly handles the CI/CD environment variables.


85-87: CI/CD workflows include FB_APP_ID and FB_APP_NAME via secrets and --dart-define; no action required.


80-81: Verify and document the source of flutter.minSdkVersion
The minSdkVersion flutter.minSdkVersion value is injected by the Flutter Gradle plugin (see flutter.gradle in your local Flutter SDK under packages/flutter_tools/gradle/). Please confirm the default integer (typically 16) and add a note in your project’s docs or above this line in android/app/build.gradle so it’s clear where the minimum SDK is coming from.


58-58: Confirm compileSdkVersion 36 compatibility

  • Android Gradle Plugin 8.6.0 (android/settings.gradle) and Gradle wrapper 8.7 (android/gradle/wrapper/gradle-wrapper.properties) must support API 36.
  • Ensure Android SDK Platform 36 is installed on all CI and local machines.
  • No warnings from ./gradlew dependencies, but run full CI builds and integration tests to catch any runtime or API issues.
android/app/src/main/AndroidManifest.xml (3)

81-99: Facebook configuration added correctly.

The Facebook SDK integration in the manifest is properly configured with the required metadata and activities.


86-92: Activities are correctly exported.

The Facebook activities are properly marked with android:exported="true" as required for Android 12+ (API 31+).


84-89: Ensure compileSdkVersion ≥ 34 for flutter_facebook_auth 6.0.4
flutter_facebook_auth 6.0.4 bundles Facebook Android SDK 16.3.0, which supports API 34+. Confirm your android/compileSdkVersion is set to 34 or higher (e.g., 36) and that your Android Gradle Plugin version is compatible. If you hit any compile-time dependency errors, upgrade to a newer flutter_facebook_auth release or adjust your compileSdk/AGP accordingly.

.github/workflows/ci.yml (3)

85-86: Good hardening: randomized test order with coverage

This helps surface hidden test inter-dependencies. No action needed.


228-228: Preview job depends only on tests — sensible

Keeps preview fast while still guarded by test pass. Looks good.


279-285: Preview artifact handling is clear and scoped

Short retention with explicit naming is good hygiene. No changes needed.

.metadata (1)

7-8: Flutter channel/revision bumped to stable

Looks fine; just ensure CI runners use the same stable toolchain to avoid “doctor” mismatches.

ios/Runner.xcodeproj/project.pbxproj (4)

16-16: Pods_Runner.framework reference updates look consistent

References and build phase wiring align. No action needed.

Also applies to: 57-58, 127-134


208-221: Flutter “Thin Binary” phase uses embed_and_thin — OK

Matches the typical Flutter iOS setup. No changes needed.


222-235: Flutter build phase script is correct

Invoking xcode_backend.sh build in the main run script is expected. Good.


264-287: Heavy [CP] Embed Pods Frameworks list — verify iOS minimum target compatibility

Given these pods (e.g., Facebook SDK) often require iOS ≥ 12 or 13, double-check they support IPHONEOS_DEPLOYMENT_TARGET below.

Also applies to: 289-317

Comment on lines +160 to 169
FB_APP_ID: ${{ secrets.FB_APP_ID }}
FB_APP_NAME: ${{ secrets.FB_APP_NAME }}
GH_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }}
GH_OAUTH_CLIENT_SECRET: ${{ secrets.GH_OAUTH_CLIENT_SECRET }}
run: |
flutter build apk --debug \
--dart-define=FB_APP_ID=$FB_APP_ID \
--dart-define=FB_APP_NAME=$FB_APP_NAME \
--dart-define=GITHUB_OAUTH_CLIENT_ID=$GH_OAUTH_CLIENT_ID \
--dart-define=GITHUB_OAUTH_CLIENT_SECRET=$GH_OAUTH_CLIENT_SECRET
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Quote dart-define values to handle spaces (Android)

FB_APP_NAME can contain spaces; unquoted expansion will break argument parsing.

Apply:

           flutter build apk --debug \
-            --dart-define=FB_APP_ID=$FB_APP_ID \
-            --dart-define=FB_APP_NAME=$FB_APP_NAME \
+            --dart-define=FB_APP_ID="$FB_APP_ID" \
+            --dart-define=FB_APP_NAME="$FB_APP_NAME" \
             --dart-define=GITHUB_OAUTH_CLIENT_ID=$GH_OAUTH_CLIENT_ID \
             --dart-define=GITHUB_OAUTH_CLIENT_SECRET=$GH_OAUTH_CLIENT_SECRET
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
FB_APP_ID: ${{ secrets.FB_APP_ID }}
FB_APP_NAME: ${{ secrets.FB_APP_NAME }}
GH_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }}
GH_OAUTH_CLIENT_SECRET: ${{ secrets.GH_OAUTH_CLIENT_SECRET }}
run: |
flutter build apk --debug \
--dart-define=FB_APP_ID=$FB_APP_ID \
--dart-define=FB_APP_NAME=$FB_APP_NAME \
--dart-define=GITHUB_OAUTH_CLIENT_ID=$GH_OAUTH_CLIENT_ID \
--dart-define=GITHUB_OAUTH_CLIENT_SECRET=$GH_OAUTH_CLIENT_SECRET
run: |
flutter build apk --debug \
--dart-define=FB_APP_ID="$FB_APP_ID" \
--dart-define=FB_APP_NAME="$FB_APP_NAME" \
--dart-define=GITHUB_OAUTH_CLIENT_ID=$GH_OAUTH_CLIENT_ID \
--dart-define=GITHUB_OAUTH_CLIENT_SECRET=$GH_OAUTH_CLIENT_SECRET
🤖 Prompt for AI Agents
In .github/workflows/ci.yml around lines 160 to 169, the --dart-define
expansions are unquoted so values containing spaces (e.g., FB_APP_NAME) will be
split into separate arguments; update the flutter build command to quote the
expanded env vars (for example --dart-define=FB_APP_NAME="$FB_APP_NAME") — apply
quoting consistently to all --dart-define entries and ensure any embedded quotes
are escaped so the shell passes each value as a single argument.

Comment on lines +171 to 185
# iOS Build Validation
- name: Build iOS Debug (No Code Signing)
if: matrix.build-type == 'ios'
env:
FB_APP_ID: ${{ secrets.FB_APP_ID }}
FB_APP_NAME: ${{ secrets.FB_APP_NAME }}
GH_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }}
GH_OAUTH_CLIENT_SECRET: ${{ secrets.GH_OAUTH_CLIENT_SECRET }}
run: |
flutter build ios --debug --no-codesign --simulator \
cd ios && pod install && cd ..
flutter build ios --debug --no-codesign \
--dart-define=FB_APP_ID=$FB_APP_ID \
--dart-define=FB_APP_NAME=$FB_APP_NAME \
--dart-define=GITHUB_OAUTH_CLIENT_ID=$GH_OAUTH_CLIENT_ID \
--dart-define=GITHUB_OAUTH_CLIENT_SECRET=$GH_OAUTH_CLIENT_SECRET
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

iOS: trim trailing spaces and quote dart-define values

  • Line 171 has trailing spaces; please trim.
  • Quote dart-define values to avoid breaking when names include spaces.
-      # iOS Build Validation  
+      # iOS Build Validation
...
-          flutter build ios --debug --no-codesign \
-            --dart-define=FB_APP_ID=$FB_APP_ID \
-            --dart-define=FB_APP_NAME=$FB_APP_NAME \
+          flutter build ios --debug --no-codesign \
+            --dart-define=FB_APP_ID="$FB_APP_ID" \
+            --dart-define=FB_APP_NAME="$FB_APP_NAME" \
             --dart-define=GITHUB_OAUTH_CLIENT_ID=$GH_OAUTH_CLIENT_ID \
             --dart-define=GITHUB_OAUTH_CLIENT_SECRET=$GH_OAUTH_CLIENT_SECRET
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# iOS Build Validation
- name: Build iOS Debug (No Code Signing)
if: matrix.build-type == 'ios'
env:
FB_APP_ID: ${{ secrets.FB_APP_ID }}
FB_APP_NAME: ${{ secrets.FB_APP_NAME }}
GH_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }}
GH_OAUTH_CLIENT_SECRET: ${{ secrets.GH_OAUTH_CLIENT_SECRET }}
run: |
flutter build ios --debug --no-codesign --simulator \
cd ios && pod install && cd ..
flutter build ios --debug --no-codesign \
--dart-define=FB_APP_ID=$FB_APP_ID \
--dart-define=FB_APP_NAME=$FB_APP_NAME \
--dart-define=GITHUB_OAUTH_CLIENT_ID=$GH_OAUTH_CLIENT_ID \
--dart-define=GITHUB_OAUTH_CLIENT_SECRET=$GH_OAUTH_CLIENT_SECRET
# iOS Build Validation
- name: Build iOS Debug (No Code Signing)
if: matrix.build-type == 'ios'
env:
FB_APP_ID: ${{ secrets.FB_APP_ID }}
FB_APP_NAME: ${{ secrets.FB_APP_NAME }}
GH_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }}
GH_OAUTH_CLIENT_SECRET: ${{ secrets.GH_OAUTH_CLIENT_SECRET }}
run: |
cd ios && pod install && cd ..
flutter build ios --debug --no-codesign \
--dart-define=FB_APP_ID="$FB_APP_ID" \
--dart-define=FB_APP_NAME="$FB_APP_NAME" \
--dart-define=GITHUB_OAUTH_CLIENT_ID=$GH_OAUTH_CLIENT_ID \
--dart-define=GITHUB_OAUTH_CLIENT_SECRET=$GH_OAUTH_CLIENT_SECRET
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 171-171: trailing spaces

(trailing-spaces)

🤖 Prompt for AI Agents
.github/workflows/ci.yml around lines 171 to 185: line 171 contains trailing
spaces that should be removed, and the --dart-define values passed to flutter
build ios need to be wrapped in quotes so values containing spaces are
preserved; remove the trailing whitespace on the "Build iOS Debug (No Code
Signing)" step line and change each --dart-define assignment to use quoted
values (e.g., --dart-define=FB_APP_ID="..." etc.), ensuring secrets are still
referenced via the environment variables.

Comment on lines +191 to +200
FB_APP_ID: ${{ secrets.FB_APP_ID }}
FB_APP_NAME: ${{ secrets.FB_APP_NAME }}
GH_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }}
GH_OAUTH_CLIENT_SECRET: ${{ secrets.GH_OAUTH_CLIENT_SECRET }}
run: flutter build windows --debug --dart-define=GITHUB_OAUTH_CLIENT_ID=$env:GH_OAUTH_CLIENT_ID --dart-define=GITHUB_OAUTH_CLIENT_SECRET=$env:GH_OAUTH_CLIENT_SECRET
run: |
flutter build windows --debug \
--dart-define=FB_APP_ID=$FB_APP_ID \
--dart-define=FB_APP_NAME=$FB_APP_NAME \
--dart-define=GITHUB_OAUTH_CLIENT_ID=$GH_OAUTH_CLIENT_ID \
--dart-define=GITHUB_OAUTH_CLIENT_SECRET=$GH_OAUTH_CLIENT_SECRET
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Windows step will fail: uses Bash syntax on PowerShell

On windows-latest, default shell is pwsh. Backslashes for line continuation and $VAR expansions won’t work.

Two viable fixes; pick one:

Option A (use Bash):

       - name: Build Windows Debug
         if: matrix.build-type == 'windows'
         env:
           FB_APP_ID: ${{ secrets.FB_APP_ID }}
           FB_APP_NAME: ${{ secrets.FB_APP_NAME }}
           GH_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }}
           GH_OAUTH_CLIENT_SECRET: ${{ secrets.GH_OAUTH_CLIENT_SECRET }}
+        shell: bash
         run: |
           flutter build windows --debug \
-            --dart-define=FB_APP_ID=$FB_APP_ID \
-            --dart-define=FB_APP_NAME=$FB_APP_NAME \
-            --dart-define=GITHUB_OAUTH_CLIENT_ID=$GH_OAUTH_CLIENT_ID \
-            --dart-define=GITHUB_OAUTH_CLIENT_SECRET=$GH_OAUTH_CLIENT_SECRET
+            --dart-define=FB_APP_ID="$FB_APP_ID" \
+            --dart-define=FB_APP_NAME="$FB_APP_NAME" \
+            --dart-define=GITHUB_OAUTH_CLIENT_ID="$GH_OAUTH_CLIENT_ID" \
+            --dart-define=GITHUB_OAUTH_CLIENT_SECRET="$GH_OAUTH_CLIENT_SECRET"

Option B (keep pwsh):

-        run: |
-          flutter build windows --debug \
-            --dart-define=FB_APP_ID=$FB_APP_ID \
-            --dart-define=FB_APP_NAME=$FB_APP_NAME \
-            --dart-define=GITHUB_OAUTH_CLIENT_ID=$GH_OAUTH_CLIENT_ID \
-            --dart-define=GITHUB_OAUTH_CLIENT_SECRET=$GH_OAUTH_CLIENT_SECRET
+        shell: pwsh
+        run: >
+          flutter build windows --debug
+          --dart-define=FB_APP_ID="$env:FB_APP_ID"
+          --dart-define=FB_APP_NAME="$env:FB_APP_NAME"
+          --dart-define=GITHUB_OAUTH_CLIENT_ID="$env:GH_OAUTH_CLIENT_ID"
+          --dart-define=GITHUB_OAUTH_CLIENT_SECRET="$env:GH_OAUTH_CLIENT_SECRET"
🤖 Prompt for AI Agents
.github/workflows/ci.yml lines 191-200: the Windows step uses Bash
line-continuation and $VAR expansion but the runner default shell on
windows-latest is PowerShell, so the step will fail; either set the step to use
Bash (e.g., add a shell: bash directive so existing backslash continuations and
$VAR expansions work) or keep PowerShell and convert the script to valid pwsh
syntax (use PowerShell line-continuation or single-line commands and reference
environment variables as $env:FB_APP_ID, $env:FB_APP_NAME,
$env:GH_OAUTH_CLIENT_ID, $env:GH_OAUTH_CLIENT_SECRET and wrap each --dart-define
value appropriately).

Comment on lines 202 to 224
coverage-finish:
name: Finalize Coverage
needs: [test, build-validation]
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Finalize Coveralls Reporting
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
coverage-reporter-version: v0.6.15
fail-on-error: false

- name: Download APK Artifact
uses: actions/download-artifact@v5
with:
name: android-apk
path: build/app/outputs/flutter-apk/
name: android-apk-${{ github.run_number }}
path: build/app/outputs/apk/release/

- name: Get Current Date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: Checkout Repository (for tagging)
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.sha }}

- name: Create Release Tag
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git tag -a v${{ github.run_number }} -m "Release v${{ github.run_number }}"
git push origin v${{ github.run_number }}


- name: Create Release
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: v${{ github.run_number }}
files: build/app/outputs/flutter-apk/app-debug.apk
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Coveralls finalize and release step misconfig; APK download is orphaned

  • parallel-finished belongs to Coveralls finalize, not softprops/action-gh-release.
  • softprops expects token (not github-token).
  • “Download APK Artifact” fails: no step produces android-apk-${{ github.run_number }} in this workflow.

Fix and simplify:

   coverage-finish:
     name: Finalize Coverage
     needs: test
     runs-on: ubuntu-latest
     steps:
       - name: Finalize Coveralls Reporting
         uses: coverallsapp/github-action@v2
+        with:
+          github-token: ${{ secrets.GITHUB_TOKEN }}
+          parallel-finished: true
-      - name: Download APK Artifact
-        uses: actions/download-artifact@v5
-        with:
-          name: android-apk-${{ github.run_number }}
-          path: build/app/outputs/apk/release/  
-          
       - name: Get Current Date
         id: date
         run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
-        
       - name: Create Release
         uses: softprops/action-gh-release@v2
         with:
-          github-token: ${{ secrets.GITHUB_TOKEN }}
-          parallel-finished: true
+          token: ${{ secrets.GITHUB_TOKEN }}

If releases are handled in .github/workflows/cd.yml, consider deleting the “Create Release” step here entirely.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
coverage-finish:
name: Finalize Coverage
needs: [test, build-validation]
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Finalize Coveralls Reporting
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
coverage-reporter-version: v0.6.15
fail-on-error: false
- name: Download APK Artifact
uses: actions/download-artifact@v5
with:
name: android-apk
path: build/app/outputs/flutter-apk/
name: android-apk-${{ github.run_number }}
path: build/app/outputs/apk/release/
- name: Get Current Date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Checkout Repository (for tagging)
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.sha }}
- name: Create Release Tag
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git tag -a v${{ github.run_number }} -m "Release v${{ github.run_number }}"
git push origin v${{ github.run_number }}
- name: Create Release
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: v${{ github.run_number }}
files: build/app/outputs/flutter-apk/app-debug.apk
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
coverage-finish:
name: Finalize Coverage
needs: test
runs-on: ubuntu-latest
steps:
- name: Finalize Coveralls Reporting
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
- name: Get Current Date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
🧰 Tools
🪛 actionlint (1.7.7)

222-222: input "github-token" is not defined in action "softprops/action-gh-release@v2". available inputs are "append_body", "body", "body_path", "discussion_category_name", "draft", "fail_on_unmatched_files", "files", "generate_release_notes", "make_latest", "name", "prerelease", "preserve_order", "repository", "tag_name", "target_commitish", "token"

(action)


223-223: input "parallel-finished" is not defined in action "softprops/action-gh-release@v2". available inputs are "append_body", "body", "body_path", "discussion_category_name", "draft", "fail_on_unmatched_files", "files", "generate_release_notes", "make_latest", "name", "prerelease", "preserve_order", "repository", "tag_name", "target_commitish", "token"

(action)

🪛 YAMLlint (1.37.1)

[error] 213-213: trailing spaces

(trailing-spaces)


[error] 214-214: trailing spaces

(trailing-spaces)


[error] 218-218: trailing spaces

(trailing-spaces)

Comment on lines +261 to +278
- name: Build Preview APK
env:
FB_APP_ID: ${{ secrets.FB_APP_ID }}
FB_APP_NAME: ${{ secrets.FB_APP_NAME }}
GH_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }}
GH_OAUTH_CLIENT_SECRET: ${{ secrets.GH_OAUTH_CLIENT_SECRET }}
run: |
flutter clean
flutter pub get
flutter gen-l10n
flutter packages pub run build_runner build --delete-conflicting-outputs
flutter build apk --release \
--build-number=${{ github.run_number }} \
--dart-define=FB_APP_ID=$FB_APP_ID \
--dart-define=FB_APP_NAME=$FB_APP_NAME \
--dart-define=GITHUB_OAUTH_CLIENT_ID=$GH_OAUTH_CLIENT_ID \
--dart-define=GITHUB_OAUTH_CLIENT_SECRET=$GH_OAUTH_CLIENT_SECRET

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Quote dart-define values in preview build

Same reasoning: names with spaces break argument parsing.

           flutter build apk --release \
             --build-number=${{ github.run_number }} \
-            --dart-define=FB_APP_ID=$FB_APP_ID \
-            --dart-define=FB_APP_NAME=$FB_APP_NAME \
-            --dart-define=GITHUB_OAUTH_CLIENT_ID=$GH_OAUTH_CLIENT_ID \
-            --dart-define=GITHUB_OAUTH_CLIENT_SECRET=$GH_OAUTH_CLIENT_SECRET
+            --dart-define=FB_APP_ID="$FB_APP_ID" \
+            --dart-define=FB_APP_NAME="$FB_APP_NAME" \
+            --dart-define=GITHUB_OAUTH_CLIENT_ID="$GH_OAUTH_CLIENT_ID" \
+            --dart-define=GITHUB_OAUTH_CLIENT_SECRET="$GH_OAUTH_CLIENT_SECRET"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Build Preview APK
env:
FB_APP_ID: ${{ secrets.FB_APP_ID }}
FB_APP_NAME: ${{ secrets.FB_APP_NAME }}
GH_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }}
GH_OAUTH_CLIENT_SECRET: ${{ secrets.GH_OAUTH_CLIENT_SECRET }}
run: |
flutter clean
flutter pub get
flutter gen-l10n
flutter packages pub run build_runner build --delete-conflicting-outputs
flutter build apk --release \
--build-number=${{ github.run_number }} \
--dart-define=FB_APP_ID=$FB_APP_ID \
--dart-define=FB_APP_NAME=$FB_APP_NAME \
--dart-define=GITHUB_OAUTH_CLIENT_ID=$GH_OAUTH_CLIENT_ID \
--dart-define=GITHUB_OAUTH_CLIENT_SECRET=$GH_OAUTH_CLIENT_SECRET
- name: Build Preview APK
env:
FB_APP_ID: ${{ secrets.FB_APP_ID }}
FB_APP_NAME: ${{ secrets.FB_APP_NAME }}
GH_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }}
GH_OAUTH_CLIENT_SECRET: ${{ secrets.GH_OAUTH_CLIENT_SECRET }}
run: |
flutter clean
flutter pub get
flutter gen-l10n
flutter packages pub run build_runner build --delete-conflicting-outputs
flutter build apk --release \
--build-number=${{ github.run_number }} \
--dart-define=FB_APP_ID="$FB_APP_ID" \
--dart-define=FB_APP_NAME="$FB_APP_NAME" \
--dart-define=GITHUB_OAUTH_CLIENT_ID="$GH_OAUTH_CLIENT_ID" \
--dart-define=GITHUB_OAUTH_CLIENT_SECRET="$GH_OAUTH_CLIENT_SECRET"
🤖 Prompt for AI Agents
.github/workflows/ci.yml around lines 261 to 278: the flutter build apk
--dart-define flags pass values that may contain spaces (e.g., FB_APP_NAME)
unquoted which breaks argument parsing; update each --dart-define to wrap the
key=value in quotes (for example --dart-define="FB_APP_NAME=$FB_APP_NAME") for
all four defines so the shell treats the entire assignment as a single argument
and preserves spaces/special characters.

Comment on lines +29 to +34
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>FB_LOGIN_PROTOCOL_SCHEME</string>
</array>
</dict>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix Facebook URL scheme: must be fb$(FB_APP_ID), not a literal placeholder.

Using a literal FB_LOGIN_PROTOCOL_SCHEME breaks login. Use a build setting so Xcode expands it.

-        <dict>
-            <key>CFBundleURLSchemes</key>
-            <array>
-                <string>FB_LOGIN_PROTOCOL_SCHEME</string>
-            </array>
-        </dict>
+        <dict>
+            <key>CFBundleURLSchemes</key>
+            <array>
+                <string>fb$(FB_APP_ID)</string>
+            </array>
+        </dict>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>FB_LOGIN_PROTOCOL_SCHEME</string>
</array>
</dict>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb$(FB_APP_ID)</string>
</array>
</dict>
🤖 Prompt for AI Agents
In ios/Runner/Info.plist around lines 29-34 the CFBundleURLSchemes entry uses
the literal placeholder "FB_LOGIN_PROTOCOL_SCHEME" which prevents Xcode from
expanding your Facebook app id; replace the literal with the build-variable
expansion so the scheme reads fb$(FB_APP_ID) and ensure the FB_APP_ID build
setting is defined in the target's Build Settings (or in xcconfig) so Xcode can
substitute the actual app id at build time.

Comment on lines +52 to +57
<key>FacebookAppID</key>
<string>FB_APP_ID</string>
<key>FacebookDisplayName</key>
<string>CircuitVerse</string>
<key>FacebookClientToken</key>
<string>$(FACEBOOK_CLIENT_TOKEN)</string>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Use Xcode build-setting expansion for FB keys (dart-define won’t touch Info.plist).

Literal strings won’t be replaced at build time; switch to $(VAR) and ensure the vars exist in project/xcconfig.

-    <key>FacebookAppID</key>
-    <string>FB_APP_ID</string>
-    <key>FacebookDisplayName</key>
-    <string>CircuitVerse</string>
+    <key>FacebookAppID</key>
+    <string>$(FB_APP_ID)</string>
+    <key>FacebookDisplayName</key>
+    <string>$(FB_APP_NAME)</string>

Verification:

  • Define FB_APP_ID and FB_APP_NAME in Runner build settings or xcconfig (Debug/Release). Example in ios/Flutter/Release.xcconfig:
    FB_APP_ID=1234567890
    FB_APP_NAME=CircuitVerse

🏁 Script executed:

#!/bin/bash
# Locate all xcconfig files in the iOS project
find ios -type f -name "*.xcconfig"

# Search xcconfig files for FB_APP_ID definition
grep -R "FB_APP_ID" -n ios

# Search xcconfig files for FACEBOOK_CLIENT_TOKEN definition
grep -R "FACEBOOK_CLIENT_TOKEN" -n ios

Length of output: 280


🏁 Script executed:

#!/bin/bash

echo "=== ios/Flutter/Debug.xcconfig ==="
sed -n '1,200p' ios/Flutter/Debug.xcconfig

echo ""
echo "=== ios/Flutter/Release.xcconfig ==="
sed -n '1,200p' ios/Flutter/Release.xcconfig

Length of output: 474


🏁 Script executed:

#!/bin/bash
# Print the beginning of Generated.xcconfig to check existing variable definitions
sed -n '1,200p' ios/Flutter/Generated.xcconfig

Length of output: 120


Replace hardcoded Facebook keys in Info.plist with Xcode build‐setting variables
Info.plist (lines 52–57) must use $(FB_APP_ID) and $(FB_APP_NAME) instead of literal values. Then add definitions for FB_APP_ID and FB_APP_NAME in your xcconfig files (e.g. ios/Flutter/Debug.xcconfig and ios/Flutter/Release.xcconfig) or in the project’s Build Settings.

@@ -1,3 +1,4 @@
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Inconsistency with PR objectives.

The PR objectives state this is for upgrading Gradle/AGP, but this file adds Facebook authentication functionality. This appears to be outside the stated scope of the PR.


🏁 Script executed:

#!/bin/bash
# Check if Facebook auth was part of a previous commit or PR
git log --oneline -n 20 | grep -i "facebook\|fb" || echo "No recent Facebook-related commits found"

# Check if there are other Facebook-related changes in the PR
fd -e dart -e java -e kt -e swift -e m | xargs rg -l "facebook\|FacebookAuth" 2>/dev/null | head -10

Length of output: 266


PR scope mismatch: move Facebook auth changes to a separate PR
This PR is described as upgrading Gradle/AGP but adds a Facebook authentication import in lib/viewmodels/authentication/auth_options_viewmodel.dart; please remove or isolate this change into its own PR or update the PR description to reflect the added functionality.

🤖 Prompt for AI Agents
In lib/viewmodels/authentication/auth_options_viewmodel.dart around line 1, the
import for flutter_facebook_auth was added but this PR is supposed to only
upgrade Gradle/AGP; either remove the Facebook import and any related code
changes from this branch so the PR only contains build system changes, or move
the Facebook auth change into a separate feature PR (or update this PR
description to explicitly include the Facebook auth addition). If you remove it:
delete the import and any unreachable/unused references, run analyzer/format,
and ensure no other files in this PR depend on flutter_facebook_auth; if you
move it: revert this file to the pre-change state in this branch and create a
new PR containing the Facebook auth import and its associated code and tests.

@hardik17771
Copy link
Member

Hey @ShashwatXD , good work, just that the minSDK version is not set properly, please update the root gradle file and explicitly set the number.

@ShashwatXD
Copy link
Contributor Author

Hey @ShashwatXD , good work, just that the minSDK version is not set properly, please update the root gradle file and explicitly set the number.

Done @hardik17771 , please review

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
android/app/build.gradle (1)

26-38: Fix parsing of Flutter dart-defines (use Base64, support URL-decoded fallback).

Flutter passes dart-defines to Gradle as Base64-encoded key=value pairs. Current URL decoding will mis-parse and break values containing “=” or special chars.

-def environmentVariables = [
-    FB_APP_NAME: 'FB_APP_NAME',
-    FB_APP_ID: 'FB_APP_ID',
-];
-
-if (project.hasProperty('dart-defines')) {
-    environmentVariables = environmentVariables + project.property('dart-defines')
-        .split(',')
-        .collectEntries { entry ->
-            def pair = URLDecoder.decode(entry).split('=')
-            [(pair.first()): pair.last()]
-        }
-}
+def environmentVariables = [
+    FB_APP_NAME: 'FB_APP_NAME',
+    FB_APP_ID  : 'FB_APP_ID',
+]
+
+if (project.hasProperty('dart-defines')) {
+    def decoded = project.property('dart-defines')
+        .split(',')
+        .collectEntries { entry ->
+            // Flutter supplies base64-encoded "KEY=VALUE" entries.
+            def raw
+            try {
+                raw = new String(java.util.Base64.decoder.decode(entry))
+            } catch (IllegalArgumentException ignore) {
+                // Fallback for legacy/hand-passed URL-encoded values.
+                raw = URLDecoder.decode(entry, 'UTF-8')
+            }
+            def idx = raw.indexOf('=')
+            idx > 0 ? [(raw.substring(0, idx)): raw.substring(idx + 1)] : [:]
+        }
+    environmentVariables += decoded
+}
♻️ Duplicate comments (4)
pubspec.yaml (4)

28-28: Delete stale commented dependency.

Remove the redundant # flutter_facebook_auth: ^5.0.6 to avoid confusion now that v6.0.4 is in use.

-  # flutter_facebook_auth: ^5.0.6

62-63: Move mockito to dev_dependencies and align versions with overrides.

Mockito is test-only and the override (5.4.4) conflicts with dependency (^5.4.5). Shift it to dev_dependencies and drop the override to keep resolution stable.

   flutter_facebook_auth: ^6.0.4
-  mockito: ^5.4.5
+
@@
 dev_dependencies:
   build_runner: ^2.5.4
   flutter_lints: ^6.0.0
   flutter_test:
     sdk: flutter
-  hive_generator: ^2.0.0 
+  hive_generator: ^2.0.0
+  mockito: 5.4.4
@@
 dependency_overrides:
-  build_runner: ^2.4.13
-  mockito: 5.4.4
+  build_runner: ^2.4.13

Run to ensure Mockito isn’t referenced from runtime code:

#!/bin/bash
rg -nP --type dart -g '!test/**' -C2 '\bpackage:mockito/'

Also applies to: 69-76, 80-81


74-74: Trim trailing whitespace.

YAML linters flag this line.

-  hive_generator: ^2.0.0 
+  hive_generator: ^2.0.0

113-113: Add newline at EOF.

Satisfies YAML/newline linters.

-          style: italic
+          style: italic
+
🧹 Nitpick comments (2)
pubspec.yaml (1)

80-81: Document and time-box the overrides.

If these overrides are required for Dart 3.9 analyzer/macro constraints, add a comment with the removal condition (e.g., “remove once Flutter stable ships Dart ≥3.10”). Otherwise, drop them.

 dependency_overrides:
-  build_runner: ^2.4.13
+  # TEMP: Keep pub get working on Dart 3.9; remove when Flutter stable includes Dart ≥3.10.
+  build_runner: ^2.4.13
-  mockito: 5.4.4
+  # Prefer pinning under dev_dependencies and removing this override if possible.
+  # mockito: 5.4.4
android/app/build.gradle (1)

85-87: Don’t override app_name via resValue; guard Facebook IDs.

Overriding app_name from CI can unintentionally rename the app. Keep app_name in strings.xml and set FB values defensively to avoid leaking placeholders into builds.

-        resValue "string", "app_name", environmentVariables.FB_APP_NAME
-        resValue "string", "facebook_app_id", environmentVariables.FB_APP_ID
-        resValue "string", "fb_login_protocol_scheme", "fb" + environmentVariables.FB_APP_ID
+        // Keep app_name in res/values/strings.xml to avoid accidental renames.
+        // Provide Facebook values with safe fallbacks.
+        resValue "string", "facebook_app_id", (environmentVariables.FB_APP_ID ?: "")
+        resValue "string", "fb_login_protocol_scheme",
+                (environmentVariables.FB_APP_ID ? "fb${environmentVariables.FB_APP_ID}" : "")

If the manifest requires these strings unconditionally, ensure CI always sets FB_APP_ID; otherwise consider using manifestPlaceholders instead of resValue.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5f12281 and 5d481bc.

📒 Files selected for processing (2)
  • android/app/build.gradle (5 hunks)
  • pubspec.yaml (4 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
pubspec.yaml

[error] 74-74: trailing spaces

(trailing-spaces)


[error] 113-113: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (5)
android/app/build.gradle (5)

15-15: No-op change.

Nothing to review here.


74-76: LGTM: lint DSL update.

Using the newer lint {} block is correct for AGP 8.x.


80-82: Min/target SDK update looks fine.

minSdkVersion 23 matches the PR goal; targetSdk 34 aligns with Play requirements.

If there’s still feedback about “root Gradle” minSdk, point reviewers to this module-level setting (the authoritative place in Flutter apps).


129-129: No-op change.

Nothing to review here.


58-58: Confirm compileSdkVersion 36 is available in CI & local dev.

Location: android/app/build.gradle:58
Avoid red builds from missing SDK platforms; install if needed. Sandbox verification failed (sdkmanager/cmdline-tools not present). Run on CI/dev and confirm success:

yes | "${ANDROID_HOME:-$ANDROID_SDK_ROOT}"/cmdline-tools/latest/bin/sdkmanager "platforms;android-36" "build-tools;35.0.0"

@hardik17771
Copy link
Member

Hey @ShashwatXD , I saw you removed windows desktop support which is not needed just to get a dependency work. Also you've added facebook metadata and facebook auth implementation injection but we are currently in process of removing depricated facebook packages.

@hardik17771
Copy link
Member

You can raise different PRs for these issues as this PR should be focused on upgrading gradle and minSdk versions

@ShashwatXD
Copy link
Contributor Author

You can raise different PRs for these issues as this PR should be focused on upgrading gradle and minSdk versions

Alright @hardik17771, I only made those changes due to build errors. Will keep the next PR limited to just Gradle and minSdk upgrade.

@hardik17771
Copy link
Member

You can raise different PRs for these issues as this PR should be focused on upgrading gradle and minSdk versions

Alright @hardik17771, I only made those changes due to build errors. Will keep the next PR limited to just Gradle and minSdk upgrade.

You can surely make changes for build errors but we can't remove desktop support for now.

@ShashwatXD
Copy link
Contributor Author

Got it, must have overlooked the desktop part, my bad!

@ShashwatXD ShashwatXD closed this by deleting the head repository Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrading AGP version and Gradle version of app build files

2 participants