Skip to content

Add progress indicators for OCI component downloads#515

Merged
Mossaka merged 4 commits intomainfrom
copilot/show-progress-for-loading
Nov 11, 2025
Merged

Add progress indicators for OCI component downloads#515
Mossaka merged 4 commits intomainfrom
copilot/show-progress-for-loading

Conversation

Copy link
Contributor

Copilot AI commented Nov 10, 2025

Summary: Add progress indicators for OCI component downloads

Successfully implemented progress indicators for wassette component load oci:// command.

Changes Made

Modified Files:

  1. crates/wassette/src/oci_multi_layer.rs

    • Added pull_multi_layer_artifact_with_progress() function with show_progress parameter
    • Shows manifest pull progress
    • Shows layer count and per-layer download details (media type, size)
    • Shows completion status with checkmark
    • Added 2 unit tests for progress API
  2. crates/wassette/src/loader.rs

    • Added from_oci_reference_with_progress() trait method
    • Added load_resource_with_progress() function
    • Shows component download initiation
    • Shows total bytes downloaded for single-layer artifacts
    • Added 3 unit tests for progress API
  3. crates/wassette/src/lib.rs

    • Moved use std::io::IsTerminal to top imports (line 9)
    • Added TTY detection for CLI mode
    • Automatically enables progress when stderr is a terminal (CLI mode)
    • Automatically disables progress in server mode or when redirected

Unit Tests Added (5 total)

loader.rs tests:

  • test_load_resource_with_progress_api_exists - Verifies progress API function exists
  • test_component_resource_has_progress_method - Verifies ComponentResource implements progress method
  • test_policy_resource_has_progress_method - Verifies PolicyResource implements progress method

oci_multi_layer.rs tests:

  • test_pull_multi_layer_artifact_with_progress_exists - Verifies progress function exists
  • test_pull_multi_layer_artifact_calls_progress_version - Verifies delegation to progress version

Testing

  • ✅ All 92 library tests pass (87 original + 5 new)
  • ✅ CLI integration tests pass
  • ✅ No clippy warnings
  • ✅ Code formatted with rustfmt
  • ✅ Maintains backward compatibility
Original prompt

wassette component load oci:// should show progress


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 10, 2025 06:02
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copilot AI changed the title [WIP] Add progress display for loading wassette component Add progress indicators for OCI component downloads Nov 10, 2025
Copilot AI requested a review from Mossaka November 10, 2025 06:21
Copy link
Collaborator

@Mossaka Mossaka left a comment

Choose a reason for hiding this comment

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

@copilot add unit tests

loader::load_resource::<ComponentResource>(uri, &self.oci_client, &self.http_client)
.await?;
// Show progress when running in CLI mode (stderr is a TTY)
use std::io::IsTerminal;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add this to top

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved use std::io::IsTerminal to line 9 with other std imports in commit 1874a68.

…nality

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 11, 2025

@copilot add unit tests

Added 5 unit tests in commit 1874a68:

  • 3 tests in loader.rs verifying the progress API
  • 2 tests in oci_multi_layer.rs verifying the progress functions

All 92 tests pass (87 original + 5 new).

Copilot AI requested a review from Mossaka November 11, 2025 15:12
@Mossaka Mossaka marked this pull request as ready for review November 11, 2025 16:50
@Mossaka Mossaka merged commit e183969 into main Nov 11, 2025
23 checks passed
@Mossaka Mossaka deleted the copilot/show-progress-for-loading branch November 11, 2025 17:44
Mossaka added a commit to Mossaka/wassette that referenced this pull request Feb 2, 2026
* Initial plan

* Add progress indicators for OCI component downloads

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>

* Apply rustfmt formatting

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>

* Move IsTerminal import to top and add unit tests for progress functionality

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
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