Skip to content

Update Build ENV Variable - #115

Open
animemoeus wants to merge 2 commits into
mainfrom
feat/build-improvement
Open

Update Build ENV Variable#115
animemoeus wants to merge 2 commits into
mainfrom
feat/build-improvement

Conversation

@animemoeus

@animemoeus animemoeus commented Aug 18, 2025

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • None
  • Chores

    • Updated Android build/runtime configuration to source the API endpoint from environment variables.
    • Disabled in-app (OTA) updates; future updates will arrive via the app store.
    • Adjusted deep link settings; links using the myapp scheme continue to work.
  • Refactor

    • Removed legacy theme and engine settings with no user-visible changes.

@netlify

netlify Bot commented Aug 18, 2025

Copy link
Copy Markdown

Deploy Preview for tani-pintar ready!

Name Link
🔨 Latest commit 9055084
🔍 Latest deploy log https://app.netlify.com/projects/tani-pintar/deploys/68a307901beb450008cf0dfa
😎 Deploy Preview https://deploy-preview-115--tani-pintar.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Aug 18, 2025

Copy link
Copy Markdown

Walkthrough

Adds an API_URL BuildConfig field sourced from EXPO_PUBLIC_API_URL (with a fallback). Updates AndroidManifest: removes package attribute, disables Expo Updates, removes related metadata, and adjusts deep link schemes. Removes a redundant AppTheme style. Deletes expo.jsEngine property from gradle.properties.

Changes

Cohort / File(s) Summary of changes
Build config and environment injection
android/app/build.gradle
Adds buildConfigField String API_URL from EXPO_PUBLIC_API_URL with fallback to https://dev.api.taniverse.id; exposes as BuildConfig.API_URL.
Manifest configuration and updates settings
android/app/src/main/AndroidManifest.xml
Removes manifest package attribute; sets expo.modules.updates.ENABLED to false; removes EXPO_SDK_VERSION and EXPO_UPDATE_URL metadata; removes data scheme com.taniverse.tanipintar from MainActivity VIEW intent-filter (myapp remains).
Styles cleanup
android/app/src/main/res/values/styles.xml
Removes duplicate/legacy AppTheme (Theme.AppCompat.Light.NoActionBar) with colorPrimary/PrimaryDark; retains existing AppTheme (DayNight) and splash theme.
Gradle properties
android/gradle.properties
Removes expo.jsEngine=jsc; keeps expo.edgeToEdgeEnabled=false.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Android
  participant App
  participant ExpoUpdates as Expo Updates

  User->>Android: Launch app
  Android->>App: onCreate()
  App->>ExpoUpdates: Check if updates enabled
  ExpoUpdates-->>App: Disabled (false)
  App-->>User: Continue normal startup
Loading
sequenceDiagram
  participant Env as Build Env
  participant Gradle
  participant BuildConfig
  participant App

  Env-->>Gradle: EXPO_PUBLIC_API_URL (or unset)
  Gradle->>BuildConfig: Generate API_URL (fallback if unset)
  App->>BuildConfig: Read API_URL at runtime
  BuildConfig-->>App: Return API_URL string
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I twitch my ears at configs new,
A URL tucked in builds I brew.
The updates nap, no OTA flight,
Our manifest trims for cleaner night.
With lighter styles and engines few—
I thump the ground: ship-hop-woo! 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/build-improvement

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
android/app/build.gradle (1)

98-99: Harden BuildConfig.API_URL resolution and escape quotes

The current buildConfigField works, but:

  • System.getenv is read at Gradle config time; Android Studio builds often don’t inherit shell envs. Prefer also checking Gradle properties (-P) or gradle.properties for local dev.
  • If the env value contains a double quote, the generated Java string would be malformed. Escape quotes before embedding.

Apply this diff to make resolution more robust and safe:

-        // Inject environment variables as BuildConfig fields
-        buildConfigField "String", "API_URL", "\"${System.getenv('EXPO_PUBLIC_API_URL') ?: 'https://dev.api.taniverse.id'}\""
+        // Inject environment variables as BuildConfig fields (env -> -P prop -> fallback)
+        def rawApiUrl = (System.getenv('EXPO_PUBLIC_API_URL')
+            ?: findProperty('EXPO_PUBLIC_API_URL')
+            ?: 'https://dev.api.taniverse.id')
+        // Escape any quotes to keep the generated Java valid
+        def safeApiUrl = rawApiUrl.replace('"', '\\"')
+        buildConfigField "String", "API_URL", "\"${safeApiUrl}\""
  • Confirm your CI and local Android Studio builds provide EXPO_PUBLIC_API_URL (either via env or gradle.properties/–P). If you want, I can add a small guard that fails release builds when the URL is unset to avoid shipping with the dev fallback.
android/app/src/main/AndroidManifest.xml (1)

17-19: Updates disabled — consider pruning redundant metadata

Setting expo.modules.updates.ENABLED to false is sufficient. Leaving EXPO_UPDATES_CHECK_ON_LAUNCH and EXPO_UPDATES_LAUNCH_WAIT_MS is harmless but confusing since they’re ignored when disabled. Prune to reduce config noise.

Apply this diff to remove the unused metadata:

     <meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
-    <meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
-    <meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
📜 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 d018657 and 9055084.

⛔ Files ignored due to path filters (15)
  • android/app/src/main/res/mipmap-hdpi/ic_launcher.png is excluded by !**/*.png
  • android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png is excluded by !**/*.png
  • android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png is excluded by !**/*.png
  • android/app/src/main/res/mipmap-mdpi/ic_launcher.png is excluded by !**/*.png
  • android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png is excluded by !**/*.png
  • android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png is excluded by !**/*.png
  • android/app/src/main/res/mipmap-xhdpi/ic_launcher.png is excluded by !**/*.png
  • android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png is excluded by !**/*.png
  • android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png is excluded by !**/*.png
  • android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png is excluded by !**/*.png
  • android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png is excluded by !**/*.png
  • android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png is excluded by !**/*.png
  • android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png is excluded by !**/*.png
  • android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png is excluded by !**/*.png
  • android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png is excluded by !**/*.png
📒 Files selected for processing (4)
  • android/app/build.gradle (1 hunks)
  • android/app/src/main/AndroidManifest.xml (2 hunks)
  • android/app/src/main/res/values/styles.xml (0 hunks)
  • android/gradle.properties (1 hunks)
💤 Files with no reviewable changes (1)
  • android/app/src/main/res/values/styles.xml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Redirect rules - tani-pintar
  • GitHub Check: Header rules - tani-pintar
  • GitHub Check: Pages changed - tani-pintar
🔇 Additional comments (4)
android/gradle.properties (1)

59-59: Edge-to-edge flag left disabled — verify UX and status bar insets

expo.edgeToEdgeEnabled=false is fine, just ensure your theme/window insets handling matches this choice (status/navigation bars, splash screen background). If you intended to move toward edge-to-edge on Android 13+, you’ll want this true with proper WindowInsets handling.

Also noting the removal of expo.jsEngine (as per PR context) aligns with hermesEnabled=true in app/build.gradle — good cleanup.

Do you want to keep edge-to-edge off for now? If not, I can draft the minimal changes (theme and activity window flags) to enable it safely.

android/app/src/main/AndroidManifest.xml (3)

1-1: Removing package from is correct with AGP namespace

Good move. With namespace set in build.gradle (namespace 'com.taniverse.tanipintar'), keeping the package attribute in the manifest is deprecated.


20-31: Deep link scheme reduced to only “myapp” — verify no regressions

You removed the com.taniverse.tanipintar scheme (per PR), leaving only myapp. If any existing links/QRs/Intents rely on the old scheme, they will break. Consider keeping both schemes for backward compatibility during a transition period.

I can add back the second tag if needed:

       <intent-filter>
         <action android:name="android.intent.action.VIEW"/>
         <category android:name="android.intent.category.DEFAULT"/>
         <category android:name="android.intent.category.BROWSABLE"/>
         <data android:scheme="myapp"/>
+        <data android:scheme="com.taniverse.tanipintar"/>
       </intent-filter>

16-16: Ensure @style/AppTheme still exists after styles cleanup

Manifest references android:theme="@style/AppTheme". Given styles were adjusted in this PR, double-check that AppTheme is still defined to avoid a runtime resource crash on launch.

If AppTheme was renamed, update the manifest theme or re-add a forwarder style. I can draft the minimal styles.xml entry if needed.

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.

1 participant