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

Handle single unknown version from REST source #1483

Merged
merged 1 commit into from
Sep 19, 2021

Conversation

JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented Sep 18, 2021

Change

If a REST source returns a single version that is Unknown, look up all versions when the manifest is requested.

Unfortunately I moved the code around due to the implementation and this looks like a lot more change than it is. Things I actually changed are:

  1. Fold PackageBase into AvailablePackage as there are no other derived types.
  2. Made PackageVersion hold a std::shared_ptr<AvailablePackage> rather than the info.
  3. Put lock around access to package versions data in AvailablePackage.
  4. Added method and calls to update versions in this case.

The update is triggered by a GetManifest call that meets the criteria (version is Unknown and manifest is missing). When we see that, and the version info in the package is consistent, we perform an optimized search that should return the versions and manifests. Then we overwrite the data from the PackageVersion that called us and it returns the manifest.

Validation

Manually ensured that the failing scenario is functioning now.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS JohnMcPMS requested a review from a team as a code owner September 18, 2021 02:34
Copy link
Contributor

@ashpatil-msft ashpatil-msft left a comment

Choose a reason for hiding this comment

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

:shipit:

@JohnMcPMS JohnMcPMS merged commit edae6e4 into microsoft:master Sep 19, 2021
@JohnMcPMS JohnMcPMS deleted the versionunknown branch September 19, 2021 16:25
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