From aef1b68ae58d9d3a680ecaee850381a9d79f1d1f Mon Sep 17 00:00:00 2001 From: tj-devel709 Date: Tue, 3 Sep 2024 17:39:23 -0500 Subject: [PATCH] Re-able the Localization steps and add new credentials --- .../common/localization-handback.yml | 21 ++++++++++++------- eng/pipelines/common/localization-handoff.yml | 13 +++++++++--- eng/pipelines/handlers.yml | 8 +++---- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/eng/pipelines/common/localization-handback.yml b/eng/pipelines/common/localization-handback.yml index 6ff96f8d14d2..6053d959c983 100644 --- a/eng/pipelines/common/localization-handback.yml +++ b/eng/pipelines/common/localization-handback.yml @@ -1,3 +1,6 @@ +parameters: + CeapexPat: $(dn-bot-ceapex-package-r) # PAT for the loc AzDO instance https://dev.azure.com/ceapex + GithubPat: $(BotAccount-dotnet-bot-repo-PAT) stages: - stage: localization_handback @@ -9,19 +12,23 @@ stages: - job : generate_resx displayName: 'Process incoming translations' pool: $(HostedWinVS2019) + + variables: + - group: OneLocBuildVariables # Contains the CeapexPat and GithubPat + steps: - checkout: self persistCredentials: true clean: true - powershell: | - $srcBranch = $(Build.SourceBranch) + $srcBranch = "$(Build.SourceBranch)" Write-Host "Extracting branch name from $srcBranch..." - if ("$srcBranch" -eq "refs/heads/loc") { + if ($srcBranch -eq "refs/heads/loc") { $baseBranchName = "main" $locBranchName = "loc" - } elseif ("$srcBranch".StartsWith("refs/heads/loc-")) { - $baseBranchName = "$srcBranch".SubString("refs/heads/loc-".Length) + } elseif ($srcBranch.StartsWith("refs/heads/loc-")) { + $baseBranchName = $srcBranch.SubString("refs/heads/loc-".Length) $locBranchName = "loc-$baseBranchName" } else { throw "Invalid branch name $srcBranch." @@ -41,7 +48,7 @@ stages: Invoke-Git merge origin/$(LOC_BRANCH_NAME) --no-commit displayName: 'Merge loc Branch' - - task: cesve.one-loc-build.one-loc-build.OneLocBuild@2 + - task: OneLocBuild@2 displayName: 'Localization Build' env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) @@ -49,11 +56,11 @@ stages: locProj: 'eng/automation/LocProject.json' outDir: '$(Build.ArtifactStagingDirectory)' packageSourceAuth: patAuth - patVariable: "$(OneLocBuildPAT)" + patVariable: ${{ parameters.CeapexPat }} isCreatePrSelected: false repoType: gitHub prSourceBranchPrefix: $(LocBranchPrefix) - gitHubPatVariable: '$(GitHub.Token)' + gitHubPatVariable: "${{ parameters.GithubPat }}" gitHubPrMergeMethod: merge - powershell: | diff --git a/eng/pipelines/common/localization-handoff.yml b/eng/pipelines/common/localization-handoff.yml index bb1f34b07bdf..0195ce64cbfe 100644 --- a/eng/pipelines/common/localization-handoff.yml +++ b/eng/pipelines/common/localization-handoff.yml @@ -1,3 +1,7 @@ +parameters: + CeapexPat: $(dn-bot-ceapex-package-r) # PAT for the loc AzDO instance https://dev.azure.com/ceapex + GithubPat: $(BotAccount-dotnet-bot-repo-PAT) + stages: - stage: localization_handoff displayName: Localization Handoff @@ -8,9 +12,12 @@ stages: - job : generate_lci displayName: 'Process outgoing strings' pool: $(HostedWinVS2019) - steps: - - task: cesve.one-loc-build.one-loc-build.OneLocBuild@2 + variables: + - group: OneLocBuildVariables # Contains the CeapexPat and GithubPat + + steps: + - task: OneLocBuild@2 displayName: 'Localization Build' env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) @@ -18,7 +25,7 @@ stages: locProj: 'eng/automation/LocProject.json' outDir: '$(Build.ArtifactStagingDirectory)' packageSourceAuth: patAuth - patVariable: "$(OneLocBuildPAT)" + patVariable: ${{ parameters.CeapexPat }} - task: PublishBuildArtifacts@1 inputs: diff --git a/eng/pipelines/handlers.yml b/eng/pipelines/handlers.yml index bc9b93fa4fe6..6a804080dedf 100644 --- a/eng/pipelines/handlers.yml +++ b/eng/pipelines/handlers.yml @@ -291,7 +291,7 @@ stages: RunPlatforms: ${{ parameters.RunTemplatePlatforms }} BuildPlatforms: ${{ parameters.BuilTemplatePlatforms }} - # - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: - # - template: common/localization-handoff.yml # Process outgoing strings [Localization Handoff] - # - template: common/localization-handback.yml # Process incoming translations and Create PR to main [Localization Handback] - # - template: common/merge-translations-update.yml # Validating incoming translations strings and merge PR [Localization Handback] + - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: + - template: common/localization-handoff.yml # Process outgoing strings [Localization Handoff] + - template: common/localization-handback.yml # Process incoming translations and Create PR to main [Localization Handback] + - template: common/merge-translations-update.yml # Validating incoming translations strings and merge PR [Localization Handback]