HAITI-148: Add module verification script with analysis and reporting - #6
Merged
Merged
Conversation
- 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
There was a problem hiding this comment.
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
.omodfiles, extracts module ID/version from embeddedconfig.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.
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.
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:
.omodfilesconfig.xmlwithin each moduleunzip,perl, checksum tools) viaapt-getwhen run with appropriate permissionstest/test_verify.sh: Comprehensive test suite with 20 tests covering:
Demo outputs:
demo_output.csv: Sample CSV outputdemo_output.txt: Sample console outputTesting
All 20 tests pass successfully. The script has been tested against the
openmrs_modules-2.8.4directory.Usage
Example:
Resolves HAITI-148