Skip to content

Add detailed file-level logging to unpack command#252

Merged
danielmeppiel merged 5 commits intomainfrom
copilot/add-logging-unpack-action
Mar 12, 2026
Merged

Add detailed file-level logging to unpack command#252
danielmeppiel merged 5 commits intomainfrom
copilot/add-logging-unpack-action

Conversation

Copy link
Contributor

Copilot AI commented Mar 11, 2026

Description

Adds verbose, per-dependency file-level logging to apm unpack, consistent with the tree-style output used by apm install. Previously, the unpack command only showed a final summary count — now it shows exactly where each file is copied, grouped by dependency.

Before:

Unpacked 5 file(s) (verified)

After:

Unpacking my-bundle.tar.gz → ./
  org/repo-a
    └─ .github/prompts/design-review.prompt.md
    └─ .github/agents/architect.md
  org/repo-b
    └─ .github/instructions/coding-standards.instructions.md
Unpacked 3 file(s) (verified)

No emojis used in any output. Logging aesthetics are consistent with apm install's tree-style (└─) pattern. Dependencies are keyed by get_unique_key() to correctly handle virtual dependencies (same repo_url with different virtual_path).

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

New tests added (10):

  • test_unpack_dependency_files_single_dep — verifies dependency_files maps repo_url to deployed files
  • test_unpack_dependency_files_multiple_deps — multi-dependency file tracking
  • test_unpack_dependency_files_virtual_deps — virtual deps from the same repo are tracked separately via get_unique_key()
  • test_unpack_dependency_files_dry_rundependency_files populated in dry-run
  • test_unpack_skipped_count — tracks missing files with skip_verify
  • test_unpack_skipped_count_zero_when_all_present — zero skipped when complete
  • test_unpack_cmd_logs_file_list — CLI output includes dependency name and file paths
  • test_unpack_cmd_dry_run_logs_files — dry-run CLI shows per-dependency breakdown
  • test_unpack_cmd_logs_skipped_files — skipped files warning in CLI output
  • test_unpack_cmd_multi_dep_logging — multi-dependency CLI output

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI and others added 3 commits March 11, 2026 22:01
- Add dependency_files and skipped_count to UnpackResult
- Show per-dependency file tree in unpack output (tree-style, consistent with install)
- Log source -> target header, per-file destinations, and skipped files warning
- Add unit tests for new fields and CLI logging output (20 tests, all passing)

Co-authored-by: danielmeppiel <51440732+danielmeppiel@users.noreply.github.com>
…nsistently

Co-authored-by: danielmeppiel <51440732+danielmeppiel@users.noreply.github.com>
@danielmeppiel danielmeppiel marked this pull request as ready for review March 11, 2026 22:15
@danielmeppiel danielmeppiel self-requested a review as a code owner March 11, 2026 22:15
Copilot AI review requested due to automatic review settings March 11, 2026 22:15
Copy link
Contributor

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 enhances apm unpack to emit per-dependency, tree-style file listings (similar to apm install) instead of only a final summary, by tracking deployed files per dependency during bundle unpacking.

Changes:

  • Extend UnpackResult to include dependency_files and skipped_count, and populate these during unpack_bundle().
  • Update apm unpack CLI output to print per-dependency file lists and warn when files are skipped due to --skip-verify.
  • Add unit tests covering dependency-level file tracking, skipped counts, and CLI output expectations.

Reviewed changes

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

File Description
src/apm_cli/bundle/unpacker.py Adds per-dependency file mapping + skipped-file counting to support detailed unpack logging.
src/apm_cli/commands/pack.py Implements tree-style per-dependency logging for apm unpack output.
tests/unit/test_unpacker.py Adds new unit tests for dependency_files, skipped_count, and unpack command logging output.

@danielmeppiel
Copy link
Collaborator

@copilot address pr review comments

…ed import, add virtual dep test

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

Copilot AI commented Mar 11, 2026

@copilot address pr review comments

All three review comments addressed in b574d32:

  1. Removed unused UnpackResult import from test file
  2. Switched dep_file_map key from dep.repo_url to dep.get_unique_key() — virtual deps (same repo, different virtual_path) now get separate entries
  3. Added test_unpack_dependency_files_virtual_deps test covering the virtual dependency key collision case

@danielmeppiel danielmeppiel merged commit 7842e61 into main Mar 12, 2026
6 checks passed
@danielmeppiel danielmeppiel deleted the copilot/add-logging-unpack-action branch March 12, 2026 20:13
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.

3 participants