fix(config): thread API_BASE_URL through core/network as single source (E01.S05)#7
Open
abdout wants to merge 1 commit into
Open
fix(config): thread API_BASE_URL through core/network as single source (E01.S05)#7abdout wants to merge 1 commit into
abdout wants to merge 1 commit into
Conversation
…e (E01.S05) Three places used to hold a different API host string: - `core/network/.../network-module.kt:26` — production host `https://ed.databayt.org/`, used by Retrofit - `app/build.gradle.kts` — `BuildConfig.API_BASE_URL = "https://ed.databayt.org/api/"` (would double-prefix `/api/` since endpoints already start with `api/mobile/...`) - `app/.../config/build-config-helper.kt` — hardcoded `staging-api.databayt.org` / `api.databayt.org` subdomains that don't match production Drift was silent because `BuildConfigHelper.apiBaseUrl` had no callers. Moves the canonical URL to `core/network/BuildConfig.API_BASE_URL` (the module owns the config). `network-module.kt:provideRetrofit` reads it directly; `BuildConfigHelper.apiBaseUrl` reads through to the same constant via `import ... core.network.BuildConfig`. Drops the wrong `API_BASE_URL` definitions from `app/build.gradle.kts` (defaultConfig + both buildTypes); `SOCKET_URL` stays until E09 lifts it. Adds inline comments documenting the URL convention (trailing slash, no `/api/` because endpoint paths carry that prefix themselves). Deferred: AC4 (CI lint rule against hardcoded `databayt.org` URLs) folds into E01.S09 with the rest of the custom Detekt rules. Closes #6 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
core/network/BuildConfig.API_BASE_URL; removes 4 hardcoded URLs from 3 different filesnetwork-module.kt:provideRetrofitandBuildConfigHelper.apiBaseUrlboth read through to the same constant/api/URL convention (endpoint paths carryapi/...themselves)Story
E01.S05 (Phase 1 Pilot v1, Sprint P1, 2 pts).
Test plan
./gradlew :core:network:assembleDebugsucceeds (validatesbuildFeatures { buildConfig = true }works with the newbuildConfigField)./gradlew :app:assembleDebugsucceeds (validates theBuildConfigHelpercross-module import resolves)grep -rE 'buildConfigField.*API_BASE_URL'hit in the repo:core/network/build.gradle.ktsonlygrep -rE '\"https://[^\"]*databayt\\.org/?[^\"]*\"'hit in production code:core/network/build.gradle.kts(+app/build.gradle.ktsSOCKET_URL until E09)Deferred
databayt.orgURLs outsideapp/build.gradle.kts) — folds into E01.S09 with the rest of the custom Detekt rulesCloses #6
Generated with Claude Code