fix(farmer_registry_demo): Input Subsidy uses manual entitlement approval - #412
Open
emjay0921 wants to merge 2 commits into
Open
fix(farmer_registry_demo): Input Subsidy uses manual entitlement approval#412emjay0921 wants to merge 2 commits into
emjay0921 wants to merge 2 commits into
Conversation
…manual-entitlement-approval
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 19.0 #412 +/- ##
=======================================
Coverage 71.49% 71.50%
=======================================
Files 243 243
Lines 20785 20790 +5
=======================================
+ Hits 14860 14865 +5
Misses 5925 5925
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
emjay0921
marked this pull request as ready for review
August 12, 2026 02:46
gonzalesedwin1123
approved these changes
Aug 19, 2026
gonzalesedwin1123
left a comment
Member
There was a problem hiding this comment.
Approved — this is exactly the shape these changes should take.
The substance is five lines: the generator reads auto_approve_entitlements from the program definition (defaulting True) and Input Subsidy opts out. What made this easy to approve:
- Full versioning treatment: bump to
19.0.2.1.2withreadme/HISTORY.md, the README changelog, and the regenerated HTML description. - The changelog's subtle claim is true — I verified it: Step 4b of the seeded-cycle walk (
farmer_demo_generator.py:2368) force-approves draft/pending entitlements on every generated cycle regardless of this flag, so seeded demo data is unchanged and the manual-approval behaviour surfaces exactly where the PR says it does: on cycles a demo user runs afterwards. - Tests assert through the real chain (wizard → program → cycle manager), a control program pins the default, and the invariant test ("at least one manual program exists") protects the ticket's intent against future edits to the definitions.
Three notes, none blocking:
- Version ordering with #322 — same module, both open. This PR takes
19.0.2.1.2, so #322's requested bump becomes19.0.2.1.3on top (or the reverse if #322 lands first). Code and test edits are in different regions, so it's purely a version/HISTORY reconciliation for whichever merges second. - On the reviewer note offering to strip the bump/HISTORY: please keep them. Per-PR version bumps on released modules are what the repo convention asks for (and what #441 proposes to enforce) — this PR is the model, not the exception.
- Optional: because Step 4b force-approves seeded cycles, the demo ships with zero pending entitlements out of the box — demonstrating the approval stage requires running a fresh Input Subsidy cycle (as your manual steps describe). If you want the stage visible immediately after generation, seeding the newest Input Subsidy cycle with its entitlements left pending would do it. Fine as a follow-up or not at all; the ticket is satisfied as-is.
gonzalesedwin1123
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_generatorno longer hard-codesauto_approve_entitlements: True. It reads the flag from the program definition and falls back to True, so every existing demo program is unchanged.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 withauto_approve_entitlementsoff, and the other demo programs still generate with it on.Unit tests executed by the author
Re-run after merging
19.0up (the branch was 64 commits behind):How to test manually
Related links
https://openspp.openproject.com/work_packages/1122
Reviewer notes
The branch was 64 commits behind
19.0and 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.mdentry 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.