Skip to content

fix(farmer_registry_demo): Input Subsidy uses manual entitlement approval - #412

Open
emjay0921 wants to merge 2 commits into
19.0from
fix/1122-farmer-demo-manual-entitlement-approval
Open

fix(farmer_registry_demo): Input Subsidy uses manual entitlement approval#412
emjay0921 wants to merge 2 commits into
19.0from
fix/1122-farmer-demo-manual-entitlement-approval

Conversation

@emjay0921

Copy link
Copy Markdown
Contributor

Why is this change needed?

OP#1122 — Farmer demo data: modify at least one program to not tick auto-approve entitlements. Test pass.

Every demo program auto-approved its entitlements, so a demo could only ever show the cycle-approval stage. The entitlement-approval stage — a real part of the workflow — had nothing to demonstrate it with.

How was the change implemented?

  • farmer_demo_generator no longer hard-codes auto_approve_entitlements: True. It reads the flag from the program definition and falls back to True, so every existing demo program is unchanged.
  • Input Subsidy opts out. Its cycles still go through cycle approval, so a demo can now walk the full cycle → entitlement-approval chain rather than stopping at the first stage.

Scoped deliberately to one program: the point is to have an example of each behaviour side by side, not to change the default.

New unit tests

Added to spp_farmer_registry_demo/tests/test_demo_generator.py: Input Subsidy generates with auto_approve_entitlements off, and the other demo programs still generate with it on.

Unit tests executed by the author

Re-run after merging 19.0 up (the branch was 64 commits behind):

spp_farmer_registry_demo    0 failed, 0 error(s) of 135 tests

How to test manually

  1. Install / regenerate the farmer demo data.
  2. Open Programs → Input Subsidy and confirm Auto-approve entitlements is not ticked.
  3. Open any other demo program and confirm it still is.
  4. Run a cycle on Input Subsidy through to entitlements: the entitlements must land awaiting approval rather than approved, so the approval stage can be demonstrated.

Related links

https://openspp.openproject.com/work_packages/1122

Reviewer notes

The branch was 64 commits behind 19.0 and has been brought up to date by merging, not rebasing, since it was already published — hence the merge commit.

It also carries a readme/HISTORY.md entry and a version bump made when the branch was first written. That predates the convention of keeping those on the main branch after merge; left as-is rather than rewriting published history, but happy to strip them if you would prefer.

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.50%. Comparing base (c33d3cb) to head (e70aaa8).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             19.0     #412   +/-   ##
=======================================
  Coverage   71.49%   71.50%           
=======================================
  Files         243      243           
  Lines       20785    20790    +5     
=======================================
+ Hits        14860    14865    +5     
  Misses       5925     5925           
Flag Coverage Δ
spp_base_common 91.07% <ø> (ø)
spp_farmer_registry_demo 61.06% <ø> (ø)
spp_programs 65.27% <ø> (ø)
spp_registry 87.22% <ø> (+0.07%) ⬆️
spp_security 69.56% <ø> (ø)

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

Files with missing lines Coverage Δ
spp_farmer_registry_demo/models/demo_programs.py 100.00% <ø> (ø)
...rmer_registry_demo/models/farmer_demo_generator.py 50.14% <ø> (ø)

... and 1 file 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.

@emjay0921
emjay0921 marked this pull request as ready for review August 12, 2026 02:46
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.

1 participant