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

Avoid attempting to download from exteranl URIs in Product Source Build mode #17237

Merged
merged 3 commits into from
Aug 22, 2023

Conversation

mmitche
Copy link
Member

@mmitche mmitche commented Aug 22, 2023

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.

…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.
@mmitche mmitche requested a review from a team August 22, 2023 16:39
Comment on lines 376 to 396
<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>
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, done.

@mmitche
Copy link
Member Author

mmitche commented Aug 22, 2023

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

@mmitche
Copy link
Member Author

mmitche commented Aug 22, 2023

lookin good

@mmitche mmitche merged commit 1af186b into dotnet:main Aug 22, 2023
16 checks passed
mmitche added a commit to mmitche/installer that referenced this pull request Aug 22, 2023
mmitche added a commit that referenced this pull request Aug 24, 2023
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