Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

When SemVer 2.0.0 registration is disabled, put SemVer 2.0.0 packages in legacy registration #154

Merged
merged 2 commits into from
Apr 6, 2017
Merged

Conversation

joelverhagen
Copy link
Member

This is only necessary because of NuGet/NuGetGallery#3737. If one of these packages is edited (metadata edit or unlist), we should not ignore the catalog entry's effect on the existing registration hives (original and gzipped).

// Verify the contents of the SemVer 1.0.0 storage
var legacyCursor = _legacyStorage.Content.FirstOrDefault(pair => pair.Key.PathAndQuery.EndsWith("cursor.json"));
Assert.NotNull(legacyCursor.Key);
var legacyIndex = _legacyStorage.Content.FirstOrDefault(pair => pair.Key.PathAndQuery.EndsWith("/testpackage.semver2/index.json"));

Choose a reason for hiding this comment

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

check for existence of the leaf node as well just in case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, good idea. This is already implied by the cursor NotNull assertion and the count equaling 1 assertion. But it's best to be explicit here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@joelverhagen joelverhagen merged commit a2f3a3f into NuGet:dev Apr 6, 2017
@joelverhagen joelverhagen deleted the existing-semver2 branch April 6, 2017 00:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants