Repository navigation
fix(ci): repair ktlint violations and the uphold unit-test org.json classpath - #1530
Conversation
…lasspath The phase1 branch has never had a PR, so CI first ran over this code in the master-merge PR (#1525) and surfaced two pre-existing failures. check (ktlintCheck) — 23 violations across three modules, all invisible until now because the first failing task aborted the run: - import ordering in crowdnode/maya/exploredash (19 files) - one unused import (MayaConversionPreviewViewModel) - two files missing a trailing newline - one over-length line in maya's AddressParserTest; the Shelley address literal is split in two to fit 120 columns (verified byte-identical to the original) Everything except the long line was applied with ktlintFormat. build (testDebugUnitTest) — 8 of 11 uphold tests failed with "Method getJSONObject in org.json.JSONObject not mocked". android.jar ships a stub org.json whose methods throw under JVM unit tests; a real implementation had been arriving transitively from org.dashj:dashj-core, whose POM pulls org.json:json at runtime scope. Removing dashj from the uphold module took it away, and jjwt's copy is deliberately excluded so it stays out of the APK. Added org.json as an explicit testImplementation and corrected the now-misleading "provided by Android natively" comment. Production code is unaffected — a device supplies org.json. Verified: ktlintCheck clean and 118 unit tests pass across all six modules. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
bfoss765
left a comment
There was a problem hiding this comment.
Reviewed the full diff: 19 files are pure ktlint formatting (no logic changes — verified no non-import added lines). The two substantive changes are safe: (1) uphold/build.gradle adds org.json only at test scope with the APK exclude retained, restoring the real impl that dashj-core used to supply transitively; (2) the AddressParserTest Shelley address split is byte-identical to the original. No wallet-module changes, so no conflict with in-flight work. LGTM.
…t/merge-kotlin-sdk-master Picks up phase1's CI repair (#1530) and the post-cutover completeness work (11.10.36 / AAR v41int11), so this branch now builds against the SDK version phase1 expects. Conflicts (9 across 8 files), mostly import collisions from both sides being ktlint-formatted independently. Two were substantive: - NotificationItemPayment: phase1 reintroduced a `* 1000` on getDate() that master had deliberately removed. Every other NotificationItem returns true epoch millis (Contact -> usernameSearchResult.date, Stub -> currentTimeMillis, UserAlert -> createdAt), so the multiplier would push payment rows ~1000x into the future in the mixed-type sort and break relative-time rendering. Resolved by keeping phase1's new SDK-only support (the txId property deriving from correctedDisplay.rowId, so a post-cutover row works without a dashj Transaction) on master's millis scale, with a comment against reintroducing it. - maya AddressParserTest: master replaced the fabricated Cardano address with a real CIP-19 mainnet vector and now asserts the old one is INVALID. #1530 had merely reformatted that literal to fit 120 columns, so master's version supersedes it and was taken wholesale. Also fixes two ktlint problems this branch's earlier merge (f73bf13) introduced, which CI never reported because the crowdnode failure aborted ktlintCheck before reaching these modules: - PurchaseGiftCardFragmentV2: 4 indentation violations where phase1's neutral FiatValue lines kept master's old indentation. - MayaAddressInputViewModel: the AddressNetwork.fromId(...) line exceeded 120 columns; plus vendored-import ordering in four maya parsers. Verified: ktlintCheck clean project-wide, maya + common unit tests pass, and :wallet:compile_testNet3DebugKotlin builds against the freshly published 0.1.0-v41int11-SNAPSHOT (238 JNI exports, both ABIs). Co-Authored-By: Claude Fable 5 <[email protected]>
Makes
feat/kotlin-sdk-phase1pass CI. Both failures are pre-existing on phase1 — they only became visible now because the branch has never had a PR of its own, so #1525 is the first CI run over this code. Neither was introduced by that merge.check— ktlintCheck: 23 violations in 3 modulesCI reported only crowdnode because the first failing task aborts the run; the rest were hidden behind it. Full list:
integrations/maya(main)integrations/maya(test)integrations/crowdnode(test)features/exploredash(main)All applied with
ktlintFormatexcept the over-length line, which the formatter can't fix: the Shelley test address inAddressParserTestis now split across two literals to fit 120 columns. I verified the concatenation is byte-identical to the original, so the assertion is unchanged. (The 125-char line inside the adjacent raw string is untouched — ktlint exempts raw-string content, and editing it would change the parser's test input.)build— 8 of 11 uphold unit tests failedandroid.jarships a stuborg.jsonwhose methods throw under JVM unit tests. A real implementation had been reaching the test classpath transitively fromorg.dashj:dashj-core— its POM declaresorg.json:json:20231013at runtime scope. Phase1 removed dashj from this module, and jjwt's own copy is deliberately excluded (it must not be packaged into the APK), so nothing supplied it any more.Fix:
testImplementation 'org.json:json:20231013'— test-scope only, so the APK is unaffected — and the stale//provided by Android nativelycomment now says why unit tests are the exception. Production code was never affected: a real device suppliesorg.json, which is why this only ever showed up in unit tests.Verification
./gradlew ktlintCheck— clean./gradlew testDebugUnitTest— 118 tests, 0 failures across common, exploredash, coinbase, crowdnode, maya, uphold (uphold now 11/11, previously 8 failing)Both commands match what CI runs (
ktlint.ymlrunsktlintCheck;dashwallet.ymlrunsfastlane test→testDebugUnitTest).Once this lands on phase1, re-merging or rebasing #1525 should turn it green.
🤖 Generated with Claude Code