Skip to content

test: enable local spark e2e on android - #1980

Merged
piotr-iohk merged 15 commits into
masterfrom
codex/spark-receive
Nov 23, 2026
Merged

piotr-iohk merged 15 commits into
masterfrom
codex/spark-receive

Conversation

@piotr-iohk

@piotr-iohk piotr-iohk commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1981

Twin: synonymdev/bitkit-ios#1371
Dependency: synonymdev/bitkit-e2e-tests#317

Merge the shared E2E fixture first so the Spark workflow can use E2E main.

Description

  • Read the pinned Spark operator and chain settings in local debug E2E builds.
  • Add Spark to the local E2E nightly. Its scheduled and manual runs build the configured app and runs the shared @spark_1 case on the emulator.
  • Post one summary after the nightly retries to #bitkit-staging-nightly. Scheduled runs post automatically and manual runs can enable post_to_slack.
  • Allow up to three attempts, with separate artifacts and a failing job if all attempts fail.
  • Cache the built Spark images by Docker revision and runner architecture. The job creates fresh test data.
  • Expose the Spark balance row to Appium.

Design

N/A.

Preview

N/A.

QA Notes

Setup

Use the shared Spark fixture instructions in the E2E dependency. Local E2E Nightly runs at 05:35 UTC and can also be dispatched manually. Set e2e_branch to select a companion ref.

Journeys

N/A.

Manual Tests

N/A.

Automated Checks

  • The local E2E nightly runs only @spark_1. It pays a 10,000-sat invoice and verifies the received activity and the Spark spending balance.

Evidence

  • @spark_1 passed on the local Android emulator against Docker revision a73f84c.

  • just compile, just test, and just lint passed.

  • The Spark-only dispatch ran one case and passed. Android CI

  • actionlint passed. The workflow uses the dedicated Spark setup and matches the regular E2E retry and recording settings.

  • A real image archive started the pinned fixture locally. Hit, miss, invalid archive, and save failure checks passed.

  • Android CI passed @spark_1 on the cold and warm runs. Restoring images reduced fixture setup from 24m 19s to 7m 44s. Cold run, Warm run

  • The updated job-level Slack format passed the shared tests and actionlint. A prior end-to-end run from this draft branch passed @spark_1 and delivered its report to Slack. Draft-branch run

  • At 02aeced, just compile and just lint passed. The unit suite passed 6,240 tests and skipped two opt-in hosted-regtest tests. Coverage includes the local operator configuration, chain selection, exit hosts and funding eligibility.

  • Actionlint and 36 local workflow checks passed for the cache and diagnostic changes. They covered exact branch selection, cold and warm cache paths, missing archives and failed attempts rescued by retries.

  • The Android 15 review run passed @spark_1 at bf71399, before the review fixes.

  • A rebuilt 02aeced passed @spark_1 on an Android 15 emulator with the pinned fixture. The 10,000-sat payment appeared in activity, total spending and the Spark balance row. Review and recording

  • All seven regular Android E2E shards passed on the first attempt at 02aeced.

  • At 4909f8d, just compile, just test and just lint passed. The suite passed 6,241 tests and skipped the two opt-in hosted probes. A regression test covers a slash-only fixture URL. Actionlint passed, and the nightly log collection step retained the failed and recovered attempt markers across 600 intervening log lines in a local check.

Gaps

GitHub activates the new nightly after it lands on the default branch. At 02aeced, the exit and payout clients have unit coverage and the fixture read endpoints were checked live. A full exit or withdrawal has yet to be exercised on a device. The shared Savings/hardware funding option stays disabled in local Spark builds because each wallet can use its own Electrum server.

Models used

  • Planning and scoping gpt-6.2-sol (reasoning high)
  • Implementation gpt-6.2-sol (reasoning high), gpt-6.2-astra (reasoning ultra)
  • Review gpt-6.2-sol (reasoning high), gpt-6.2-astra (reasoning ultra)

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Regtest APK

Built from b87435e (run).

Download bitkit-dev-debug universal APK (expires in 30 days).

@ovitrif

ovitrif commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Spark goes to production in 3.2.0, so its end-to-end tests are part of the release. This PR now closes #1981, which tracks it in milestone 3.2.0. The shared fixture and @spark_1 case in synonymdev/bitkit-e2e-tests#317 merge first.

@piotr-iohk
piotr-iohk marked this pull request as ready for review November 20, 2026 10:58
@greptile-apps

greptile-apps Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest change appears safe to merge.

Summary

Adds local Spark E2E support on Android.

  • Android's nightly run tests Spark against the local fixture.
  • Local Android E2E builds can connect Spark to the pinned fixture.

The latest change only moves the isComplete getter. No new issues were found, and the full-PR rule check found no violations.

Reviews (5) · Last reviewed commit: "style: put the local Spark settings comp..." · Reviewed by Greptile

Copy link
Copy Markdown
Collaborator Author

@greptileai please review bf71399. It updates the nightly retry step names used by the shared reporter.

@ovitrif

ovitrif commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Added the Closes #1981 line back to the top of the description. It links this PR to its 3.2.0 tracking issue, which closes when this PR merges.

@talosmachina talosmachina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No findings. Reads the pinned Spark operator config and chain URL in debug local-E2E builds, tags the Spark balance row for Appium, and adds the Android local nightly with retries, image cache and Slack summary. Reviewed bf71399, full tier.

What I checked, and 4 candidates I ruled out

Read in full: SparkService.kt connect path and localSparkChainUrl, build.gradle.kts hunks, SparkDetailScreen.kt hunk, .github/workflows/e2e-local-nightly.yml; for context Env.kt chain helpers, SparkPayoutChain.kt, SparkExitChain.kt
Build: not built here; on the Bitkit track Android is reviewed from the code and from CI
CI: build-and-test, lint, detekt, build-local and the settings E2E shard green; compose-ui and the other E2E shards still running at review time

Ruled out

  • Local settings in a release build: localSparkChainUrl runs only when Env.isDebug, the local E2E backend and Spark regtest all hold, and the BuildConfig fields default to empty.
  • Half-configured fixture: require fails the connect when only one of the two values is set, rather than mixing hosted and local services.
  • Exit and payout lookups on another chain: SparkExitChain.defaultHosts and SparkPayoutChain.esploraUrl still read Spark's hosted regtest in a local build (iOS aligned these in synonymdev/bitkit-ios#1371 at 5291501). Only debug local-E2E builds reach it and @spark_1 never exercises exits or payouts, so it is below the bar for this PR.
  • Retry artifacts and logs: all attempts write under artifacts/ and one always() upload keeps them; the Slack job runs on schedule or opt-in dispatch only.

Merge confidence: 4/5, no findings, but compose-ui and most E2E shards were still running and the branch was not built here.

Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the session does not surface the setting to the reviewer)

@piotr-iohk
piotr-iohk requested review from a team, coreyphillips and ovitrif and removed request for a team November 20, 2026 11:42

@coreyphillips coreyphillips left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two independent reviews.

worth doing, does not block

  • Exit and payout chain lookups ignore the local Spark chain (app/src/main/java/to/bitkit/services/SparkService.kt:185-190)
  • Spark fixture logs are lost when a retry rescues a failed attempt (.github/workflows/e2e-local-nightly.yml:147-151)
  • Failed nightlies discard successfully built Spark images (.github/workflows/e2e-local-nightly.yml:71-83)

nits

  • localSparkChainUrl hides its config mutations behind a getter name (app/src/main/java/to/bitkit/services/SparkService.kt:212-223)
  • Trailing comma after the last modifier = argument (app/src/main/java/to/bitkit/ui/settings/lightning/SparkDetailScreen.kt:138)

the reviewers disagree, your call

  • Manual companion runs can populate the nightly Spark image cache (.github/workflows/e2e-local-nightly.yml:71-75)

Comment thread .github/workflows/e2e-local-nightly.yml Resolved
Comment thread .github/workflows/e2e-local-nightly.yml Resolved
Comment thread .github/workflows/e2e-local-nightly.yml Resolved

@ovi-reviewer ovi-reviewer 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.

Verdict: ✅ Approve

Findings: No new findings. Existing nonblocking points are covered in the earlier review.

QA for bf71399:

Receive a Lightning payment into Spark ✅ A 10,000-sat payment appears in received activity and both spending balances.

Built the reviewed source and ran @spark_1 on an Android 15 emulator, using the pinned local regtest fixture at a73f84c and the shared test at 0bffc49. The case checks zero initial Spark balance, pays a fresh invoice, and verifies the activity, total spending balance and SparkBalance row.

spark-receive.2x.mp4

Spark Lightning receive, shown at 2× speed.

Check: Local nightly workflow ✅ Workflow lint and shared summary checks passed.

actionlint accepted the workflow. The shared reporter checks passed. Retry exhaustion and reporting gates were checked in code; the earlier workflow run passed at 5fb7d15. Workflow execution was not repeated at bf71399, and scheduled activation remains an after-merge check.

Reviewed the full 7bfbdb6..bf71399 diff, all four changed files. Only the Spark receive case was driven; no device cases remain unrun.

Twin: bitkit-ios#1371 test: enable local Spark E2E on iOS matches the local receive configuration and SparkBalance selector. iOS also shares its local chain selection with funding and exit helpers.


Reviewed by gpt-6.1-sol-high

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utAck

Copy link
Copy Markdown
Collaborator Author

@greptileai please review 02aeced. It aligns the SDK and app-side regtest endpoints, saves the image cache after fixture setup, and retains logs from recovered retries.

@ovi-reviewer ovi-reviewer 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.

Verdict: ✅ Approve

Findings: No new findings. The six points in the earlier review are addressed.

QA for 02aeced:

Receive a Lightning payment into Spark ✅ A fresh 10,000-sat payment appears in received activity and both spending balances.

Rebuilt the reviewed head and passed @spark_1 on Android 15 with the pinned Docker fixture and shared test. The case verifies zero initial Spark balance, a new invoice, received activity, total spending and the SparkBalance row. The app log confirms that Spark connected to the fixture chain URL.

spark-receive.2x.mp4

Spark Lightning receive, shown at 2× speed.

Check: Shared Spark chain selection ✅ Configuration and exit-host regression tests passed; fixture read endpoints are compatible.

just compile, just test and just lint passed. The changed Spark tests executed successfully, covering complete and partial fixture settings, hosted defaults, network isolation and the conservative funding guard. Live fixture reads returned the expected tip, fees, address and transaction response shapes. Exit package-broadcast compatibility was checked against the running fixture's handler source; no exit or withdrawal was driven on a device. The existing hosted-regtest probes remain opt-in and were skipped.

Check: Nightly cache and retry diagnostics ✅ Workflow lint, branch selection and cache/retry condition checks passed locally.

The branch detector permits only the actual shared main branch to save images. The save gate requires a ready archive and a cache miss; saving precedes the app build and tests. Recovered early failures now collect fixture logs, while the final test attempt still fails the job when exhausted. actionlint passed. GitHub workflow execution was not repeated; scheduled activation remains an after-merge check. The unchanged shared reporter was checked in the previous review.

Reviewed the bf71399..02aeced delta, all ten changed files, and the earlier review threads. No requested device cases remain unrun. Cache behavior and app-side exit/payout routing were checked as described above.

Pair PR: bitkit-ios#1371 test: enable local Spark E2E on iOS also shares fixture chain access. Android keeps local cross-wallet funding disabled; iOS enables it only when the Savings and hardware Electrum endpoints match the fixture.


Reviewed by gpt-6.1-sol-high

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utAck

Copy link
Copy Markdown
Collaborator Author

@talosmachina please re-review 02aeced. The update routes Spark exit and payout reads to the pinned chain, keeps local cross-wallet funding gated, and addresses the nightly cache and retry diagnostics. All required checks passed.

@talosmachina talosmachina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-review of 02aeced after bf71399. 0 earlier findings; the candidate I ruled out last time as below the bar (exit and payout reads on Spark's hosted regtest in a local build) is now fixed. 0 new findings. Full tier.

What I checked, and 4 candidates I ruled out

Diff read: Env.kt (LocalSparkSettings, sparkChainServiceUrl, sparkRegtestEsploraUrl, sparkSharesNodeChain), SparkService.configureLocalSpark and the connect path, SparkExitChain.defaultHosts, SparkPayoutChain.esploraUrl, the nightly workflow hunks, and the four test files
Call sites traced: defaultHosts (SparkExitRepo.kt:164, default arg) and esploraUrl(Env.network) both now resolve through Env.sparkRegtestEsploraUrl(), so exits, payouts and the SDK read the same chain in a local build; every Env.sparkSharesNodeChain reader (ContentView, TransferViewModel, SparkExitRepo, SparkExitViewModel) gets false whenever local Spark is configured
Build: not built here; on the Bitkit track Android is reviewed from the code and from CI
CI: green, including build-and-test, lint, detekt, compose-ui and all eight local E2E shards

Ruled out

  • Hosted regtest broken by the refactor: with no local settings sparkRegtestEsploraUrl returns the same sparkinfra URL as before, and sparkChainServiceUrl(REGTEST) stays null, so hosted regtest is unchanged (SparkChainServiceTest, SparkExitChainTest).
  • Half-configured fixture reaching exits: an incomplete pair makes sparkRegtestEsploraUrl null, so defaultHosts and esploraUrl return null instead of mixing chains, and configureLocalSpark already fails the connect.
  • Cache saved from a feature branch: the save step needs the shared E2E checkout on main, a cache miss and a non-empty tar; restore and save are both continue-on-error.
  • Logs missed on a passing retry: attempt 2 and 3 rerun only what failed before, so any failed attempt sets test1 to failure and the collect step runs.

Merge confidence: 4/5, no findings and CI green, but the nightly workflow changes only run on schedule, not in this PR's CI.

Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the session does not surface the setting to the reviewer)

@coreyphillips coreyphillips left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rechecked after 1 new commit (02aeced). Nothing blocking remains.

addressed

  • Exit and payout chain lookups ignore the local Spark chain (app/src/main/java/to/bitkit/services/SparkService.kt:185-190). Fixed: All three paths now resolve the same URL from Env.localSparkSettings. SparkExitRepo.kt:164 calls defaultHosts with the default regtestUrl = Env.sparkRegtestEsploraUrl() (SparkExitChain.kt:174-186), SparkPayoutChain.isMined goes through esploraUrl(Env.network) (SparkPayoutChain.kt:32-41), and connect uses Env.sparkChainServiceUrl (SparkService.kt:195-196). sparkSharesNodeChain is now explicitly false in local Spark builds (Env.kt:161-164). I traced every caller and read the new SparkChainServiceTest and SparkExitChainTest cases; CI build-and-test (testDevDebugUnitTest) is green at 02aeced.
  • Spark fixture logs are lost when a retry rescues a failed attempt (.github/workflows/e2e-local-nightly.yml:147-151). Fixed: Collect Spark logs now runs on failure() || steps.test1.outcome == 'failure' || steps.test2.outcome == 'failure' (e2e-local-nightly.yml:171-172). outcome is the raw result before continue-on-error, so a recovered retry now triggers collection. I read this against the step ids test1/test2. The separate question of what --tail 200 keeps after a passing retry is a new finding below.
  • localSparkChainUrl hides its config mutations behind a getter name (app/src/main/java/to/bitkit/services/SparkService.kt:212-223). Fixed: The helper is now configureLocalSpark(config, settings): ChainApiType (SparkService.kt:104-111). It takes explicit settings, so the mutation is visible at the call site (line 195). SparkServiceTest.kt:134-161 covers the complete, absent, incomplete and invalid-Base64 cases. Those tests ran green in CI build-and-test at 02aeced.
  • Trailing comma after the last modifier = argument (app/src/main/java/to/bitkit/ui/settings/lightning/SparkDetailScreen.kt:138). Fixed: SparkDetailScreen.kt:138 now reads modifier = Modifier.testTag("SparkBalance") with no trailing comma. I read the file at HEAD.
  • Manual companion runs can populate the nightly Spark image cache (.github/workflows/e2e-local-nightly.yml:71-75). Fixed: e2e-local-nightly.yml:54-60 sets save-cache=true only when the shared checkout's HEAD is refs/heads/main, and the save step at lines 99-107 requires it. A companion ref can therefore restore the cache but never write the key the nightly reads. actions/checkout runs checkout -B <branch> for a branch ref, so main gives a symbolic HEAD, while a tag or SHA gives a detached one.
  • Failed nightlies discard successfully built Spark images (.github/workflows/e2e-local-nightly.yml:71-83). Fixed: The single actions/cache step is now cache/restore (line 79) plus an explicit cache/save (line 99). The save runs right after Start pinned Spark fixture and before the APK build and test attempts, so a later failure no longer discards a cold build. It is gated on a non-empty archive, a cache miss and a primary key, and it keeps continue-on-error.

new since the last review

worth doing, does not block

  • Logs collected after a rescued retry may not reach the failed attempt (.github/workflows/e2e-local-nightly.yml:171-176)

the reviewers disagree, your call

  • A slash-only Spark fixture URL falls back to hosted regtest (app/src/main/java/to/bitkit/env/Env.kt:58-60)

Comment thread .github/workflows/e2e-local-nightly.yml Resolved
Comment thread app/src/main/java/to/bitkit/env/Env.kt Resolved
@ovitrif ovitrif changed the title test: enable local Spark E2E on Android test: enable local spark e2e on android Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

@greptileai @talosmachina please re-review 4909f8d. The nightly now keeps the full timestamped fixture log across retries, and a slash-only fixture URL is rejected as incomplete. Both follow-up threads have fixes and regression evidence.

@talosmachina talosmachina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-review of 4909f8d after 02aeced. 0 earlier findings of mine; the two points raised on 02aeced (retry logs capped at 200 lines, slash-only fixture URL) are both fixed. 0 new findings. Full tier.

What I checked, and 3 candidates I ruled out

Diff read: e2e-local-nightly.yml log step, LocalSparkSettings.fromInputs and the Env.localSparkSettings call site, the new case in SparkChainServiceTest
Traced: an incomplete LocalSparkSettings through SparkService.configureLocalSpark (require(settings.isComplete) fails the connect), Env.sparkChainServiceUrl(REGTEST) and sparkRegtestEsploraUrl (both null, so exit and payout clients get no host), and sparkSharesNodeChain (false whenever settings are non-null)
Companion: spark-logs in synonymdev/bitkit-e2e-tests#317 (codex/spark-receive) is compose --profile spark logs "$@", so --timestamps passes straight to docker compose logs and dropping --tail returns every line of the run's fresh fixture
Build: not built here; on the Bitkit track Android is reviewed from the code and from CI
CI: build-and-test, lint, build-local and compose-ui still running on 4909f8d at review time

Ruled out

  • Slash-only URL still falling back to hosted regtest: the blank check now runs on the raw inputs, so "/" yields settings with an empty URL, isComplete is false and the connect is rejected; the new test asserts sparkRegtestEsploraUrl is null for it.
  • Trailing-slash URL treated as different: fromInputs still trims, and the test asserts equality with the unslashed settings.
  • Unbounded log output breaking the step: the fixture lives for one job, the step ends in || true, and the file goes to the artifact, not the job log.

Merge confidence: 4/5, the nightly log change runs only on the scheduled workflow, so no PR check exercises it, and CI on this head had not finished at review time.

Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed

@ovi-reviewer ovi-reviewer 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.

Verdict: ✅ Approve

Findings: No new findings. Both follow-up points are addressed.

QA for 4909f8d:

Check: Reject incomplete Spark fixture input ✅ Slash-only input stays incomplete instead of falling back to hosted regtest.

The regression checks slash-only input, blank input and a valid URL with a trailing slash. Incomplete settings are rejected by SDK configuration and provide no app-side regtest host. The unit suite passed, including Spark configuration, chain-selection and exit-host regressions. The existing opt-in hosted-regtest probes were skipped. just compile, just test, just lint and just build passed at the reviewed head.

Check: Preserve failure logs through a successful retry ✅ The collection smoke check retained the early failure and later success across 600 intervening events.

Ran the exact workflow collection block through the pinned shared wrapper with simulated Compose output. The full timestamped log retained both markers; the previous --tail 200 command lost the early failure. actionlint passed. This checks command forwarding and retention; GitHub workflow execution was not repeated. Scheduled activation remains an after-merge check.

Check: Previously verified Spark receive ✅ The passing receive evidence remains applicable to valid fixture settings.

The Android 15 run at 02aeced recorded a 10,000-sat payment in received activity, total spending and the Spark balance row. This delta preserves normalization for complete valid settings and leaves the SDK setup, receive flow and shared @spark_1 case unchanged. No device case was repeated. A full exit or withdrawal remains outside the driven coverage, as recorded in the PR's gaps.

Reviewed the contiguous 02aeced..4909f8d delta, all three changed files and the follow-up threads. Invalid fixture input and workflow diagnostics were checked without a device; no requested device cases remain unrun.

Twin: bitkit-ios#1371 test: enable local Spark E2E on iOS matches valid fixture configuration and receive coverage. iOS saves bounded logs immediately after failed retries; Android retains the full timestamped fixture history.


Reviewed by gpt-6.1-sol-high

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utAck

@coreyphillips coreyphillips left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rechecked after 1 new commit (4909f8d). Nothing blocking remains.

addressed

  • Logs collected after a rescued retry may not reach the failed attempt (.github/workflows/e2e-local-nightly.yml:171-176). Fixed: e2e-local-nightly.yml:176 now runs spark-logs --timestamps with no tail. At #317 head 0bffc49, spark-logs expands to compose --profile spark logs "$@", so this returns every line since the containers started. run-spark-e2e.sh neither restarts nor recreates the fixture between attempts, so attempt 1's window survives a passing retry. The step's condition still fires on steps.test1.outcome == 'failure'.
  • A slash-only Spark fixture URL falls back to hosted regtest (app/src/main/java/to/bitkit/env/Env.kt:58-60). Fixed: Env.kt:19-22 checks the raw inputs before trimming. fromInputs("", "/") therefore returns LocalSparkSettings("", ""), which has isComplete == false. configureLocalSpark then fails its require (SparkService.kt:105), and sparkRegtestEsploraUrl returns null. The new test in SparkChainServiceTest.kt:15-21 asserts this, and build-and-test passed on 4909f8d.

new since the last review

nits

  • Companion object in LocalSparkSettings sits below the class's property (app/src/main/java/to/bitkit/env/Env.kt:15-23)

Comment thread app/src/main/java/to/bitkit/env/Env.kt Resolved

Copy link
Copy Markdown
Collaborator Author

@greptileai @talosmachina please re-review b87435e. This moves the isComplete getter below its companion object in LocalSparkSettings. The Android compile, unit suite and lint passed.

@talosmachina talosmachina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-review of b87435e after 4909f8d. 0 earlier findings of mine, 0 new. The commit moves LocalSparkSettings.isComplete below the companion object, which answers @coreyphillips's ordering point. Light tier: 4 changed lines in one file.

What I checked

Diff read: git diff 4909f8d b87435e, Env.kt only, 2 lines moved
Behaviour: isComplete is a custom getter with no backing field, so moving it changes no initialisation order; fromInputs and both constructor properties are untouched
Build: not built here; on the Bitkit track Android is reviewed from the code and from CI
CI: build-local green; build-and-test, lint, compose-ui and the local E2E shards still running on b87435e at review time

Merge confidence: 4/5, the nightly log change runs only on the scheduled workflow, so no PR check exercises it, and CI on this head had not finished at review time.

Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed

@ovi-reviewer ovi-reviewer 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.

Verdict: ✅ Approve

Findings: None. The companion-object ordering feedback is addressed.

QA for b87435e:

Check: Preserve local Spark configuration after member reorder ✅ Configuration and chain-selection regressions pass with unchanged settings logic.

just compile, just test, just lint and just build passed at this head. The regressions cover slash-only and blank input, valid trailing-slash normalization, incomplete fixture settings, hosted defaults and exit-host selection. The two existing opt-in hosted-regtest probes were skipped.

Check: Previously verified Spark receive ✅ The recorded `@spark_1` pass remains applicable.

The Android 15 run at 02aeced recorded a 10,000-sat payment in received activity, total spending and the Spark balance row. This delta only relocates the same computed getter; its expression, the settings factory, SDK setup, receive flow and shared case are unchanged. No device case was repeated.

Check: Previously verified nightly diagnostics ✅ The workflow is unchanged from the passing log-retention check.

The review at 4909f8d verified the exact collection block and shared wrapper with simulated Compose output: the early failure and later success survived 600 intervening events. It also passed actionlint. That workflow is byte-identical at this head, so those checks were not repeated. GitHub workflow execution was not repeated; scheduled activation remains an after-merge check.

Reviewed the contiguous 4909f8d..b87435e delta, its single changed file and the follow-up thread. The member reorder was checked without a device; no requested cases remain unrun. A full exit or withdrawal remains outside driven coverage, as recorded in the PR's gaps.

Twin: bitkit-ios#1371 test: enable local Spark E2E on iOS matches valid local fixture configuration and receive coverage. Android keeps local cross-wallet funding disabled; iOS enables it only when the Savings and hardware Electrum endpoints match the fixture.


Reviewed by gpt-6.1-sol-high

@coreyphillips coreyphillips left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rechecked after 1 new commit (b87435e). Nothing blocking remains.

addressed

  • Companion object in LocalSparkSettings sits below the class's property (app/src/main/java/to/bitkit/env/Env.kt:15-23). Fixed: The companion object is now the first member of LocalSparkSettings in Env.kt:15-21, and isComplete follows it at line 23 with the same expression. git diff 4909f8d..HEAD shows only those two lines moving. isComplete is a computed getter, so the move has no effect on initialization. detekt's ClassOrdering is inactive in config/detekt/detekt.yml:543, so lint is unaffected.

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utAck

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No issues found at b87435edb. I reviewed this as a funds change, since it touches SparkService, Env, the exit and payout chain selection and the build config, not only tests.

Checked and clean:

  • No local fixture leaks into tnet or mainnet. Env.localSparkSettings (Env.kt:65-69) is the only reader of SPARK_LOCAL_*, and it returns null unless the build is debug, on the local E2E backend and on regtest. Release builds and the mainnet/tnet debug builds fail that check.
  • Mainnet exit and payout still use bitkitEsploraUrl. With null settings, configureLocalSpark returns before touching the config, and the mainnet branches of defaultHosts and esploraUrl are unchanged.
  • Hosted regtest uses the same Spark URL master hard-codes. A complete fixture sends the SDK, exits and payouts to one URL. A partial fixture fails closed: connect throws, and the exit and payout hosts are null.
  • An unset env var becomes "", fromInputs("", "") returns null, and the build falls back to the hosted defaults.
  • The nightly workflow exposes no secrets. Permissions are contents: read, packages: read. The Slack webhook is used only in slack-report, which checks out bitkit-e2e-tests main. inputs.e2e_branch is never interpolated into a run: script.
  • iOS twin synonymdev/bitkit-ios#1371: the two-chain finding was fixed here at 02aeced. The rerun-artifact and second-Compose-project findings don't apply to Android, which runs on ephemeral ubuntu-latest.

The scheduled nightly checks out bitkit-e2e-tests main, so synonymdev/bitkit-e2e-tests#317 has to merge first.

Device gate: no device check needed. There is no UI or journey change, and it is not performance-relevant. Skipped, covered by CI at b87435edb: unit tests, lint, detekt and the local e2e suites (all green). A full Spark exit against the local fixture is still not driven by anyone, as the PR's Gaps section says.
perf: not relevant

Reviewer model: claude-fable-5-2 (primary), claude-opus-5-5 (verification and coordination)
Reasoning effort: Not exposed

@piotr-iohk
piotr-iohk merged commit cf5cdd4 into master Nov 23, 2026
25 checks passed
@piotr-iohk
piotr-iohk deleted the codex/spark-receive branch November 23, 2026 08:51
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.

test: spark end-to-end coverage

5 participants