Repository navigation
feat: Phase 1 — quality tooling, Material You, per-app language, Arabic seed, JUnit5 tests, release workflow - #2
Open
devin-ai-integration[bot] wants to merge 8 commits into
Conversation
- Apply Detekt (1.23.7) and Spotless (6.25.0) plugins to :app for static analysis and formatting. Spotless excludes the legacy packages a/, com/besome/, mod/agus/, kellinwood/ for now. - Detekt runs informational-only (ignoreFailures = true) until the legacy code is gradually cleaned up; SARIF report is uploaded to the GitHub Security tab. - Add renovate.json with grouped updates (AndroidX, Firebase, Kotlin, Android build tools), automerge for minor + security patches, and a hard pin for r8 < 8.12 (see ADR-0002). - Add .github/dependabot.yml for weekly github-actions updates. - New CI workflow .github/workflows/lint.yml runs Detekt, Spotless check, and Android Lint on every PR (continue-on-error so it never blocks merges yet). - Add docs/adr/ with ADRs 0001 (record-architecture-decisions), 0002 (pin-r8), 0003 (defer-modular-refactor), and a contributor guide for translators (docs/CONTRIBUTING-i18n.md). Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
UI/UX: - Wire up Material 3 DynamicColors in SketchApplication so devices running Android 12+ pick up the user's wallpaper-derived palette. Toggle persisted in SharedPreferences (default: enabled). The precondition lambda ensures activities re-check the toggle so users can disable it at runtime without restarting the app. - Declare android:localeConfig in the manifest pointing at res/xml/locales_config.xml (10 supported tags) so Android 13+ surfaces the per-app language picker in system Settings. - Register androidx.appcompat.app.AppLocalesMetadataHolderService with autoStoreLocales=true so AppCompat 1.7's per-app language API persists the user's choice without manual SharedPreferences. i18n: - Add LocaleHelper utility (set/get/effective locale) wrapping the AppCompat per-app language API. - Seed values-ar/strings.xml with ~120 of the most user-visible strings (common words, main drawer, block category titles). Fallback to English for untranslated keys is automatic. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Tests: - Add JUnit 5 BOM (5.11.4), MockK 1.13.13, Truth 1.4.4, kotlinx-coroutines-test 1.10.1, AndroidX arch-core-testing. - Configure useJUnitPlatform() globally on Test tasks. - Seed unit tests for PropertiesUtil (10 cases for unit/prefix parsing), CustomVariableUtil (4 cases for Java field declaration parsing), and LocaleHelper (MockK-static for AppCompatDelegate). Release automation: - New .github/workflows/release.yml triggered on tag push (v*) or workflow_dispatch. Builds the release APK with the same hardening used in android.yml, computes SHA256, and publishes a GitHub Release with the APK + checksums attached. Auto-generated release notes from commit messages. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Some helpers in PropertiesUtil reach into android.util.Pair and android.text.TextUtils which are stubbed (and throw 'Stub!') in the unit-test classpath. This commit: - Sets testOptions.unitTests.returnDefaultValues = true so any Android stub method called during unit tests returns its default instead of crashing. - Restricts PropertiesUtilTest to the helpers that don't depend on Android stubs (parseReferName, generateItems, regex constants). Coverage for unit/prefix parsing will be added via instrumentation tests in a follow-up. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
GitHub's pre-receive hook rejects pushes with files larger than 100 MB and the Sketchware Pro release APK is ~124 MB, so the binary itself lives at https://github.com/Dr-Code-EG/Sketchware-Pro/releases. This directory hosts the SHA-256 checksum so offline clones can still verify a downloaded APK. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Compute checksums AFTER renaming the APK so SHA256SUMS.txt references the final SketchwarePro-<tag>.apk filename. Previously the checksum file mentioned app-release.apk which doesn't exist on the release page, breaking 'sha256sum -c' verification. - Funnel inputs.tag_name through an env var instead of expanding it directly into a bash run block, plus a strict [A-Za-z0-9._-]+ regex guard. This prevents script injection by anyone with write access triggering workflow_dispatch with a malicious tag. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The Arabic and Persian locales added in this PR are right-to-left, but without supportsRtl the framework keeps layouts in left-to-right direction even when the user picks an RTL language - drawers end up on the wrong side, padding asymmetric, etc. Default value of supportsRtl is false, so we have to set it explicitly. Caught by Devin Review. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Previously locales_config.xml listed 10 languages (id, pt-BR, es, ru, hi, fa, tr, vi) that had no values-<locale>/strings.xml. On Android 13+ this populates the per-app language picker, so users selecting any of those would get a silently-English UI - misleading. Trim the list to en + ar (the ones that actually have resources) and update the contributor guide to explain the policy. Caught by Devin Review. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.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
Phase 1 of the
Professional Roadmap
quick wins. Targets
chore/update-dependencies(PR #1) so it lands cleanlyonce the library bump is merged.
Tooling
:app(informationalonly; legacy packages excluded). Config lives at
config/detekt/detekt.yml.lint.ymlworkflow runs Detekt + Spotless check + Android Lint onevery PR (continue-on-error so it never blocks merges yet).
renovate.jsonfor grouped dependency updates withr8pinned to< 8.12.0(rationale in ADR-0002)..github/dependabot.ymlfor weekly github-actions updates.UI / UX (
feat(ui))SketchApplication; opt-in togglepersisted in SharedPreferences (default: enabled). The precondition lambda
re-checks the toggle so users can disable Material You at runtime.
android:localeConfig=@xml/locales_configand AppCompat 1.7'sAppLocalesMetadataHolderServicewithautoStoreLocales=true.values-ar/strings.xml(~120 strings).en,ar,id,pt-BR,es,ru,hi,fa,tr,vi). Untranslated keys fall back to English.Tests
arch-core-testing.
PropertiesUtil,CustomVariableUtil, andLocaleHelper(mockingAppCompatDelegatevia MockK static).useJUnitPlatform()configured globally on Test tasks.testOptions.unitTests.returnDefaultValues = trueso Android stubclasses don't crash unit tests.
Release automation
release.ymlworkflow triggers onv*tag push or manual dispatch.Builds the release APK, computes SHA256, publishes a GitHub Release
with the APK + checksums attached.
v7.0.0-phase1-r1already published with thelocally-built APK + checksum: https://github.com/Dr-Code-EG/Sketchware-Pro/releases/tag/v7.0.0-phase1-r1
releases/directory holds the SHA-256 pointer for offline verification(the binary itself is too large for git: 124 MB > GitHub's 100 MB limit).
Documentation
docs/adr/:0001-record-architecture-decisions.md0002-pin-r8-to-8-11-x.md0003-defer-modular-refactor.mddocs/CONTRIBUTING-i18n.md— translator onboarding guide.Review & Testing Checklist for Human
Risk level: yellow — touches application bootstrap (
SketchApplication)and the build (
build.gradle,gradle.properties).Releases
on a real device and verify the app starts.
should match your wallpaper. Toggle it off in app settings and confirm
it falls back to the legacy theme.
Settings → Apps → Sketchware Pro → Languageand pick Arabic; the main drawer / common labels should switch to
Arabic and layout direction should mirror to RTL.
./gradlew :app:testlocally and confirm 14 tests pass.to the Security tab and that no failures actually block CI yet.
Notes
The PR #1 GitHub Actions
Build APKsjob is currently failing with areproducible-only-on-CI
Unresolved reference 'BuildSettings'error incompileReleaseKotlin. The same source tree builds cleanly locally withidentical Java/Gradle/Kotlin versions, and we've already tried:
disabling Develocity injection, disabling caches, isolating
GRADLE_USER_HOME, raising the Gradle daemon heap to 4 GB, and forcingkotlin.compiler.execution.strategy=in-process. The locally-built APKattached to
v7.0.0-phase1-r1was produced from the merged tip of thisbranch on top of
chore/update-dependencies.Phase 2 work (modular Gradle refactor, Compose foundations, performance
baseline, full localisation rollout) tracked in the roadmap and will land
in subsequent PRs.
Link to Devin session: https://app.devin.ai/sessions/e3921762a25f45138ba2e0180e57b14d
Requested by: @Dr-Code-EG