Skip to content

Handle single unknown version from REST source - #1483

Merged
JohnMcPMS merged 1 commit into
microsoft:masterfrom
JohnMcPMS:versionunknown
Sep 19, 2021
Merged

JohnMcPMS merged 1 commit into
microsoft:masterfrom
JohnMcPMS:versionunknown

Conversation

@JohnMcPMS

@JohnMcPMS JohnMcPMS commented Sep 18, 2021 •

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

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