Skip to content

feat(scripts): add verified download utility with hash checking#180

Merged
WilliamBerryiii merged 5 commits intomainfrom
feat/issue-54-verified-download-utility
Feb 16, 2026
Merged

feat(scripts): add verified download utility with hash checking#180
WilliamBerryiii merged 5 commits intomainfrom
feat/issue-54-verified-download-utility

Conversation

@WilliamBerryiii
Copy link
Member

@WilliamBerryiii WilliamBerryiii commented Feb 14, 2026

Description

Closes #54

Adds Get-VerifiedDownload.ps1, a hash-verified download utility supporting SHA-256, SHA-384, and SHA-512 checksum validation with optional archive extraction for .zip, .tar.gz, .tgz, and .tar formats. Ported from hve-core with bug fixes applied from review feedback.

  • feat(scripts): add Get-VerifiedDownload.ps1 with pure-function architecture for testability and an I/O wrapper for orchestration
  • feat(scripts): add Pester test suite with 39 tests covering hash computation, path resolution, cache-hit logic, download flow, extraction, and error handling
  • fix(scripts): persist archive at target path before extraction so the file remains on disk after Expand-Archive or tar runs
  • fix(scripts): add extraction logic to the cache-hit early-return path when the -Extract flag is set

Type of Change

  • 🐛 Bug fix (non-breaking change fixing an issue)
  • ✨ New feature (non-breaking change adding functionality)
  • 💥 Breaking change (fix or feature causing existing functionality to change)
  • 📚 Documentation update
  • 🏗️ Infrastructure change (Terraform/IaC)
  • ♻️ Refactoring (no functional changes)

Component(s) Affected

  • deploy/000-prerequisites - Azure subscription setup
  • deploy/001-iac - Terraform infrastructure
  • deploy/002-setup - OSMO control plane / Helm
  • deploy/004-workflow - Training workflows
  • src/training - Python training scripts
  • docs/ - Documentation

Testing Performed

  • Terraform plan reviewed (no unexpected changes)
  • Terraform apply tested in dev environment
  • Training scripts tested locally with Isaac Sim
  • OSMO workflow submitted successfully
  • Smoke tests passed (smoke_test_azure.py)

Documentation Impact

  • No documentation changes needed
  • Documentation updated in this PR
  • Documentation issue filed

Checklist

🔧 - Generated by Copilot

- port Get-VerifiedDownload.ps1 from hve-core (zero-delta copy)
- add Pester test suite for all download and hash functions
- support SHA-256, SHA-384, SHA-512 with optional archive extraction

🔒 - Generated by Copilot
Copilot AI review requested due to automatic review settings February 14, 2026 05:48
@WilliamBerryiii WilliamBerryiii added this to the v0.3.0 milestone Feb 14, 2026
Copy link

Copilot AI left a comment

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 ports the Get-VerifiedDownload.ps1 utility and its comprehensive Pester test suite from the hve-core repository as a zero-delta copy. The utility provides secure, hash-verified file downloads with support for SHA-256, SHA-384, and SHA-512 algorithms, plus optional archive extraction for .zip, .tar.gz, and .tar formats. The implementation follows a functional design pattern with 7 pure functions for testability and 1 I/O orchestrator function.

Changes:

  • Added Get-VerifiedDownload.ps1 with hash-verified download and extraction capabilities
  • Added comprehensive Pester test suite with 37 tests covering all functions and edge cases

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
scripts/lib/Get-VerifiedDownload.ps1 New utility script providing hash-verified downloads with multi-algorithm support (SHA-256/384/512) and archive extraction (zip, tar.gz, tar)
scripts/tests/lib/Get-VerifiedDownload.Tests.ps1 Comprehensive Pester test suite with 37 tests covering pure functions, I/O orchestration, cache hits, hash mismatches, network errors, and extraction scenarios

- add shebang and fix synopsis/description to list all hash algorithms
- remove trailing whitespace from OutputPath parameter
- move archive to target path before extraction so file persists on disk
- add extraction logic to cache-hit path when Extract flag is set
- add tests for archive persistence and cache-hit extraction

🔧 - Generated by Copilot
- return extractDir instead of targetPath in both download and cache-hit paths
- update test assertion to verify result path equals extract directory

🐛 - Generated by Copilot
Copilot AI review requested due to automatic review settings February 16, 2026 18:32
@github-actions
Copy link

github-actions bot commented Feb 16, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

- fix TestPaths param name mismatch in pester-tests.yml workflow
- scope ErrorActionPreference to function and main block
- use targetPath instead of Url for archive type detection
- update synopsis to clarify SHA-256 script-level support
- fix Remove-Item mock to pass through in Pester tests

🔧 - Generated by Copilot
@WilliamBerryiii WilliamBerryiii merged commit 063dd69 into main Feb 16, 2026
10 checks passed
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.

feat(scripts): add verified download utility with hash checking

3 participants