# USM Manifest Validate Command ## Overview The `usm manifest validate` command validates USM packages by building and installing them in a temporary environment, then verifying all declared resources are present and correctly located. ## Usage ```bash usm manifest validate [build-path] ``` ### Arguments - `build-path`: Directory for package build (optional, auto-generated if not provided) ## Validation Process ### 1. Manifest Validation - Verifies MANIFEST.usm exists and is readable - Checks JSON syntax and required fields ### 2. Dependency Verification - Validates management dependencies are available - Checks build dependencies are satisfied - Ensures runtime dependencies exist ### 3. Package Metadata Checks - Warns if no license is provided - Warns if no markdown description is provided - Warns if no URL is provided ### 4. Build Execution - Runs build script with progress reporting - Uses silent output to reduce noise ### 5. Installation Simulation - Creates temporary install directory - Runs install script if specified - Skips installation validation if no install script exists ### 6. Resource Validation Validates each declared resource based on path base: #### as-expected Checks file exists at standard system location in temporary install directory. #### build: Checks file exists at specified path in build directory. #### source: Checks file exists at specified path in source directory. #### install: Checks file exists at specified path in install directory. ### 7. Unexpected Resource Detection Scans install directory for resources not declared in manifest and reports warnings. ## Exit Codes | Code | Description | |------|-------------| | 0 | Validation completed successfully | | 247 | Error validating installation result | | 248 | Expected resources not found | | 249 | Error running install exec | | 250 | Could not create temporary install directory | | 251 | Error running build exec | | 252 | Missing dependencies | | 253 | Could not read MANIFEST.usm | | 254 | No MANIFEST.usm file found | | 255 | Could not create temporary build directory | ## Examples ### Basic Validation ```bash usm manifest validate ``` ### Custom Build Directory ```bash usm manifest validate /tmp/my-build ``` ## Output Details The command reports: - Missing dependencies with specific resource names - Warnings for missing metadata (license, markdown, URL) - Build progress percentage - Missing expected resources with location descriptions - Unexpected resources found during installation scan - Final validation status ## CI/CD Integration Designed for automated environments: - Non-zero exit codes indicate failures - Detailed error messages for quick issue identification - Progress reporting compatible with CI logging - Automatic temporary directory cleanup ## Command Comparison | Command | Purpose | |---------|---------| | **validate** | Verifies package structure and resources | | **autoprovides** | Generates provides section from build output | | **test** | Runs package test scripts | | **install** | Installs package to system | --- This command provides comprehensive package validation by building and installing packages in temporary environments to ensure all declared resources are correctly present and located.