Skip to content

Conversation

@emjay0921
Copy link
Contributor

@emjay0921 emjay0921 commented Oct 31, 2025

Why is this change needed?

To rename and enhance the farmer demo generator

How was the change implemented?

Renamed the old module to spp_base_farmer_registry_demo and extend the common generator from spp_demo_common.

New unit tests

Unit tests executed by the author

How to test manually

Related links


Note

Extends the demo data generator with season-aware farmer data, robust ID/phone generation and logging, UI updates, and adds extensive farmer registry tests; also normalizes Faker locales.

  • Demo Generator (spp_demo_common):
    • Add failure logging model spp.demo.data.generation.log and integrate logs into generator (new fields, counts, view page).
    • Improve ID generation from regex (groups, alternation, ranges), add regex cache, strict validation with capped retries.
    • Harden phone generation (cleanup/validation, retries, batch create), and trigger partner phone sync.
    • Update access rules and UI (tree/form; contexts for generated records).
    • Normalize Faker locales in res_country.xml (default most to en_US, set en_GB for UK).
  • Farmer Registry Demo:
    • Extend generator with farmer-specific percentages (default 100%), farm/land/asset/activity creation, and season configuration (season_* fields + date constraint).
    • Robust season create/find/activate logic; activities use ensured active season.
    • Enrich group/individual vals with farmer profile fields; set group name to family name.
    • Add generator form additions for season and percentage/limits UI.
  • Partner:
    • @api.onchange to sync phone from active phone_number_ids.
  • Tests:
    • Add comprehensive tests for generator, seasons, farm details, land records, farm assets, agricultural activities, and farmer fields.

Written by Cursor Bugbot for commit e979a10. This will update automatically on new commits. Configure here.

@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

❌ Patch coverage is 91.40753% with 105 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.94%. Comparing base (9f54353) to head (e979a10).

Files with missing lines Patch % Lines
spp_demo_common/models/demo_data_generator.py 41.37% 40 Missing and 11 partials ⚠️
..._farmer_registry_demo/models/generate_demo_data.py 54.16% 28 Missing and 5 partials ⚠️
...mer_registry_demo/tests/test_generate_demo_data.py 97.27% 3 Missing and 6 partials ⚠️
...ase_farmer_registry_demo/tests/test_land_record.py 95.72% 0 Missing and 5 partials ⚠️
spp_base_farmer_registry_demo/tests/test_farmer.py 95.78% 2 Missing and 2 partials ⚠️
...base_farmer_registry_demo/tests/test_farm_asset.py 97.60% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             17.0     #860      +/-   ##
==========================================
+ Coverage   79.83%   80.94%   +1.11%     
==========================================
  Files         805      812       +7     
  Lines       23050    24230    +1180     
  Branches     2727     2806      +79     
==========================================
+ Hits        18402    19614    +1212     
+ Misses       3979     3904      -75     
- Partials      669      712      +43     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 4, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots

See analysis details on SonarQube Cloud

@emjay0921 emjay0921 marked this pull request as ready for review November 14, 2025 02:23
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on November 17

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@gonzalesedwin1123 gonzalesedwin1123 merged commit 3daab1a into 17.0 Nov 14, 2025
12 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants