-
Notifications
You must be signed in to change notification settings - Fork 446
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
Avoid attempting to download from exteranl URIs in Product Source Build mode #17237
Avoid attempting to download from exteranl URIs in Product Source Build mode #17237
Conversation
…ld mode When in product source build mode, there is no need to attempt to download from dotnetbuilds/*. The generated URI will be incorrect (missing a version number) anwyay.
<UrisToDownload Include="$([System.String]::Copy('%(ComponentToDownload.BaseUrl)').Replace($(PublicBaseURL), 'https://dotnetbuilds.blob.core.windows.net/public/'))/%(ComponentToDownload.DownloadFileName)" Condition="'%(ComponentToDownload.ShouldDownload)' == 'true'"> | ||
<!-- If building in product source build mode, there is no need to attempt the external URIs. These are not desired, | ||
and won't work anyway because the source build file URI doesn't use the same structure as the storage accounts. | ||
For example, the dotnetbuilds uri for 'file:///vmr/dotnet2/artifacts/obj/x64/Release/blob-feed/assets//aspnetcore_base_runtime.version' | ||
would end up 'https://dotnetbuilds.blob.core.windows.net/public//dotnet-runtime-8.0.0-rc.1.23381.3-centos.8-x64.tar.gz'. This is | ||
missing the runtime version number directory. --> | ||
<UrisToDownload Include="$([System.String]::Copy('%(ComponentToDownload.BaseUrl)').Replace($(PublicBaseURL), 'https://dotnetbuilds.blob.core.windows.net/public/'))/%(ComponentToDownload.DownloadFileName)" | ||
Condition="'%(ComponentToDownload.ShouldDownload)' == 'true' AND '$(DotNetBuildFromSourceFlavor)' != 'Product'"> | ||
<ShouldDownload>%(ComponentToDownload.ShouldDownload)</ShouldDownload> | ||
<DownloadDestination>%(ComponentToDownload.DownloadDestination)</DownloadDestination> | ||
</UrisToDownload> | ||
<UrisToDownload Include="%(ComponentToDownload.PrivateBaseUrl)/%(ComponentToDownload.DownloadFileName)" Condition="'%(ComponentToDownload.ShouldDownload)' == 'true' and '$(DotNetRuntimeSourceFeedKey)' != ''"> | ||
<UrisToDownload Include="%(ComponentToDownload.PrivateBaseUrl)/%(ComponentToDownload.DownloadFileName)" | ||
Condition="'%(ComponentToDownload.ShouldDownload)' == 'true' and '$(DotNetRuntimeSourceFeedKey)' != '' and '$(DotNetBuildFromSourceFlavor)' != 'Product'"> | ||
<ShouldDownload>%(ComponentToDownload.ShouldDownload)</ShouldDownload> | ||
<DownloadDestination>%(ComponentToDownload.DownloadDestination)</DownloadDestination> | ||
<token>$(DotNetRuntimeSourceFeedKey)</token> | ||
</UrisToDownload> | ||
<UrisToDownload Include="$([System.String]::Copy('%(ComponentToDownload.PrivateBaseUrl)').Replace($(InternalBaseURL), 'https://dotnetbuilds.blob.core.windows.net/internal/'))/%(ComponentToDownload.DownloadFileName)" Condition="'%(ComponentToDownload.ShouldDownload)' == 'true' and '$(DotNetRuntimeSourceFeedKey)' != ''"> | ||
<UrisToDownload Include="$([System.String]::Copy('%(ComponentToDownload.PrivateBaseUrl)').Replace($(InternalBaseURL), 'https://dotnetbuilds.blob.core.windows.net/internal/'))/%(ComponentToDownload.DownloadFileName)" | ||
Condition="'%(ComponentToDownload.ShouldDownload)' == 'true' and '$(DotNetRuntimeSourceFeedKey)' != '' and '$(DotNetBuildFromSourceFlavor)' != 'Product'"> | ||
<ShouldDownload>%(ComponentToDownload.ShouldDownload)</ShouldDownload> | ||
<DownloadDestination>%(ComponentToDownload.DownloadDestination)</DownloadDestination> | ||
<token>$(dotnetbuilds-internal-container-read-token-base64)</token> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about grouping all of these into a separate ItemGroup
that has the $(DotNetBuildFromSourceFlavor)' != 'Product'
condition applied at the ItemGroup
level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, done.
There was also a redundant download uri there in non-SB mode. I've removed it, but want to verify on an internal PR first before merging |
lookin good |
When in product source build mode, there is no need to attempt to download from dotnetbuilds/*. The generated URI will be incorrect (missing a version number) anyway.