diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 358bd4191cc574..fe32341cf517d8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -93,87 +93,87 @@ - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 https://github.com/dotnet/runtime-assets @@ -333,9 +333,9 @@ https://github.com/dotnet/xharness 4da0015e9dd1ed7d3992db7d1eb6878a5ee11ab2 - + https://github.com/dotnet/arcade - f3bffca1f93573c88a7f9b79fac258dff76f6215 + c11157d174c111c4ab316dc60ff53311e410ef97 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization diff --git a/eng/Versions.props b/eng/Versions.props index 10e30e183384a6..2ce802a114ad90 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -84,22 +84,22 @@ 9.0.109 - 9.0.0-beta.26406.11 - 9.0.0-beta.26406.11 - 9.0.0-beta.26406.11 - 9.0.0-beta.26406.11 - 2.9.0-beta.26406.11 - 9.0.0-beta.26406.11 - 2.9.0-beta.26406.11 - 9.0.0-beta.26406.11 - 9.0.0-beta.26406.11 - 9.0.0-beta.26406.11 - 9.0.0-beta.26406.11 - 9.0.0-beta.26406.11 - 9.0.0-beta.26406.11 - 9.0.0-beta.26406.11 - 9.0.0-beta.26406.11 - 9.0.0-beta.26406.11 + 9.0.0-beta.26458.10 + 9.0.0-beta.26458.10 + 9.0.0-beta.26458.10 + 9.0.0-beta.26458.10 + 2.9.0-beta.26458.10 + 9.0.0-beta.26458.10 + 2.9.0-beta.26458.10 + 9.0.0-beta.26458.10 + 9.0.0-beta.26458.10 + 9.0.0-beta.26458.10 + 9.0.0-beta.26458.10 + 9.0.0-beta.26458.10 + 9.0.0-beta.26458.10 + 9.0.0-beta.26458.10 + 9.0.0-beta.26458.10 + 9.0.0-beta.26458.10 1.4.0 diff --git a/eng/common/Get-GitHubAppToken.ps1 b/eng/common/Get-GitHubAppToken.ps1 index 6b5899d7a29925..ea776bd6bc28a8 100644 --- a/eng/common/Get-GitHubAppToken.ps1 +++ b/eng/common/Get-GitHubAppToken.ps1 @@ -110,27 +110,38 @@ $headers = @{ Write-Host "Looking up installation for '$InstallationOwner'..." try { - $installations = @() + $installations = [System.Collections.Generic.List[object]]::new() $page = 1 do { - $pageInstallations = @(Invoke-RestMethod ` + $pageResponse = Invoke-RestMethod ` -Uri "https://api.github.com/app/installations?per_page=100&page=$page" ` -Headers $headers ` - -Method Get) - $installations += $pageInstallations + -Method Get + $pageInstallationCount = 0 + foreach ($installation in $pageResponse) { + $installations.Add($installation) + $pageInstallationCount++ + } $page++ - } while ($pageInstallations.Count -eq 100) + } while ($pageInstallationCount -eq 100) } catch { Write-PipelineTelemetryError -Category 'Build' -Message "Failed to list GitHub App installations: $_. The signed JWT may be invalid or the App's Client ID ('$AppClientId') may be incorrect." exit 1 } -$installation = $installations | Where-Object { $_.account.login -ieq $InstallationOwner } | Select-Object -First 1 -if (-not $installation) { +$matchingInstallations = @($installations | Where-Object { $_.account.login -ieq $InstallationOwner }) +if ($matchingInstallations.Count -eq 0) { $found = ($installations | ForEach-Object { $_.account.login }) -join ', ' Write-PipelineTelemetryError -Category 'Build' -Message "No installation found for '$InstallationOwner'. App is installed on: $found" exit 1 } +if ($matchingInstallations.Count -ne 1) { + $matchingIds = ($matchingInstallations | ForEach-Object { $_.id }) -join ', ' + Write-PipelineTelemetryError -Category 'Build' -Message "Found multiple installations for '$InstallationOwner': $matchingIds" + exit 1 +} +$installation = $matchingInstallations[0] +Write-Host "Using installation $($installation.id) for '$($installation.account.login)'." try { $tokenResponse = Invoke-RestMethod ` diff --git a/eng/common/core-templates/job/onelocbuild.yml b/eng/common/core-templates/job/onelocbuild.yml index d76ed063ffaa59..ea590495fb0d5e 100644 --- a/eng/common/core-templates/job/onelocbuild.yml +++ b/eng/common/core-templates/job/onelocbuild.yml @@ -5,19 +5,10 @@ parameters: # Optional: A defined YAML pool - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#pool pool: '' - CeapexPat: $(dn-bot-ceapex-package-r) # PAT for the loc AzDO instance https://dev.azure.com/ceapex - GithubPat: $(BotAccount-dotnet-bot-repo-PAT) - - # Service connection for WIF-based Entra authentication to ceapex feeds (replaces CeapexPat). - # When set, dnceng/internal builds acquire a federated Entra token instead of using a PAT. - # All other projects (e.g. DevDiv, public), where this dnceng-scoped service connection does not - # exist, and any pipeline that sets this to '' fall back to PAT-based auth via the CeapexPat parameter. + # Project-scoped WIF service connection for Ceapex feed authentication. CeapexServiceConnection: 'dnceng-onelocbuild-ceapex' - # GitHub App authentication for the OneLoc check-in PR (dnceng/internal only). - # The infrastructure identifiers are centralized here and the App path is enabled by default. - # DevDiv requires its own project-scoped service connection before this path can be enabled there. - UseGitHubAppAuthentication: true + # GitHub App authentication for the OneLoc check-in PR. GitHubAppServiceConnection: 'dnceng-oneloc-githubapp' GitHubAppClientId: 'Iv23lijBU8x3gc9lDOc9' GitHubAppKeyVaultName: 'EngKeyVault' @@ -48,7 +39,6 @@ jobs: displayName: OneLocBuild${{ parameters.JobNameSuffix }} variables: - - group: OneLocBuildVariables # Contains the CeapexPat and GithubPat - name: _GenerateLocProjectArguments value: -SourcesDirectory ${{ parameters.SourcesDirectory }} -LanguageSet "${{ parameters.LanguageSet }}" @@ -79,6 +69,10 @@ jobs: steps: - ${{ if eq(parameters.is1ESPipeline, '') }}: - 'Illegal entry point, is1ESPipeline is not defined. Repository yaml should not directly reference templates in core-templates folder.': error + - ${{ if notIn(variables['System.TeamProject'], 'internal', 'DevDiv') }}: + - 'OneLocBuild is supported only in dnceng/internal and DevDiv/DevDiv.': error + - ${{ if eq(parameters.CeapexServiceConnection, '') }}: + - 'CeapexServiceConnection must identify a WIF service connection.': error - ${{ if ne(parameters.SkipLocProjectJsonGeneration, 'true') }}: - task: Powershell@2 @@ -88,23 +82,23 @@ jobs: displayName: Generate LocProject.json condition: ${{ parameters.condition }} - # Acquire an Entra token for ceapex feed access via WIF (dnceng/internal only). - # All other projects use PAT-based auth, since the ceapex service connection is scoped to dnceng/internal. - - ${{ if and(ne(parameters.CeapexServiceConnection, ''), eq(variables['System.TeamProject'], 'internal')) }}: - - template: /eng/common/core-templates/steps/get-federated-access-token.yml - parameters: - is1ESPipeline: ${{ parameters.is1ESPipeline }} - federatedServiceConnection: ${{ parameters.CeapexServiceConnection }} - outputVariableName: 'CeapexEntraToken' - condition: ${{ parameters.condition }} + # Acquire a short-lived Entra token for Ceapex feed access. + - template: /eng/common/core-templates/steps/get-federated-access-token.yml + parameters: + is1ESPipeline: ${{ parameters.is1ESPipeline }} + federatedServiceConnection: ${{ parameters.CeapexServiceConnection }} + outputVariableName: 'CeapexEntraToken' + condition: ${{ parameters.condition }} - # Mint a short-lived GitHub App installation token for the loc check-in PR (dnceng/internal only). - # All other projects fall back to PAT-based auth, since the app service connection is scoped to dnceng/internal. - - ${{ if and(eq(parameters.RepoType, 'gitHub'), eq(parameters.UseGitHubAppAuthentication, true), eq(variables['System.TeamProject'], 'internal')) }}: + # Mint a short-lived GitHub App installation token for the loc check-in PR. + - ${{ if eq(parameters.RepoType, 'gitHub') }}: - template: /eng/common/core-templates/steps/get-github-app-token.yml parameters: is1ESPipeline: ${{ parameters.is1ESPipeline }} - azureSubscription: ${{ parameters.GitHubAppServiceConnection }} + ${{ if and(eq(variables['System.TeamProject'], 'DevDiv'), eq(parameters.GitHubAppServiceConnection, 'dnceng-oneloc-githubapp')) }}: + azureSubscription: 'devdiv-oneloc-githubapp' + ${{ else }}: + azureSubscription: ${{ parameters.GitHubAppServiceConnection }} keyVaultName: ${{ parameters.GitHubAppKeyVaultName }} keyName: ${{ parameters.GitHubAppKeyName }} appClientId: ${{ parameters.GitHubAppClientId }} @@ -128,16 +122,10 @@ jobs: ${{ if eq(parameters.RepoType, 'gitHub') }}: isShouldReusePrSelected: ${{ parameters.ReusePr }} packageSourceAuth: patAuth - ${{ if and(ne(parameters.CeapexServiceConnection, ''), eq(variables['System.TeamProject'], 'internal')) }}: - patVariable: $(CeapexEntraToken) - ${{ if or(eq(parameters.CeapexServiceConnection, ''), ne(variables['System.TeamProject'], 'internal')) }}: - patVariable: ${{ parameters.CeapexPat }} + patVariable: $(CeapexEntraToken) ${{ if eq(parameters.RepoType, 'gitHub') }}: repoType: ${{ parameters.RepoType }} - ${{ if and(eq(parameters.UseGitHubAppAuthentication, true), eq(variables['System.TeamProject'], 'internal')) }}: - gitHubPatVariable: "$(GitHubAppInstallationToken)" - ${{ if or(eq(parameters.UseGitHubAppAuthentication, false), ne(variables['System.TeamProject'], 'internal')) }}: - gitHubPatVariable: "${{ parameters.GithubPat }}" + gitHubPatVariable: "$(GitHubAppInstallationToken)" ${{ if ne(parameters.MirrorRepo, '') }}: isMirrorRepoSelected: true gitHubOrganization: ${{ parameters.GitHubOrg }} diff --git a/eng/common/sdl/packages.config b/eng/common/sdl/packages.config index 4585cfd6bba1ed..e5f543ea68c270 100644 --- a/eng/common/sdl/packages.config +++ b/eng/common/sdl/packages.config @@ -1,4 +1,4 @@ - + diff --git a/global.json b/global.json index e7cd9ab1fc9480..fc0abba4c41317 100644 --- a/global.json +++ b/global.json @@ -8,9 +8,9 @@ "dotnet": "9.0.116" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.26406.11", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.26406.11", - "Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.26406.11", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.26458.10", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.26458.10", + "Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.26458.10", "Microsoft.Build.NoTargets": "3.7.0", "Microsoft.Build.Traversal": "3.4.0", "Microsoft.NET.Sdk.IL": "9.0.0-rtm.24511.16"