Skip to content

feat: migrate 14 modules from private repo#120

Merged
emjay0921 merged 18 commits into19.0from
migrate/move-modules-from-private
Mar 19, 2026
Merged

feat: migrate 14 modules from private repo#120
emjay0921 merged 18 commits into19.0from
migrate/move-modules-from-private

Conversation

@emjay0921
Copy link
Contributor

@emjay0921 emjay0921 commented Mar 19, 2026

Why is this change needed?

Migrating modules from the private openspp-modules-v2 repo to the public OpenSPP2 repo as part of the Release V2 migration plan.

How was the change implemented?

Modules migrated (15)

Copied from openspp-modules-v2 (19.0 branch):

  • spp_land_record (Beta)
  • spp_registry_group_hierarchy (Beta)
  • spp_farmer_registry (Beta)
  • spp_farmer_registry_cr (Beta)
  • spp_farmer_registry_demo (Beta)
  • spp_farmer_registry_vocabularies (Beta)
  • spp_starter_farmer_registry (Beta)
  • spp_farmer_registry_dashboard (Alpha)
  • spp_scoring (Beta)
  • spp_scoring_programs (Beta)
  • spp_disability_registry (Beta)
  • spp_irrigation (Beta)
  • spp_attachment_av_scan (Beta)
  • spp_storage_backend (Beta)
  • spp_encryption (Beta) — added as a dependency of spp_attachment_av_scan

Code fixes applied to migrated modules

  • Deprecated <data> nodes: Replaced <odoo><data> with <odoo> and <odoo><data noupdate="1"> with <odoo noupdate="1"> in 11 XML files
  • Deprecated description key: Removed from 7 manifest files (spp_farmer_registry, spp_farmer_registry_cr, spp_farmer_registry_dashboard, spp_farmer_registry_demo, spp_scoring, spp_scoring_programs, spp_starter_farmer_registry)
  • Test folder imports: Removed from . import tests in spp_farmer_registry_cr and spp_irrigation __init__.py
  • Ruff F402: Fixed shadowed _ import in spp_scoring/models/scoring_indicator.py
  • PII in logs: Replaced .name with .id in log messages (spp_attachment_av_scan, spp_farmer_registry_vocabularies, spp_farmer_registry_demo)
  • XML ID naming: Renamed spp_change_request_type_form_activity_ops to view_spp_change_request_type_form_activity_ops
  • CodeQL high severity: Refactored URL string matching to use tuple constant in spp_encryption
  • Semgrep/Bandit: Added nosemgrep and nosec comments for expected sudo() and SQL usage in demo/infrastructure modules
  • Compliance spec: Commented out unimplemented wizard model from spp_encryption compliance.yaml
  • spp_encryption status: Promoted from Alpha to Beta

Repo-level fixes (pre-existing issues)

  • Linter: Added assessor to valid group level names in XML ID naming convention checker
  • Git LFS: Removed *.geojson LFS tracking in .gitattributes — geojson files are read at runtime by spp_demo and must remain as regular files
  • Pre-commit formatting: Applied prettier XML formatting and OCA README generation for all migrated modules

New unit tests

No new tests — existing tests from private repo are included. All 15 module test suites pass in CI.

Unit tests executed by the author

All module tests pass in CI:
spp_attachment_av_scan, spp_disability_registry, spp_encryption, spp_farmer_registry, spp_farmer_registry_cr, spp_farmer_registry_demo, spp_farmer_registry_vocabularies, spp_irrigation, spp_land_record, spp_registry_group_hierarchy, spp_scoring, spp_scoring_programs, spp_storage_backend

How to test manually

  1. Install each migrated module and verify it loads without errors
  2. Check that existing functionality works as expected
  3. Verify no duplicate modules exist between public and private repos after companion PR is merged

Related links

Modules moved:
- spp_land_record
- spp_registry_group_hierarchy
- spp_farmer_registry
- spp_farmer_registry_cr
- spp_farmer_registry_demo
- spp_farmer_registry_vocabularies
- spp_starter_farmer_registry
- spp_farmer_registry_dashboard
- spp_scoring
- spp_scoring_programs
- spp_disability_registry
- spp_irrigation
- spp_attachment_av_scan
- spp_storage_backend
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

Semgrep OSS found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request undertakes a significant migration and enhancement of several core OpenSPP modules, moving them to a public repository. The primary goal is to bolster data integrity and security through new antivirus capabilities for attachments, while also expanding and refining registry functionalities for farmers and individuals with disabilities. The changes introduce robust data classification using international standards, integrate powerful expression language for dynamic eligibility, and provide new tools for data governance and analytical insights.

Highlights

  • Antivirus Scanning for Attachments: Introduced the spp_attachment_av_scan module, providing automatic malware scanning for all file attachments using ClamAV, with features like asynchronous scanning, quarantine for infected files, security notifications, and manual rescans.
  • Comprehensive Disability Registry: Added the spp_disability_registry module, enabling the management of disability assessments (including Washington Group Short Set responses), tracking of assistive devices, and integration with CEL functions for program eligibility.
  • Enhanced Farmer Registry with FAO Vocabularies: Migrated and significantly updated the spp_farmer_registry module, incorporating FAO-aligned vocabularies for farm types, land tenure, and species (ICC crops, FAO livestock, ASFIS aquaculture), alongside new CEL variables for farm metrics and improved GIS integration.
  • Formal Change Request Workflows for Farmer Data: Implemented the spp_farmer_registry_cr module, which introduces structured change request types for modifying farm details, activities, land parcels, and assets, all managed through an approval workflow.
  • Farmer Registry Dashboard for Key Metrics: Added the spp_farmer_registry_dashboard module, providing a comprehensive overview of farmer registry data through CEL-based metrics and Odoo spreadsheet dashboards, visualizing trends and distributions.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This is a significant pull request that migrates 14 modules from a private repository, introducing substantial new features like attachment antivirus scanning, a disability registry, and a comprehensive farmer registry. The overall code quality is high, showcasing good design patterns such as the use of _inherits for model extension, a pre_init_hook for data migration, and robust security models. The implementation details, including client-side UI restrictions and comprehensive test data, are well-executed. I have a couple of minor suggestions for improvement to ensure deterministic behavior and data consistency.

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 74.86339% with 506 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.96%. Comparing base (5fba270) to head (28c9cf4).
⚠️ Report is 22 commits behind head on 19.0.

Files with missing lines Patch % Lines
spp_encryption/models/encryption_provider.py 53.30% 99 Missing ⚠️
...farmer_registry_cr/strategies/manage_farm_asset.py 14.91% 97 Missing ⚠️
...armer_registry_cr/strategies/manage_land_parcel.py 14.54% 94 Missing ⚠️
spp_attachment_av_scan/models/ir_attachment.py 80.00% 51 Missing ⚠️
spp_farmer_registry_cr/details/cr_land_parcel.py 48.38% 32 Missing ⚠️
spp_farmer_registry_cr/details/cr_farm_asset.py 51.61% 30 Missing ⚠️
spp_farmer_registry/models/farm_asset.py 68.62% 16 Missing ⚠️
spp_farmer_registry/models/farm_season.py 88.57% 16 Missing ⚠️
spp_farmer_registry/models/farm_activity.py 82.50% 14 Missing ⚠️
...bility_registry/models/cel_disability_functions.py 77.08% 11 Missing ⚠️
... and 15 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             19.0     #120      +/-   ##
==========================================
- Coverage   70.16%   69.96%   -0.20%     
==========================================
  Files         738      832      +94     
  Lines       44046    48813    +4767     
==========================================
+ Hits        30906    34154    +3248     
- Misses      13140    14659    +1519     
Flag Coverage Δ
spp_attachment_av_scan 83.75% <83.75%> (?)
spp_base_common 90.26% <ø> (ø)
spp_disability_registry 91.86% <91.86%> (?)
spp_encryption 55.55% <55.55%> (?)
spp_farmer_registry 88.39% <88.39%> (?)
spp_farmer_registry_cr 61.15% <61.15%> (?)
spp_farmer_registry_demo 54.01% <ø> (?)
spp_farmer_registry_vocabularies 39.40% <ø> (?)
spp_irrigation 95.45% <ø> (?)
spp_land_record 98.55% <ø> (?)
spp_programs 45.51% <ø> (ø)
spp_registry_group_hierarchy 91.17% <ø> (?)
spp_scoring 74.91% <ø> (?)
spp_scoring_programs 40.44% <ø> (?)
spp_security 66.66% <ø> (ø)
spp_storage_backend 79.84% <ø> (?)

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

Files with missing lines Coverage Δ
spp_attachment_av_scan/__init__.py 100.00% <100.00%> (ø)
spp_attachment_av_scan/models/__init__.py 100.00% <100.00%> (ø)
spp_disability_registry/__init__.py 100.00% <100.00%> (ø)
spp_disability_registry/models/__init__.py 100.00% <100.00%> (ø)
spp_disability_registry/models/assistive_device.py 100.00% <100.00%> (ø)
spp_disability_registry/models/registrant.py 100.00% <100.00%> (ø)
spp_disability_registry/services/__init__.py 100.00% <100.00%> (ø)
spp_encryption/models/__init__.py 100.00% <100.00%> (ø)
spp_farmer_registry/controllers/__init__.py 100.00% <100.00%> (ø)
spp_farmer_registry/controllers/main.py 100.00% <100.00%> (ø)
... and 79 more

... and 5 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.

- Add spp_encryption module (dependency of spp_attachment_av_scan)
- Fix xml-deprecated-data-node in 11 XML files
- Fix ruff F402 shadowed import in spp_scoring
- Apply prettier XML formatting
- Fix CodeQL high: refactor URL string check to use tuple constant
- Fix Semgrep errors: add nosemgrep for expected sudo on res.partner in demo generator
- Fix PII in logs: use .id instead of .name in log messages
- Fix XML ID naming: rename to view_spp_change_request_type_form_activity_ops
- Fix pylint E8130: remove test folder import from spp_farmer_registry_cr
- Fix compliance: skip wizard model ACL check (model not yet implemented)
- Fix geojson: remove LFS tracking (file read at runtime by spp_demo)
- Add 'assessor' to valid group level names in XML ID linter
- Remove deprecated 'description' key from 4 farmer registry manifests
- Add nosemgrep comments for expected sudo() usage
- Add nosec B608 for safe SQL in demo generator
- Remove test folder import from spp_irrigation
@emjay0921 emjay0921 marked this pull request as ready for review March 19, 2026 08:15
@emjay0921 emjay0921 merged commit 470aac7 into 19.0 Mar 19, 2026
31 checks passed
@emjay0921 emjay0921 deleted the migrate/move-modules-from-private branch March 19, 2026 08:16
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