[deckhouse-cli] Add pull summary after d8 mirror pull#381
Merged
Conversation
- PullSummary plus per-component stat types (platform, installer, security, modules, bundle) - holds resolved versions, the VEX subset and bundle sizes for the end-of-pull report Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- each phase records its image/VEX counts and resolved versions before packing - fix platform AsList that returned no sub-layouts (reflection looked for the wrong field type) Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- Pull returns a non-nil summary even on error, so partial runs still report - map each services stats into the summary Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- framed block with versions, VEX, security N/M, bundle sizes and edition - semver-sorted versions, semantic colour gated on TTY / FORCE_COLOR Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- render the summary on success, dry-run, cancel and hard failure - --verbose-summary adds the per-module breakdown (output only) Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- cover dry-run, cancelled, failed, not-pulled, verbose, VEX and version sorting - colour gating and the edition line Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- per-service Stats survive packing; manifest counting; bundle stats - outcome classification and AsList sub-layout enumeration Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- add PackagesStats/PackageStat model and a Packages field to PullSummary - capture per-package versions and manifest counts in the packages service - render a Packages section (aggregate + per-package versions/VEX in verbose) Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- treat a NAME_UNKNOWN transport error as "no packages", like ErrImageNotFound - apply the graceful skip in both validatePackagesAccess and discoverPackageNames - add a regression test covering both signals Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
ldmonster
approved these changes
Jun 4, 2026
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.
[mirror] Add an end-of-pull summary to
d8 mirror pullℹ️ What
Prints a short, framed summary at the end of every
d8 mirror pull(and--dry-run):what was pulled (or, in dry-run, what will be) - platform, installer, security databases,
modules and packages.
A
--verbose-summaryflag adds a per-module and per-package breakdown with their resolved versions.❓ Why
Before this, a pull ended with hundreds of
Pulling ...@sha256:...lines and no recap.To learn the one thing we actually need - which releases, module and package
versions will be mirrored (and whether the bundle is complete) - you had to scroll the log.
The original ask was exactly that: in
--dry-run, see which platform release and whichmodule/package versions will be pulled, honouring all filters (
--include-module/--exclude-module/--include-package/--no-platform/--include-platform/ ...),without reading sha lines.
📝 How it works
resolved/pulled - versions, VEX attestations, bundle sizes - from data the pull
already has. No extra registry requests.
Ctrl+C-> partial summary, marked cancelled,A phase that never ran shows
not pulled.(set
FORCE_COLOR=1to force colour into a file).📊 What the summary shows
CE/EE/...), parsed from the source path; omitted fora custom registry with no edition segment.
latestor a pinned--installer-tag).N/M databases(green when complete, yellow when partial).--verbose-summary, each module'sversions and VEX count.
--verbose-summary, each package's versions and VEX count.TOTAL.Package archives (
package-<name>.tar, the sharedpackage-versions.tar) are listed hereautomatically.
Versions are sorted newest-first (semver) everywhere they appear.
(See examples below)
🔄 Before / after
Before - the run just ended with the streaming log; no recap:
Pull packages
FORCE_COLOR=1 d8 mirror pull \ --source dev-registry.deckhouse.io/sys/deckhouse-oss \ --no-platform --no-security-db --no-modules --no-installer \ --include-package 'boardmaps@>=0.0.0' \ --include-package 'cossacks-server@>=0.0.0' \ --verbose-summary \ <bundle-dir>Different platform
FORCE_COLOR=1 d8 mirror pull \ --source registry.deckhouse.ru/deckhouse/ee \ --include-platform '>=v1.71.0 <v1.76.0' --no-modules --dry-run --verbose-summary \ <bundle-dir>Dry-Run for Community Edition
FORCE_COLOR=1 d8 mirror pull \ --source registry.deckhouse.ru/deckhouse/ce \ --dry-run --verbose-summary \ <bundle-dir>Dry-Run for Enterprise Edition
FORCE_COLOR=1 d8 mirror pull \ --source registry.deckhouse.ru/deckhouse/ee \ --dry-run --verbose-summary \ <bundle-dir>✏️ Main changes
Pull()now returns(*PullSummary, error)- always a non-nil summary, so a partial run(cancel or hard error) still renders instead of showing only a raw error.
Stats()that captures counts/versions before packing, for modules andpackages.
--verbose-summaryflag (output only - it does not change what is pulled).pkg/registry/image(manifest count + a matched subset for VEX).AsList()returned empty (reflectionlooked for the wrong field type), and dry-run under-counted module versions.
ℹ️ Also: packages mirroring no longer crashes on registries without packages
While adding the packages summary, surfaced and fixed a regression from the packages
mirroring support (#376): the packages phase failed the whole pull against any registry
that has no
/packagesrepository - including the publicregistry.deckhouse.ru/deckhouse/eeand
/ce. The intended graceful-skip only matchedErrImageNotFound, but a missing repo isreported as a
NAME_UNKNOWNtransport error.Fix: treat
NAME_UNKNOWNthe same asErrImageNotFound("no packages here, skip the phase")in both
validatePackagesAccessanddiscoverPackageNames, mirroring the already-gracefulPullPackageVersions. With this, a pull against a packages-less registry succeeds and thesummary simply shows
Packages: 0 packages.🧪 Tests
versions) for modules and packages, semver sorting, colour gating, the counting helpers,
and outcome classification.
Stats(): dry-run accounting and the before-packing capture (the count mustsurvive packing).
/packagesrepo (bothNAME_UNKNOWNandErrImageNotFound) skips the phase instead of failing the pull.versions / VEX / sizes (including a real packages pull); the summary adds no registry requests.