Merge upstream/main into main (weekly sync, 2026-11-02)

Merged
JA
1mo ago
+56755-4071

Closes #606.

Merges 153 upstream commits up to 3ce2afd73 into fork main. 88 files conflicted.

Decision to check first

The last sync (#464) stopped before we-promise/sure#3639, by owner decision, so that #478 could converge the fork's loan code first. #478 is parked, and the range now starts at #3639, so this sync can't stop before it. It takes everything except upstream's loan engine, and keeps the fork's loan code as every sync since #185 has. Loans stay diverged until #478 lands.

For #478: its migration records 20260918210000 in schema_migrations, and that row now exists after this sync. Its checklist note about making this migration tolerant is done here; the insert needs checking when #478 is rebased.

Fork issues

IssueState after this merge
#442 filter chips show UUIDsFix present (upstream cd906af98, account_ids in _badge.html.erb)
#588 get_holdings crash on a security filterFixed by upstream; its tests pass here
#267 prices fetched after positions closeUpstream #3888 is in this range
#249 holdings ignore stock splitsUpstream #3850 is in; the issue's later slices remain open
#188 loan day-countNot fixed: stays open, #3639's engine isn't taken

None of these is closed by this PR except #606.

Non-obvious resolutions

Loans: fork side, whole file. loans_controller, Loan, AmortizationSchedule, PayoffProjection, Simulator, the Plaid loan processors and LoanTermWriter, RedbarkAccount::LoanDetailsProcessor, the loan form and Extra repayments tab, loan_payoff_chart_controller.js, the account page's chart wiring and their tests.

  • Left out: Loan::PayoffChart, LoansHelper, Loan::ExtraRepayment, and their tests. Nothing on the merged tree uses them.
  • Taken from upstream's loan changes: the Plaid sync date is now the family's date (family.local_date), and a rate from an import that stopped for a fresh login is no longer dated as a change. That guard is ported into the fork's LoanTermWriter.

20260918210000_add_day_count_convention_to_loans. The fork's 20260907000000 already added this column, with its own default and check. Upstream's plain add_column would raise on it, and its rollback would drop it. On the fork, up skips an existing column and down does nothing. schema.rb keeps the fork's actual_365 default and two-value check.

Goals. The fork's rule from #299 stays: nothing re-bases a goal. Upstream's default_progress_basis_for_market_accounts is left out, and three of its tests are dropped or inverted. goals.md keeps the fork's basis text plus upstream's note on bare-balance accounts.

Recurring. matcher_names (fork, #503) now also includes upstream's matcher_name, so a renamed bill keeps its detected name as well as its aliases. Identifier keeps identity_keys. Upstream's locking around "mark as recurring" and declared bills, and its income wording, are taken. That moves recurring_transactions.already_covered to upstream's wording, since a covering series may be income.

Reports: two behaviour changes from upstream's tests.

  • build_realized_gains now reads Current.user.finance_accounts.included_in_reports, so another member's unshared disposal isn't listed.
  • Portfolio::RealizedGains now skips excluded entries. This also changes the portfolio hub, which reads the same class. No hub test objected, but it's a figure change on that page for anyone with an excluded sale.

Assistant. get_accounts reports a variable loan's repayment from the fork's current_minimum_payment, as the Overview tab does, because the fork's schedule has no payment_in_force. The test is changed to match.

Name clashes git didn't flag.

  • The fork's spending_money helper shadowed upstream's new one with a different signature and broke Reports. The fork's is renamed narrative_money.
  • Duplicate locale keys are removed, keeping the fork's text: loans.form.day_count_*, accounts.show.tabs.extra_repayments, and one identical model_required_help.
  • AccountsControllerTest had two tests in both versions; one copy is kept.

get_holdings_test. The fork's lot tests and upstream's filter tests need different setups, so upstream's sit in a second class in the same file.

ci.yml. Upstream's ubuntu-24.04 and 20-minute cap are taken for test_unit, in place of the fork's 15.

Migrations

Eleven from upstream, including 20260918210000 above.

  • Fork-state database: schema.rb from main, with these eleven pending, then db:migrate. This regenerated the committed schema.rb.
  • Empty database: db:migrate dumps an identical file, but Rails 8.1 loads schema.rb on an empty database rather than running the migrations, so this only shows the schema file is consistent. It does not replay the migration history.
  • Seven upstream migrations are dated before main's schema version (20260828100000, 20260903000000, 20260918210000, 20260923120000, 20261012120000, 20261017120000, 20261020090001). db:migrate still runs them on an existing database, because it had no rows for files it didn't have. Loading main's old schema.rb with these files present would mark them as run and skip them, so don't load the old schema on this tree.
  • The check-constraint lines in the schema.rb diff are dump formatting (::character varying::text) only.
  • Still not on the fork, under the loan policy: loans.down_payment, insurance_rate, insurance_rate_type.

Dropped tests (#279 check)

Every test name in files this range adds or changes was compared with the merged tree.

  • Upstream names missing: 252. Nearly all exercise the loan engine left out above (loans_controller, payoff_chart, payoff_projection, loan_test, day_count, default_convention_baseline, extra_repayment, the Plaid and Redbark loan processors, the system chart, chart_test and demo loans).
  • The rest: three goal tests that contradict #299, and two family_test earliest_activity_date tests. Those two aren't on main either, so this merge doesn't lose them.
  • Fork names missing: 22. Twenty were removed by upstream itself. The other two were replaced by upstream's versions: SSO crumbs split into two tests, and the Jev panel, where a member now gets no endpoint field.

Checks

Run on beastpc, not yet on this PR's CI:

  • bin/rails test: 15890 runs, 73540 assertions, 0 failures, 0 errors, 39 skips
  • bin/brakeman --no-pager: 0 warnings, 0 errors
  • bin/rubocop on 517 changed Ruby files: one offence, fixed, then clean on the file concerned. The full 517 weren't rerun after that one-line fix.
  • erb_lint on 110 changed ERB files: no errors
  • biome lint on 18 changed JavaScript files: no errors

Not run locally: system tests. CI runs them here.

Known gaps

  • The account page's loan chart, day-count selection and upstream's Extra repayments tab remain upstream-only until #478.
  • Rule, provider and other non-loan upstream code was merged textually, with tests as the check on semantics, not read line by line.