-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support OfficialBuildId for SB #48327
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
Conversation
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.
Copilot reviewed 5 out of 15 changed files in this pull request and generated no comments.
Files not reviewed (10)
- src/Layout/Directory.Build.props: Language not supported
- src/Layout/redist/targets/RestoreLayout.targets: Language not supported
- src/SourceBuild/content/repo-projects/Directory.Build.props: Language not supported
- src/SourceBuild/content/repo-projects/Directory.Build.targets: Language not supported
- src/SourceBuild/content/repo-projects/scenario-tests.proj: Language not supported
- src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.Tests/Microsoft.DotNet.SourceBuild.Tests.csproj: Language not supported
- src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.Tests/assets/default.NuGet.Config: Language not supported
- src/SourceBuild/content/test/tests.proj: Language not supported
- src/SourceBuild/patches/arcade/0001-Use-test-prefix-on-unofficial-build-prerelease-label.patch: Language not supported
- src/SourceBuild/patches/scenario-tests/0001-Remove-System.CommandLine-as-dependency.patch: Language not supported
Comments suppressed due to low confidence (3)
src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.Tests/DotNetHelper.cs:52
- Verify that the updated ternary logic correctly differentiates between custom package path modes. In particular, ensure that when CustomPackagesPathIsInclusive is true, the 'default' configuration is intended.
string nugetConfigPrefix = useCustomPackages && !Config.CustomPackagesPathIsInclusive ? "custom" : "default";
eng/pipelines/templates/jobs/vmr-build.yml:168
- Ensure that the conditional aggregation for 'dependsOn' correctly builds the dependency list in all scenarios; verify that an empty condition does not add spurious list items.
dependsOn:
- ${{ if ne(parameters.reuseBuildArtifactsFrom, '') }}:
- ${{ parameters.reuseBuildArtifactsFrom }}
- ${{ if ne(parameters.dependsOn, '') }}:
- ${{ parameters.dependsOn }}
eng/pipelines/templates/jobs/vmr-build.yml:565
- Removing the trimming of buildArgs may lead to extra spaces affecting command-line parsing; confirm that buildArgs formatting remains valid after this change.
buildArgs=$(echo $buildArgs | xargs) # Remove extra spaces
Love it. This is a great step towards unified versioning and build for source-build. The PR description is well written. I still have follow-up questions, though.
That's definitely the right direction. We started decoupling scenario-tests from the VMR build when we moved it out of the Build target and into the Test target. I see this as the next logical step to truly build it independently. On that thought, can you remind me what the constraints for source-build are in terms of pre-builts for scenario-tests execution? Is the test execution constraint by internet access and must have no pre-builts? Does this change with this work?
I'm suprised to see this new switch. Is your intention to make this the default at a later point, past P4? If so, what will be the UX for source-build partners? |
src/Layout/Directory.Build.props
Outdated
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.
Please revert this file change
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.
Fixed with 269eba9
<!-- TODO: Remove this import and the EnableDevBuildAsDefaultForSourceOnly when dev builds are the default for source only. | ||
https://github.com/dotnet/source-build/issues/4922 --> |
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.
nit: the comment refers to an Import but below is a property group. The same is true for the change in L176
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.
Fixed with 2e4029b
@@ -198,7 +198,7 @@ | |||
|
|||
<ItemGroup> | |||
<_BuildSources Include="$(PrebuiltNuGetSourceName);$(PreviouslySourceBuiltNuGetSourceName);$(ReferencePackagesNuGetSourceName)" | |||
Condition="'$(DotNetBuildSourceOnly)' == 'true'"/> | |||
Condition="'$(DotNetBuildSourceOnly)' == 'true' and '$(DotNetSourceOnlyTestOnly)' != 'true'"/> |
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.
Would this benefit from a boolean indirection property that determines whether prebuilt feeds should be added? i.e.
<IncludePrebuiltFeeds Condition="'$(DotNetSourceOnlyTestOnly)' == 'true'">false</IncludePrebuiltFeeds>
<IncludePrebuiltFeeds Condition="'$(IncludePrebuiltFeeds)' == '' and '$(DotNetBuildSourceOnly)' == 'true'">true</IncludePrebuiltFeeds>
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.
Fixed with 2eb97de
@@ -9,21 +9,19 @@ | |||
|
|||
<!-- Don't use the updated NuGet.config file that includes the live package feeds when testing source-only as in that configuration | |||
the Microsoft built packages should be used. --> | |||
<TestArgs Condition="'$(DotNetBuildSourceOnly)' == 'true'">$(TestArgs) /p:TestRestoreConfigFile=$(OriginalNuGetConfigFile)</TestArgs> | |||
<TestArgs Condition="'$(DotNetBuildSourceOnly)' == 'true' and '$(DotNetSourceOnlyTestOnly)' != 'true'">$(TestArgs) /p:TestRestoreConfigFile=$(OriginalNuGetConfigFile)</TestArgs> | |||
<UseBootstrapArcade>true</UseBootstrapArcade> |
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.
It's weird to have this un-conditionally set to true but then later for non-source-only builds, reference the arcade repo. Maybe add a condition?
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.
Fixed with 483c975
@@ -8,5 +8,6 @@ | |||
<add key="darc-pub-dotnet-runtime-d398172" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-d3981726/nuget/v3/index.json" /> | |||
<add key="dotnet10" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10/nuget/v3/index.json" /> | |||
<add key="dotnet10-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10-transport/nuget/v3/index.json" /> | |||
<add key="custom-packages" value="CUSTOM_PACKAGE_FEED" /> |
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.
Did you consider using the RestoreAdditionalProjectSources
msbuild property to dynamically add additional nuget feeds? That would avoid rewriting this file.
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.
Great suggestion. Fixed with 5a86952
<VersionSuffix Condition="'$(DotNetFinalVersionKind)' == 'release'"/> | ||
- <VersionSuffix Condition="'$(DotNetFinalVersionKind)' == 'prerelease' and '$(SemanticVersioningV1)' != 'true'">$(_PreReleaseLabel).final</VersionSuffix> | ||
- <VersionSuffix Condition="'$(DotNetFinalVersionKind)' == 'prerelease' and '$(SemanticVersioningV1)' == 'true'">$(_PreReleaseLabel)-final</VersionSuffix> | ||
+ <VersionSuffix Condition="'$(DotNetFinalVersionKind)' == 'prerelease' and '$(SemanticVersioningV1)' != 'true'">$(_PreReleaseLabel)$(_SemVerLabelSeparator)final</VersionSuffix> |
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.
I think this was the idea?
+ <VersionSuffix Condition="'$(DotNetFinalVersionKind)' == 'prerelease' and '$(SemanticVersioningV1)' != 'true'">$(_PreReleaseLabel)$(_SemVerLabelSeparator)final</VersionSuffix> | |
+ <VersionSuffix Condition="'$(DotNetFinalVersionKind)' == 'prerelease'">$(_PreReleaseLabel)$(_SemVerLabelSeparator)final</VersionSuffix> |
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.
Fixed with 392a5e6
@@ -21,6 +21,7 @@ | |||
</PropertyGroup> | |||
|
|||
<ItemGroup> | |||
<ProjectReference Include="$(TasksDir)Microsoft.DotNet.UnifiedBuild.Tasks\Microsoft.DotNet.UnifiedBuild.Tasks.csproj" /> |
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.
From the entire PR, this is the only change that I don't understand and which looks wrong to me. Why would we need to build a tasks assembly here in tests.proj?
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.
@mthalman can this be moved to test/Microsoft.DotNet.SourceBuild.Tests/Microsoft.DotNet.SourceBuild.Tests.csproj
? We have the same ProjectReference
in https://github.com/dotnet/sdk/blob/main/src/SourceBuild/content/test/Microsoft.DotNet.Tests/Microsoft.DotNet.Tests.csproj
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.
This reference isn't necessary anymore. Removed with e87b02f
@@ -62,6 +62,9 @@ | |||
<RuntimeHostConfigurationOption Include="$(MSBuildProjectName).CustomPackagesPath"> | |||
<Value>$(SourceBuildTestsCustomSourceBuiltPackagesPath)</Value> | |||
</RuntimeHostConfigurationOption> | |||
<RuntimeHostConfigurationOption Include="$(MSBuildProjectName).CustomPackagesPathIsInclusive"> | |||
<Value>$(SourceBuildTestsCustomSourceBuiltPackagesPathIsInclusive)</Value> |
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.
Can you please add a comment describing this property? I assume it means that the packages path contains everything needed for this test library?
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.
This property has been removed as part of 5a86952
There are no requirements that tests build without prebuilts. Internet access is allowed for running tests. The changes in this PR don't impact this.
Yes, I should have explained that better. I also had a hard time naming it because it's not just specific to dev builds. It applies to official builds too when OfficialBuildId is set. It basically means that we use dev builds or OfficialBuildId instead of git-info. This is a temporary property until we have a fully combined pipeline that includes Microsoft and SB legs. So this property is only set in the new SB leg added to the UB pipeline. This allows the existing SB pipeline to work unchanged. The UX for SB partners at this point is unchanged. I'm open to changing the default behavior here if that's what we want to do (cc @MichaelSimons). We're just in a state of transition right now while we have separate pipelines. |
I like the intermediate step as it makes the PR smaller and scoped. My main question here was whether the transition will happen in time for P4 or P5. |
@@ -995,3 +995,77 @@ stages: | |||
- Windows_x64 | |||
- Windows_x86 | |||
- Windows_arm64 | |||
|
|||
# Source Build Leg |
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.
Is there value in embedding the SB leg and SB validation leg in new jobs template? The benefit is to ensure they both get done and help in ensuring parameter consistency between the two - e.g. containers, naming, etc. This would make it easier to add new SB legs.
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.
Fixed with b8206dd
I too like the thought of working incrementally. The original idea was to complete the necessary changes and validate SB was capable of the new OfficialBuildId mechanism in P3. This was held up by requiring some of the workflow changes. In P4 the goal is to move all legs while still supporting the ability to rollback to the gitinfo files if MSFT ends up not shipping P4 from the new UB infra. Moving all legs in P4 isn't strictly required but would be ideal IMO. |
…ial-build-prerelease-label.patch Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
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.
Build parts LGTM. I didn't review the YML
- AzureLinux_x64_Cross_x64 | ||
- Browser_Shortstack_wasm | ||
- Windows_x64 | ||
- ${{ format('{0}_SourceBuild_Online_MsftSdk_x64', parameters.buildNamePrefix) }} |
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.
Should the x64
references in the validation parameter be updated to use ${{ parameters.targetArchitecture }}
? This one particular reference jumps out as the preceding job's name is built with the targetArchitecture. I am alright with fixing this when other legs are onboarded so that they can be validated.
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.
Aside from removing the semantic versioning patch which has already been discussed, I have only one minor comment. It's not immediately clear to me what DotNetSourceOnlyTestOnly means. Does it mean only testing during a source-only build, with no build? Or with a build?
That gets set to true when running the source build validation job, which is a separate job that depends on outputs from the SB job and several UB jobs in order to run all of the tests. |
You probably mentioned that in today's sync but will this change cause dev builds to fail? What about ci builds which also appear before previewX builds according to semver rules? Asking as I currently depend on working dev builds for my outer/inner build work. Not blocking as my work can wait. |
Dev builds will work by default. Dev build mode will only be enabled in source build if you also set |
Fixes dotnet/source-build#4912
This enables SB support for the
OfficialBuildId
property. This gets enabled by setting theEnableDevBuildAsDefaultForSourceOnly
property. When that is enabled, SB will use theOfficialBuildId
rather than the build numbers from the git-info files. This also allows for dev builds to be supported.For dev builds, it was necessary to change the pre-release label defined by Arcade to use a different value. This is due to the semantic versioning rules that select the highest version as the last label value in alphabetical sorting. This is problematic when we have pre-release labels like "preview" which end up being selected as the latest version over a version that has the label of "dev" since "preview" comes after "dev" alphabetically. This means that preview packages will be resolved instead of the live dev package when resolving package dependencies. For that reason, a prefix value of "test" was chosen which comes alphabetically after all the other pre-release labels that are used.
The majority of these changes are related to the issue of testing. For the SB tests and scenario tests, we need to be able to resolve the package version of the OfficialBuildId that was provided. But some of those packages aren't produced by source build. For example, some of the self-contained publishing tests rely on packages for the portable
linux-<arch>
RID which is not produced by source build. For that reason, we require the packages that are produced by other unified build legs. So to test the SB output with OfficialBuildId support, we actually need to integrate a SB leg into the UB pipeline. A separate validation leg is then added that depends on the artifacts from the SB leg as well as other UB legs that provide the necessary packages required by the tests.Another factor is building the scenario tests. This required modification because it was dependent on building the entire VMR. So that's been decoupled here for SB to allow building and running the scenario tests in a separate job without rebuilding the rest of the VMR.
Also related to the scenario tests is the need to remove the Versions.Details dependency on System.CommandLine. This was necessary because leaving it in would require SB to attempt to use the "live" version of that package which wouldn't exist in this context since it's been decoupled from the rest of the VMR.