Skip to content

GT-2601: Download translation files from CDN with SHA-256 verification#4424

Open
frett wants to merge 4 commits into
developfrom
cdnResources
Open

GT-2601: Download translation files from CDN with SHA-256 verification#4424
frett wants to merge 4 commits into
developfrom
cdnResources

Conversation

@frett
Copy link
Copy Markdown
Contributor

@frett frett commented May 12, 2026

Summary

  • Introduces ApiConfig to consolidate API/CDN base URL configuration, replacing the scattered @Named string injection
  • Adds CdnApi (Retrofit) for downloading published translation files from the CDN, with base URLs configured per flavor (mobilecontent-stage.cru.org / mobilecontent.cru.org)
  • Verifies SHA-256 checksum and byte size when storing downloaded files, rejecting any file that doesn't match the manifest metadata
  • Prefers the CDN when downloading published translation files, falling back to the existing TranslationsApi on 4xx errors or IOException

Test plan

  • New unit tests cover: CDN preferred over API, fallback to API on CDN 404, fallback on IOException, both sources failing returns false, correct/wrong SHA-256 accepted/rejected, correct/wrong size accepted/rejected
  • Run ./gradlew :library:download-manager:test to verify all download manager tests pass
  • Run ./gradlew :build-logic:ktlintCheck ktlintCheck to verify code style
  • Smoke test on stage build: download a tool and confirm it completes successfully

🤖 Generated with Claude Code

@frett frett changed the title Download translation files from CDN with SHA-256 verification GT-2601: Download translation files from CDN with SHA-256 verification May 12, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

❌ Patch coverage is 65.90909% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.06%. Comparing base (912cd6a) to head (3af7a56).

Files with missing lines Patch % Lines
.../src/main/kotlin/org/cru/godtools/api/ApiModule.kt 0.00% 7 Missing ⚠️
...odtools/downloadmanager/GodToolsDownloadManager.kt 87.87% 1 Missing and 3 partials ⚠️
...ain/kotlin/org/cru/godtools/dagger/ConfigModule.kt 0.00% 3 Missing ⚠️
.../src/main/kotlin/org/cru/godtools/api/ApiConfig.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4424      +/-   ##
===========================================
+ Coverage    51.99%   52.06%   +0.07%     
===========================================
  Files          454      455       +1     
  Lines        12075    12105      +30     
  Branches      2092     2096       +4     
===========================================
+ Hits          6278     6303      +25     
- Misses        5181     5188       +7     
+ Partials       616      614       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

frett and others added 4 commits May 12, 2026 16:48
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… to API

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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