Derive provider_summary from the declared family panels
JA
6d ago+68+68+01234567890123456789-131-131-012345678901234567890123456789
Summary
Provider kit Track A, A5: SettingsHelper#provider_summary is derived from the declared family panels instead of carrying one when branch per provider.
Part of jaysbeekay/sure#670. Stacked on jaysbeekay/sure#689 (A4); built on the fork first and sent upstream as part of Track A's native stack on top of we-promise/sure#5005.
Upstream: we-promise/sure#5082 (same commits), in Track A's native stack we-promise/sure#5087.
What changed
- A provider whose adapter declares
panel:(so it is inFAMILY_PANEL_KEYS) is summarised from its@<key>_items::offwithout items, otherwisesync_based_summary. Only the providers whose summary really differs keep a branch: Plaid and Plaid EU (configuration form), SnapTrade (OAuth-configured items only), Enable Banking, TrueLayer and Trade Republic (custom summaries). - The
provider:familygenerator no longer patchesprovider_summary:append_provider_summary_caseand its two tests are deleted. A generated provider withpanel: truegets its summary from the declaration; the generator guide says so. - Diff: +68 / −131 (non-test +22 / −112).
No visible change.
Demo data
No demo data needed.
Migration notes
No migration.
Verification
- Old vs new (Rails runner, old helper loaded as a separate module): 256 cases over 32 keys (28 declared,
plaid_eu,PLAID,Brex, an unknown key) × no items / own items / every provider's items / every other provider's items × Plaid configured or not: 0 differences, none raising. - Fail-first: "summarises a newly declared panel provider from its items" (old:
:off) and "is off for a provider whose panel is not declared" (old::ok) both failed for that reason before the change. - Mutations, each caught: drop the panel guard; drop the SnapTrade filter; drop each of the Enable Banking, TrueLayer and Trade Republic branches; skip the Plaid branch; drop
plaid_eu;itemsinstead ofitems&.any?; nodowncase; ignore the configuration key (&.first). eager_load!clean.bin/rails test(full): 15,874 runs, 0 failures; 8 errors inReleaseNotesWorkflowTestfromnodemissing in the test image.bin/rubocopon changed files: no offenses.bin/brakeman: no warnings.
Blast radius
- Callers:
Settings::ProvidersController#build_provider_entriespasses every configuration key (filtered to exclude panel keys, so those stay:offapart from Plaid/Plaid EU, as before) and everyFAMILY_PANELSkey. The@<key>_itemsit reads are set byload_provider_itemsfor all 26 panel keys, in both branches.instance_variable_getruns only after theFAMILY_PANEL_KEYSguard. - Siblings left for later slices:
family_panel_items(A6) andload_provider_items(A7) read the same variables.