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

Create workload set insertion process #302

Open
wants to merge 157 commits into
base: main
Choose a base branch
from

Conversation

MiYanni
Copy link
Member

@MiYanni MiYanni commented Jan 17, 2025

TODO

…ipt for publishing workload sets. Just downloading the workload assets at the moment.
…e existing one to test the script.

# Conflicts:
#	eng/pipelines/official.yml
…ile.

# Conflicts:
#	global.json
#	workload-versions.sln
…uild properly. But, that's running into issues too.
…on set in the global.json.

# Conflicts:
#	global.json
# Conflicts:
#	eng/common/tools.ps1
# Conflicts:
#	global.json

# Conflicts:
#	NuGet.config
#	eng/Version.Details.xml
#	eng/Versions.props
#	eng/common/templates-official/job/job.yml
#	global.json
… VS drop creation.

# Conflicts:
#	eng/pipelines/official.yml
…. This will be renamed in a future commit. Made the official.yml finally able to create the VS drops, but needs tested.
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: remove

Comment on lines -13 to +15
<Dependency Name="Microsoft.NET.Sdk.Android.Manifest-9.0.100" Version="35.0.24">
<Dependency Name="Microsoft.NET.Sdk.Android.Manifest-9.0.100" Version="35.99.0-ci.dev-pjc-msi-zip-artifact.29">
<Uri>https://github.com/dotnet/android</Uri>
<Sha>4b20432d95ea8965a41cc73997e459d7fa561233</Sha>
<Sha>b1501efd4a9cb8c48f58c6a099fda120841b7ec8</Sha>
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: undo

<MicrosoftNETSdkAndroidManifest90100PackageVersion>35.0.24</MicrosoftNETSdkAndroidManifest90100PackageVersion>
<MicrosoftNETSdkAndroidManifest90100PackageVersion>35.99.0-ci.dev-pjc-msi-zip-artifact.29</MicrosoftNETSdkAndroidManifest90100PackageVersion>
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: undo

Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: remove

Comment on lines +51 to +52
# $vsComponentValue = "$assemblyName.vsman{$workloadVersion}=$dropUrl,"
$vsComponentValue = "$assemblyName.vsman=$dropUrl,"
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: switch on

Comment on lines +51 to +88
# Sets the VstsDropFolder variable for the path to the MicroBuildUploadVstsDropFolder task.
# Used during VS insertion to verify if the drop has been uploaded already or not.
# Example: D:\a\_work\_tasks\MicroBuildUploadVstsDropFolder_4305a8de-ba66-4d8b-b2d1-0dc4ecbbf5e8\2.2.16\
- pwsh: |
$tasksFolder = '$(Agent.RootDirectory)\_tasks'
# The folders in _tasks are hidden. The -Force parameter allows them to be listed.
$taskRootFolder = Get-ChildItem $tasksFolder -Directory -Filter 'MicroBuildUploadVstsDropFolder*' -Force | Select-Object -First 1
# Get the first version folder since the agent will only install a single version.
$vstsDropFolder = ($taskRootFolder | Get-ChildItem -Directory -Force | Select-Object -First 1).FullName
Write-Host "VstsDropFolder: $vstsDropFolder"
Write-Host "##vso[task.setvariable variable=VstsDropFolder]$vstsDropFolder"
displayName: 🟣 Set VstsDropFolder variable
# - pwsh: |
# $localPluginPath = '$(Build.SourcesDirectory)/eng/VstsDropFolder/plugin.ps1'
# Write-Host "LocalPluginPath: $localPluginPath"
# $taskPluginPath = '$(VstsDropFolder)/plugin.ps1'
# Write-Host "TaskPluginPath: $taskPluginPath"
# Copy-Item -Path $localPluginPath -Destination $taskPluginPath -Force
# displayName: 🟣 Replace VstsDropFolder plugin.ps1

# - pwsh: |
# $tasksFolder = '$(Agent.RootDirectory)\_tasks'
# # The folders in _tasks are hidden. The -Force parameter allows them to be listed.
# $taskRootFolder = Get-ChildItem $tasksFolder -Directory -Filter 'MicroBuildInsertVsPayload*' -Force | Select-Object -First 1
# # Get the first version folder since the agent will only install a single version.
# $insertVsPayload = ($taskRootFolder | Get-ChildItem -Directory -Force | Select-Object -First 1).FullName
# Write-Host "InsertVsPayload: $insertVsPayload"
# Write-Host "##vso[task.setvariable variable=InsertVsPayload]$insertVsPayload"
# displayName: 🟣 Set InsertVsPayload variable

# - pwsh: |
# $localPluginPath = '$(Build.SourcesDirectory)/eng/InsertVsPayload/plugin.ps1'
# Write-Host "LocalPluginPath: $localPluginPath"
# $taskPluginPath = '$(InsertVsPayload)/plugin.ps1'
# Write-Host "TaskPluginPath: $taskPluginPath"
# Copy-Item -Path $localPluginPath -Destination $taskPluginPath -Force
# displayName: 🟣 Replace InsertVsPayload plugin.ps1
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: remove when 1ES update

Comment on lines +120 to +162
# Only create the drop if the workload drop directory exists, or if the drop wasn't published already.
# Sets the PublishWorkloadDrop variable. See: https://stackoverflow.com/a/60630739/294804
- pwsh: >-
eng/check-drop-publish.ps1
-workloadId '${{ workloadShortName }}_${{ workloadType }}'
-workloadPath '$(${{ workloadShortName }}_${{ workloadType }}_dir)'
-workloadName '$(${{ workloadShortName }}_${{ workloadType }}_name)'
-token (ConvertTo-SecureString -String '$(dn-bot-devdiv-drop-rw-code-rw)' -AsPlainText -Force)
-vstsDropFolder '$(VstsDropFolder)'
displayName: 🟣 Check if ${{ workloadShortName }}_${{ workloadType }} needs published
# - pwsh: |
# # If the drop folder doesn't exist (not downloaded via DARC), the drop cannot be published.
# if (-not (Test-Path -Path '$(${{ workloadShortName }}_${{ workloadType }}_dir)')) {
# Write-Host "##vso[task.setvariable variable=PublishWorkloadDrop]False"
# Write-Host 'Drop "${{ workloadShortName }}_${{ workloadType }}" was not downloaded via DARC. Skipping VS drop publish...'
# return
# }
# Import-Module '$(VstsDropFolder)/Engineering.PowerShell.Vsts.Drop.psd1'
# # Default value within: https://devdiv.visualstudio.com/Engineering/_git/MicroBuild?path=/src/Tasks/UploadDrop/task.json
# $serviceUri = 'https://devdiv.artifacts.visualstudio.com'
# $token = '$(dn-bot-devdiv-drop-rw-code-rw)'
# $server = Get-VstsDropServer -Url $serviceUri -TraceToHost ActivityTracing -PatAuth $token
# # Returns a JSON string. If the drop exists, an array with a single object is returned. If the drop does not exist, an empty array is returned.
# $dropJson = $server.Client.List('$(${{ workloadShortName }}_${{ workloadType }}_name)') | ConvertFrom-Json
# if ($dropJson.Count -ne 0) {
# Write-Host "##vso[task.setvariable variable=PublishWorkloadDrop]False"
# Write-Host 'Drop "${{ workloadShortName }}_${{ workloadType }}" has already been published. Skipping VS drop publish...'
# return
# }
# Write-Host "PublishWorkloadDrop: True"
# Write-Host "##vso[task.setvariable variable=PublishWorkloadDrop]True"
# displayName: 🟣 Check if ${{ workloadShortName }}_${{ workloadType }} needs published
# - pwsh: |
# # If the drop folder doesn't exist (not downloaded via DARC), the drop cannot be published.
# if (-not (Test-Path -Path '$(${{ workloadShortName }}_${{ workloadType }}_dir)')) {
# Write-Host "##vso[task.setvariable variable=PublishWorkloadDrop]False"
# Write-Host 'Drop "${{ workloadShortName }}_${{ workloadType }}" was not downloaded via DARC. Skipping VS drop publish...'
# return
# }
# Write-Host "PublishWorkloadDrop: True"
# Write-Host "##vso[task.setvariable variable=PublishWorkloadDrop]True"
# displayName: 🟣 Check if ${{ workloadShortName }}_${{ workloadType }} needs published
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: consolidate when 1ES update

Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: might remove when 1ES update

- ***Message Matt Mitchell*** (@mmitche) for approval after requesting access to the entitlement.
- Should take about 20 mins for the entitlement process to complete (will appear on your [entitlements list](https://coreidentity.microsoft.com/manage/entitlement)) and another 30 mins the access to propagate to DARC. Basically, after approval, wait an hour until you actually attempt to build.
7. **TODO**: Test to see if PowerShell Core is required.
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: validate or remove

Comment on lines -9 to -13
<ItemGroup>
<SdkAssetsToPublish Include="$(ArtifactsShippingPackagesDir)*.msi" />
<SdkAssetsToPublish Include="$(ArtifactsNonShippingPackagesDir)*.wixpack.zip" />
</ItemGroup>

Copy link
Member Author

Choose a reason for hiding this comment

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

This doesn't do anything. SdkAssetsToPublish is not an item group in this repo/Arcade.

Comment on lines -9 to -13
<ItemGroup>
<ItemsToSign Include="$(ArtifactsPackagesDir)**\*.msi" />
<ItemsToSign Include="$(ArtifactsPackagesDir)**\*.nupkg" />
</ItemGroup>

Copy link
Member Author

Choose a reason for hiding this comment

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

These are automatically added via Arcade as part of the publish process. If they remain here, Arcade will actually fail to sign because it'll try to double sign these files.

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.

1 participant