Skip to content

revert(change_request): restore old Add Member (#871) + Change HoH (#873) CR flows - #382

Merged
emjay0921 merged 2 commits into
19.0from
revert/871-add-member-cr
Aug 4, 2026
Merged

revert(change_request): restore old Add Member (#871) + Change HoH (#873) CR flows#382
emjay0921 merged 2 commits into
19.0from
revert/871-add-member-cr

Conversation

@emjay0921

Copy link
Copy Markdown
Contributor

Why is this change needed?

The #242 redesign of the group/membership Change Request flows made two breaking changes that downstream modules extending the old flows can no longer load or apply against:

  • Add Member (#871) dropped the create-a-new-individual detail fields (created_individual_id, given_name, family_name, birthdate, gender_id, relationship_id) in favour of an individual_id "select existing member" picker.
  • Change Head of Household (#873) replaced the single current_head_id / new_head_id fields with a per-member role table.

A downstream module that inherits spp.cr.detail.add_member / spp.cr.detail.change_hoh and their form views fails to install (ParseError: <field name="relationship_id"> … cannot be located, then the same for new_head_id) and breaks at apply time on the removed model fields.

This restores the pre-#242 Add Member and Change HoH flows so those consumers work again, while keeping the rest of #242 intact.

How was the change implemented?

  • Path-restored to the pre-#871 baseline (no functional edits): details/add_member.py, strategies/add_member.py, views/detail_add_member_views.xml, tests/test_add_member_strategy.py, details/change_hoh.py, strategies/change_hoh.py, views/detail_change_hoh_views.xml, tests/test_change_hoh_strategy.py.
  • Surgically reverted the Add-Member/Change-HoH parts of shared files, leaving the other flows untouched:
    • security/ir.model.access.csv — removed the 4 spp.cr.detail.change_hoh.member ACL rows (that model no longer exists); kept the spp.cr.type.reason.document rows.
    • tests/test_e2e_workflows.py — Add Member / Change HoH steps use the restored contracts (create-new individual + new_head_id); Create Group / Remove Member / Split Household steps unchanged.
    • spp_mis_demo_v2/models/mis_demo_generator.py — Add Member demo builds a new individual again; Change HoH demo sets new_head_id; removed the per-member-role helper.
  • Explicitly retained (additive, not part of the breakage): the per-reason Required-Documents feature that landed alongside #873 (change_request.py _get_effective_required_document_ids, change_request_type.py reason_document_ids, its view + ACLs).
  • Not touched: Create Group (#876), Remove Member (#872), Split Household (#877). The removed spp_dci_demo Add Member birth-verification extension is not reinstated here.
  • Version bumps + changelog: spp_change_request_v2 19.0.3.0.0 → 19.0.3.1.0, spp_mis_demo_v2 19.0.2.1.3 → 19.0.2.1.4.

New unit tests

None added — this restores the pre-#242 test suites for both flows (test_add_member_strategy.py, test_change_hoh_strategy.py) and the e2e workflow steps.

Unit tests executed by the author

spp_change_request_v2 full suite (Docker, -i fresh DB): 0 failed, 0 error(s) of 323 tests.

How to test manually

  1. Install/upgrade spp_change_request_v2 and spp_mis_demo_v2 — both load clean.
  2. Create an Add Member CR: first page captures a new individual (name / birthdate / relationship), apply creates the individual and the membership.
  3. Create a Change Head of Household CR: pick current_head_id / new_head_id, apply promotes the new head.
  4. Verify Create Group / Remove Member / Split Household are unchanged, and the per-reason Required-Documents config still appears on the CR Type form.

Related links

Reverts the Add Member (#871) and Change HoH (#873) portions of #242.

…873) CR flows

The #242 redesign removed the create-a-new-individual Add Member fields and
switched Change Head of Household to a per-member role table, which broke
downstream modules that extend the old flows (ParseError on the removed
relationship_id / new_head_id view fields; missing model fields on apply).

Restore the pre-#242 add_member and change_hoh detail models, strategies,
views, and tests, and adapt the MIS demo generator + e2e workflow tests to the
restored contracts. Create Group (#876), Remove Member (#872), and Split
Household (#877) are untouched, and the per-reason Required-Documents feature
that landed alongside #873 is retained.

- spp_change_request_v2 19.0.3.0.0 -> 19.0.3.1.0
- spp_mis_demo_v2 19.0.2.1.3 -> 19.0.2.1.4
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.28571% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.18%. Comparing base (38c230e) to head (555664e).
⚠️ Report is 2 commits behind head on 19.0.

Files with missing lines Patch % Lines
spp_mis_demo_v2/models/mis_demo_generator.py 50.00% 6 Missing ⚠️
spp_change_request_v2/details/change_hoh.py 96.55% 1 Missing ⚠️
spp_change_request_v2/strategies/add_member.py 92.30% 1 Missing ⚠️
spp_change_request_v2/strategies/change_hoh.py 92.85% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             19.0     #382      +/-   ##
==========================================
- Coverage   72.26%   70.18%   -2.08%     
==========================================
  Files        1011      205     -806     
  Lines       60736    17756   -42980     
==========================================
- Hits        43890    12462   -31428     
+ Misses      16846     5294   -11552     
Flag Coverage Δ
endpoint_route_handler ?
fastapi ?
spp_aggregation ?
spp_alerts ?
spp_analytics ?
spp_api_v2 ?
spp_api_v2_change_request 66.53% <ø> (ø)
spp_api_v2_cycles ?
spp_api_v2_data ?
spp_api_v2_entitlements ?
spp_api_v2_gis ?
spp_api_v2_products ?
spp_api_v2_programs ?
spp_api_v2_service_points ?
spp_api_v2_simulation ?
spp_api_v2_vocabulary ?
spp_approval ?
spp_area ?
spp_area_hdx ?
spp_attachment_av_scan ?
spp_audit ?
spp_audit_programs ?
spp_banking ?
spp_base_common 91.07% <ø> (ø)
spp_base_setting ?
spp_case_base ?
spp_case_cel ?
spp_case_demo ?
spp_case_entitlements ?
spp_case_graduation ?
spp_case_programs ?
spp_case_registry ?
spp_case_session ?
spp_cel_domain ?
spp_cel_event ?
spp_cel_registry_search ?
spp_cel_vocabulary ?
spp_change_request_v2 77.83% <95.83%> (+2.23%) ⬆️
spp_claim_169 ?
spp_cr_type_assign_program 92.07% <ø> (+0.90%) ⬆️
spp_cr_types_advanced ?
spp_cr_types_base ?
spp_dci_client_dr ?
spp_dci_client_ibr ?
spp_dci_demo 94.28% <ø> (+25.35%) ⬆️
spp_dci_indicators ?
spp_dci_server ?
spp_demo ?
spp_demo_phl_luzon ?
spp_disability_registry ?
spp_drims ?
spp_drims_sl ?
spp_drims_sl_demo ?
spp_encryption ?
spp_farmer_registry ?
spp_farmer_registry_cr 61.24% <ø> (+0.08%) ⬆️
spp_farmer_registry_demo 61.06% <ø> (+0.61%) ⬆️
spp_farmer_registry_vocabularies ?
spp_gis ?
spp_gis_indicators ?
spp_gis_report ?
spp_graduation ?
spp_grm ?
spp_grm_case_link ?
spp_grm_demo ?
spp_hazard ?
spp_hazard_programs ?
spp_hxl_area ?
spp_import_match ?
spp_indicator ?
spp_indicator_studio ?
spp_irrigation ?
spp_land_record ?
spp_metric ?
spp_metric_service ?
spp_metrics_core ?
spp_metrics_services ?
spp_mis_demo_v2 70.38% <50.00%> (-3.36%) ⬇️
spp_oauth ?
spp_program_geofence ?
spp_programs 65.27% <ø> (ø)
spp_registrant_gis ?
spp_registry 87.22% <ø> (ø)
spp_registry_group_hierarchy ?
spp_scoring ?
spp_scoring_programs ?
spp_security 69.56% <ø> (ø)
spp_service_points ?
spp_simulation ?
spp_starter_disability_registry ?
spp_starter_farmer_registry ?
spp_starter_social_registry ?
spp_starter_sp_mis 86.66% <ø> (+5.41%) ⬆️
spp_statistic ?
spp_storage_backend ?
spp_studio ?
spp_studio_change_requests 84.85% <ø> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
spp_change_request_v2/details/add_member.py 100.00% <100.00%> (ø)
spp_change_request_v2/details/change_hoh.py 97.61% <96.55%> (-2.39%) ⬇️
spp_change_request_v2/strategies/add_member.py 91.42% <92.30%> (+0.51%) ⬆️
spp_change_request_v2/strategies/change_hoh.py 89.47% <92.85%> (+1.97%) ⬆️
spp_mis_demo_v2/models/mis_demo_generator.py 62.99% <50.00%> (-4.74%) ⬇️

... and 819 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…+compute methods

Lift codecov patch coverage over the 70% target for the #871/#873 revert by
exercising the restored detail methods the strategy tests don't touch:
_onchange_names (add_member, all name branches) and _compute_current_head /
_compute_available_individuals / _onchange_new_head_id (change_hoh).
@emjay0921
emjay0921 merged commit 0f9241f into 19.0 Aug 4, 2026
34 checks passed
@emjay0921
emjay0921 deleted the revert/871-add-member-cr branch August 4, 2026 02:21
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.

2 participants