Skip to content

Commit 1c6b306

Browse files
authored
Merge pull request #648 from MiYanni/AddVsDropSNAndRunName
2 parents b454e33 + a59cf5f commit 1c6b306

File tree

5 files changed

+27
-13
lines changed

5 files changed

+27
-13
lines changed

eng/pipelines/official.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ pr: none
66

77
# Required to set a custom run name within workload-build.yml.
88
# See: https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/pipeline
9-
# ==========================
10-
# TODO: Temporarily commenting out updating the build number.
11-
# appendCommitMessageToRunName: false
9+
appendCommitMessageToRunName: false
1210

1311
parameters:
1412
- name: sourceBranch
@@ -30,7 +28,7 @@ parameters:
3028
- name: azDOPublishFeed
3129
displayName: AzDO publish feed
3230
type: string
33-
default: public/dotnet10-workloads
31+
default: public/dotnet-workloads
3432

3533
- name: dividerVSInsertion
3634
displayName: '[ ######## VS INSERTION ######## ]'

eng/pipelines/templates/jobs/workload-build.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,18 @@ jobs:
4141
# Keep only valid characters. Invalid characters include: " / : < > \ | ? @ *
4242
# Also, strip any trailing '.' characters as those are invalid too.
4343
$commitMessage = "$(git log -1 --pretty=%s)".Trim() -replace '["\/:<>\\|?@*]|\.{1,}$', ''
44-
# Lastly, truncate to 255 max characters: 241 = 255 - 14 (for build number and delimiter, ex: 20250910.13 • )
45-
$commitMessage = $commitMessage.Substring(0, [Math]::Min($commitMessage.Length, 241))
46-
# ==========================
47-
# TODO: Temporarily commenting out updating the build number.
48-
# Write-Host "##vso[build.updatebuildnumber]$(Build.BuildNumber) • $commitMessage"
44+
# AzDO only allows 255 characters for the run name. But, the run name is used in PublishAssets to create a path to the assets for DARC.
45+
# The max length for this asset path is 250 characters. An example path is: assets/symbols/dotnet-workload-versions/{RunName}/Microsoft.NET.Workloads.10.0.100.Msi.arm64.10.101.0-servicing.0.25571.5.symbols.nupkg
46+
# To truncate the commit message, let's keep these counts in mind:
47+
# ~130: approximate length for the asset path parts that are not the run name
48+
# 32: for (potential) workloads version and delimiters (last numeric value can be 2 digits long), ex: 10.0.101-servicing.0.25571.3 •
49+
# 14: for build number and delimiter, ex: 20250910.13 •
50+
# Therefore, 250 - 130 - 32 - 14 = 74 characters. To be extra safe, let's make it 65 characters.
51+
$commitMessage = $commitMessage.Substring(0, [Math]::Min($commitMessage.Length, 65))
52+
# If the build does not succeed, the run name will contain to what is set below.
53+
# If the build does succeed, Workloads.NET.Workloads.csproj will recreate the run name using OfficialBuildId, WorkloadsVersion, and SourceBranchCommitMessage.
54+
Write-Host "##vso[task.setvariable variable=SourceBranchCommitMessage]$commitMessage"
55+
Write-Host "##vso[build.updatebuildnumber]$(Build.BuildNumber) • $commitMessage"
4956
displayName: 🟣 Set run name via source branch commit message
5057
# Name is required to reference the variables created within this build step in other stages.
5158
name: SetRunName

eng/pipelines/templates/steps/workload-insertion-steps.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ steps:
3131
# Connection: https://dnceng.visualstudio.com/internal/_settings/adminservices?resourceId=5708f1c1-8fb7-4722-a643-020cf89ee26f
3232
# Docs: https://devdiv.visualstudio.com/DevDiv/_wiki/wikis/DevDiv.wiki/40477/Insert-with-a-WIF-Service-Connection
3333
ConnectedServiceName: MicroBuildInsertionVS
34+
# Connection: https://dnceng.visualstudio.com/internal/_settings/adminservices?resourceId=fd289dd6-7de6-4a3b-b33f-eaf786770fa2
35+
ConnectedVSDropServiceName: VSEng-VSDrop-MI
3436
TargetBranch: ${{ parameters.targetBranch }}
3537
InsertionTopicBranch: $(InsertionTopicBranch)
3638
TeamName: $(_TeamName)

src/Microsoft.NET.Workloads/Microsoft.NET.Workloads.csproj

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@
5050

5151
<ItemGroup>
5252
<Content Include="$(OutputPath)microsoft.net.workloads.workloadset.json" Pack="true" PackagePath="data" />
53-
<None Include="$(ReadmeFile)" Pack="true" PackagePath="\"/>
53+
<None Include="$(ReadmeFile)" Pack="true" PackagePath="\" />
5454
</ItemGroup>
5555

5656
<PropertyGroup Condition="'$(WorkloadsProps)' == ''">
57-
<WorkloadsProps>workloads.props</WorkloadsProps>
57+
<WorkloadsProps>workloads.props</WorkloadsProps>
5858
</PropertyGroup>
59-
59+
6060
<Import Project="$(WorkloadsProps)" />
6161

6262
<Target Name="CreateWorkloadSetJson" BeforeTargets="Build">
@@ -99,7 +99,7 @@
9999
File="$(ReadmeFile)"
100100
Lines="$([System.IO.File]::ReadAllText($(PackageReadmeFile)).Replace('{SDKWVersion}','$(WorkloadsVersion)'))"
101101
Overwrite="true"
102-
Encoding="UTF-8"/>
102+
Encoding="UTF-8" />
103103
</Target>
104104

105105
<Target Name="CreateVisualStudioMsi" AfterTargets="Build" DependsOnTargets="GetAssemblyVersion;_GenerateMsiVersionString">
@@ -159,4 +159,10 @@
159159
</CreateLightCommandPackageDrop>
160160
</Target>
161161

162+
<Target Name="UpdateRunNameWithWorkloadsVersion" AfterTargets="Build" Condition="'$(TF_BUILD)' != ''">
163+
<!-- SOURCEBRANCHCOMMITMESSAGE is set to the Azure Pipelines environment within the SetRunName step. -->
164+
<!-- We simply pull it out of the environment variables because trying to set it to an MSBuild property can cause issues in the YAML if the message contains special characters. -->
165+
<Message Text="##vso[build.updatebuildnumber]$(OfficialBuildId) • $(WorkloadsVersion) • $(SOURCEBRANCHCOMMITMESSAGE)" Importance="high" />
166+
</Target>
167+
162168
</Project>

src/Microsoft.NET.Workloads/workloads.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@
2828
<ItemGroup Label="Aspire" Condition="$([MSBuild]::VersionLessThanOrEquals('$(VersionMajor)', '9'))">
2929
<WorkloadManifest Include="Microsoft.NET.Sdk.Aspire" FeatureBand="$(AspireFeatureBand)" Version="$(AspireWorkloadManifestVersion)" />
3030
</ItemGroup>
31+
3132
</Project>

0 commit comments

Comments
 (0)