Skip to content

HAITI-148: Add module verification script with analysis and reporting - #6

Merged
pmanko merged 4 commits into
mainfrom
feature/HAITI-148-module-verification-script
Dec 11, 2025
Merged

HAITI-148: Add module verification script with analysis and reporting#6
pmanko merged 4 commits into
mainfrom
feature/HAITI-148-module-verification-script

Conversation

@pmanko

@pmanko pmanko commented Dec 9, 2025

Copy link
Copy Markdown
Member

Summary

This PR adds a comprehensive module verification script for analyzing OpenMRS iSantePlus modules, including version extraction, checksum calculation, and file metadata reporting.

Related Jira Ticket

HAITI-148

Changes

  • verify_modules.sh: Main script that:

    • Scans directory for .omod files
    • Extracts module ID and version from config.xml within each module
    • Calculates SHA256/MD5 checksums
    • Collects file metadata (size in bytes and human-readable format, last modified timestamp)
    • Sorts modules alphabetically by Module ID
    • Outputs formatted table to console
    • Generates CSV file with all details
    • Auto-installs missing dependencies (unzip, perl, checksum tools) via apt-get when run with appropriate permissions
  • test/test_verify.sh: Comprehensive test suite with 20 tests covering:

    • Script executability and error handling
    • CLI argument validation
    • CSV format and data integrity
    • Module ID and version extraction
    • Checksum calculation
    • File metadata collection
    • Alphabetical sorting verification
  • Demo outputs:

    • demo_output.csv: Sample CSV output
    • demo_output.txt: Sample console output

Testing

All 20 tests pass successfully. The script has been tested against the openmrs_modules-2.8.4 directory.

Usage

./verify_modules.sh [module_directory] [output_csv_file]

Example:

./verify_modules.sh ../emr-isanteplus/distribution/openmrs_modules-2.8.4 output.csv

Resolves HAITI-148

- Add verify_modules.sh script to analyze OpenMRS modules
  - Extracts module ID and version from config.xml
  - Calculates SHA256/MD5 checksums
  - Includes file metadata (size, last modified)
  - Sorts modules alphabetically
  - Outputs to console and CSV
  - Auto-installs missing dependencies via apt-get
- Add comprehensive test suite (test/test_verify.sh)
- Add demo outputs (demo_output.csv, demo_output.txt)

Resolves HAITI-148
…ectory

- Move demo_output.csv and demo_output.txt to test/ directory
- Keep main directory clean with only verify_modules.sh
- Remove stray files
- Add proper command-line argument parsing with getopts-style options
- Add --help, --version, --verbose, --quiet, --output options
- Simplify code structure while maintaining functionality
- Improve error handling and user feedback
- Update test script paths
- All 20 tests passing
- Move demo outputs to test/examples/ subdirectory
- Remove test artifact (test_output_2.8.4.csv)
- Keep structure simple: script, test script, and example outputs
@pmanko
pmanko requested a review from Copilot December 9, 2025 23:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a comprehensive module verification script for analyzing OpenMRS iSantePlus modules, including extraction of module metadata, checksum calculation, and formatted reporting capabilities.

Key Changes:

  • Adds a shell script that scans directories for .omod files, extracts module ID/version from embedded config.xml, calculates checksums, and generates both console and CSV output
  • Includes a comprehensive test suite with 20 tests validating all script functionality
  • Provides demo output examples showing expected console and CSV formats

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
projects/local-distro-analysis/verify_modules.sh Main verification script with XML parsing, checksum calculation, metadata collection, and formatted output generation
projects/local-distro-analysis/test/test_verify.sh Comprehensive test suite validating script functionality including error handling, data extraction, and output formatting
projects/local-distro-analysis/test/examples/demo_output.txt Sample console output demonstrating formatted table display
projects/local-distro-analysis/test/examples/demo_output.csv Sample CSV output showing all extracted module metadata
projects/isanteplus_installation Submodule reference added for test data
.gitmodules Git submodule configuration for isanteplus_installation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pmanko
pmanko merged commit 0945817 into main Dec 11, 2025
6 of 7 checks passed
@pmanko
pmanko deleted the feature/HAITI-148-module-verification-script branch December 11, 2025 20:29
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