Add alternate url support for some predefined sources #2970
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.
Sometimes bad things happen; even when you thought you had everything set up properly it might turn out that you didn't. The best laid plans, etc. If there is a way to continue functioning, even if it is less efficient, shouldn't we use that?
Change
Adds an alternate base URL for the sources behind
cdn.winget.microsoft.com
. In the event that the files hosted there are inaccessible or corrupted, the alternate URL will be used instead. This mechanism does rely on the fact that these are basically two names for the exact same set of data, which is true as the alternate is the upstream store for the CDN itself.Additionally, we now require preindexed packaged sources to contain the manifest hash, rather than just using it if present.
Finally, this change adds a setting that can be used to disable the alternate URL for the
winget
source. I intentionally did not add it to the schema or documentation, as I don't think it is something that should actually be set by anyone unless there is an explicit reason to do so (such as for testing purposes).Validation
Manually validated by changing the primary URL to a non-existent one. The error was present in the logs, but the user experience was not impacted. Tested the setting in this case to ensure that it would cause a failure.
Microsoft Reviewers: Open in CodeFlow
Microsoft Reviewers: Open in CodeFlow