Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GitHub] azcopy list with versionids does not show version id #2550

Merged
merged 14 commits into from
Feb 15, 2024

Conversation

siminsavani-msft
Copy link
Contributor

@siminsavani-msft siminsavani-msft commented Jan 22, 2024

When doing this list "https://[accountName].blob.core.windows.net/[containerName]" --properties="VersionID", AzCopy does not print out the version IDs of individual blobs (see example below).

INFO: hello/stuff/foo.txt; VersionId: ; Content Length: 3.00 B

The mentioned list command should print out something list this:
INFO: hello/stuff/foo.txt; VersionId: 2023-06-05T18:39:41.0295735Z; Content Length: 3.00 B

If the blob has more versions, then that will also be printed out:

INFO: hello/stuff/foo.txt; VersionId: 2023-06-05T18:39:41.0295735Z;  Content Length: 3.00 B
INFO: hello/stuff/foo.txt; VersionId: 2023-06-06T10:50:20.0295735Z;  Content Length: 2.00 B

This PR also handles --running-tally:

INFO: hello/stuff/foo.txt; VersionId: 2023-06-05T18:39:41.0295735Z;  Content Length: 3.00 B
INFO: hello/stuff/foo.txt; VersionId: 2023-06-06T10:50:20.0295735Z;  Content Length: 2.00 B
INFO: foo.txt; VersionId: 2023-06-07T10:50:20.0295735Z;  Content Length: 10.00 B

INFO: File count: 2
INFO: Total file size 12.00 B

Note that the total file size and count accounts for the latest versions only.

This fixes the bug in and completes the feature request in #2007 .

I've also added three unit tests in cmd with running rally and version id in property flag.

@gapra-msft gapra-msft modified the milestones: 10.24.0, 10.24 Jan 23, 2024
@siminsavani-msft siminsavani-msft changed the title [Bug] azcopy list with versionids does not show version id [GitHub] azcopy list with versionids does not show version id Jan 24, 2024
@seanmcc-msft
Copy link
Member

We want to list all versions of the base blob. Watch out for if the customer is using the --running-tally flag, as we probably don't want to sum up all the individual versions of the base blob, since they are incremental.

@siminsavani-msft siminsavani-msft changed the base branch from dev to main January 29, 2024 21:12
cmd/zt_list_test.go Outdated Show resolved Hide resolved
cmd/list.go Outdated Show resolved Hide resolved
cmd/list.go Outdated Show resolved Hide resolved
cmd/list.go Outdated Show resolved Hide resolved
cmd/list.go Outdated Show resolved Hide resolved
cmd/zc_enumerator.go Show resolved Hide resolved
cmd/zt_scenario_helpers_for_test.go Outdated Show resolved Hide resolved
cmd/zt_list_test.go Show resolved Hide resolved
@siminsavani-msft siminsavani-msft merged commit ee1c683 into main Feb 15, 2024
17 checks passed
@siminsavani-msft siminsavani-msft deleted the siminsavani/listversions-fix branch February 15, 2024 18:03
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.

azcopy list --properties "versionid" does not return versions and versionids
6 participants