From 1181c3241ae9a51c751e8669bc998e3925e4cf54 Mon Sep 17 00:00:00 2001 From: Tarun R <> Date: Mon, 28 Jul 2025 12:57:15 +0530 Subject: [PATCH 01/14] Removeing Azuredevops repo from resources to avoif CG alerts in tasks repo --- azure-pipelines.yml | 8 +- ci/build-single-ado-pr-steps.yml | 47 +++++++--- ci/courtesy-push.yml | 39 ++++++--- ci/courtesy-push/courtesy-push.js | 139 +++++++++++++++++++++++++++++- task-lib | 1 + tasks-common | 1 + 6 files changed, 199 insertions(+), 36 deletions(-) create mode 160000 task-lib create mode 160000 tasks-common diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 168be101d7fa..3eca9a124735 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,10 +7,6 @@ trigger: resources: repositories: - - repository: AzureDevOps - type: git - name: AzureDevOps/AzureDevOps - - repository: 1ESPipelineTemplates type: git name: 1ESPipelineTemplates/1ESPipelineTemplates @@ -165,6 +161,7 @@ extends: os: windows dependsOn: - publish + enabled: false # disabled for now to remove hard dependency on azuredevops repo as it causes fasle CG issues in tasks repo. condition: | and( succeeded(), @@ -190,9 +187,6 @@ extends: displayName: Push Nuget package allowPackageConflicts: $(COURTESY_PUSH) steps: - - checkout: AzureDevOps - fetchDepth: 1 - persistCredentials: true - checkout: self - template: /ci/courtesy-push.yml@self diff --git a/ci/build-single-ado-pr-steps.yml b/ci/build-single-ado-pr-steps.yml index 7cdb57845c3f..9a2a1b759b77 100644 --- a/ci/build-single-ado-pr-steps.yml +++ b/ci/build-single-ado-pr-steps.yml @@ -6,9 +6,6 @@ steps: - checkout: self fetchDepth: 1 -- checkout: AzureDevOps - fetchDepth: 1 - - task: NodeTool@0 displayName: Use node 20 inputs: @@ -30,22 +27,44 @@ steps: downloadPath: $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded displayName: Download Artifact -- script: node azure-pipelines-tasks\ci\courtesy-push\courtesy-push.js AzureDevOps $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded\IndividualNugetPackages\unified_deps.xml - displayName: Update unified deps - - powershell: ./azure-pipelines-tasks/ci/set-sprint-variables.ps1 displayName: Set currentSprint variables +- powershell: | + $currentDate = Get-Date -Format "yyyyMMdd-HHmm" + Write-Host "##vso[task.setVariable variable=currentDate]$currentDate" + displayName: Set currentDate variable + # returns branchName - template: /ci/generate-branch-name.yml@self -- bash: | - cd azure-pipelines-tasks/ci/courtesy-push - node push-hotfix-branch.js - node open-hotfix-pr.js - displayName: Create PR +- script: node azure-pipelines-tasks\ci\courtesy-push\courtesy-push.js AzureDevOps $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded\IndividualNugetPackages\unified_deps.xml + displayName: Update unified deps and create branch + env: + USERNAME: $(User) + PAT: $(ACCESS_TOKEN) + USEREMAIL: $(Email) + BRANCH_NAME: $(branchName) + +- powershell: | + # The JS script has already created the branch and pushed changes + # Use the branch name from the template, but only proceed if JS script set actualBranchName + $releaseBranch = "$(branchName)" + $actualBranch = "$(actualBranchName)" + + if ([string]::IsNullOrEmpty($actualBranch)) { + Write-Host "No branch was created by the JS script (no changes detected)" + exit 0 + } + + Write-Host "Branch created by JS script: $releaseBranch" + Write-Host "Creating Pull Request" + cd azure-pipelines-tasks\ci\courtesy-push + node open-courtesy-push-pull-request.js $releaseBranch + + # Sleep 30 seconds to let PR be created + Start-Sleep -Seconds 30 + displayName: Create PR in Azure DevOps + condition: ne(variables['actualBranchName'], '') env: TOKEN: $(System.AccessToken) - TASK_NAME: ${{ parameters.task_name }} - REPOSITORY: AzureDevOps - BRANCH: $(branchName) diff --git a/ci/courtesy-push.yml b/ci/courtesy-push.yml index 8d4e3e204fe3..44eacc372093 100644 --- a/ci/courtesy-push.yml +++ b/ci/courtesy-push.yml @@ -22,39 +22,50 @@ steps: displayName: Download Artifact - script: node azure-pipelines-tasks\ci\courtesy-push\courtesy-push.js AzureDevOps $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded\IndividualNugetPackages\unified_deps.xml - displayName: Update unified deps + displayName: Update unified deps and create branch + env: + USERNAME: $(User) + PAT: $(ACCESS_TOKEN) + USEREMAIL: $(Email) + BRANCH_NAME: $(branchName) - powershell: ./azure-pipelines-tasks/ci/set-sprint-variables.ps1 displayName: Set currentSprint variables +- powershell: | + $currentDate = Get-Date -Format "yyyyMMdd-HHmm" + Write-Host "##vso[task.setVariable variable=currentDate]$currentDate" + displayName: Set currentDate variable + +# returns branchName - template: /ci/generate-branch-name.yml@self - powershell: | + # The JS script has already created the branch and pushed changes + # Use the branch name from the template, but only proceed if JS script set actualBranchName $releaseBranch = "$(branchName)" - - # Push branch to git - Write-Host "Pushing branch to AzureDevOps" - cd AzureDevOps - git checkout -b $releaseBranch - git config --global user.email "$(username)@microsoft.com" - git config --global user.name "$(username)" - git add Directory.Packages.props - git add Tfs\Service\Deploy\components\* - git commit -m "Courtesy bump of tasks" - git push origin $releaseBranch --force + $actualBranch = "$(actualBranchName)" + + if ([string]::IsNullOrEmpty($actualBranch)) { + Write-Host "No branch was created by the JS script (no changes detected)" + exit 0 + } + + Write-Host "Branch created by JS script: $releaseBranch" Write-Host "Creating Pull Request" - cd ..\azure-pipelines-tasks\ci\courtesy-push + cd azure-pipelines-tasks\ci\courtesy-push node open-courtesy-push-pull-request.js $releaseBranch # Sleep 30 seconds to let PR be created Start-Sleep -Seconds 30 displayName: Create PR in Azure DevOps + condition: ne(variables['actualBranchName'], '') env: TOKEN: $(System.AccessToken) - powershell: .\azure-pipelines-tasks\ci\courtesy-push\send-notification.ps1 displayName: Send MS Teams notification - condition: eq(variables['build.reason'], 'Schedule') + condition: and(eq(variables['build.reason'], 'Schedule'), ne(variables['actualBranchName'], '')) env: TEAMS_WEBHOOK: $(MSTeamsUri) diff --git a/ci/courtesy-push/courtesy-push.js b/ci/courtesy-push/courtesy-push.js index e5555fdeaebe..d829ac4eadcb 100644 --- a/ci/courtesy-push/courtesy-push.js +++ b/ci/courtesy-push/courtesy-push.js @@ -1,6 +1,7 @@ const fs = require('fs'); const path = require('path'); const xml2js = require('xml2js'); +const cp = require('child_process'); const azureSourceFolder = process.argv[2]; const newDeps = process.argv[3]; @@ -8,6 +9,96 @@ const unifiedDepsPath = path.join(azureSourceFolder, 'Directory.Packages.props') const tfsServerPath = path.join(azureSourceFolder, 'Tfs', 'Service', 'Deploy', 'components', 'TfsServer.hosted.xml'); const msPrefix = 'Mseng.MS.TF.DistributedTask.Tasks.'; +// Git configuration +const GIT = 'git'; +const token = process.env.PAT || process.env.TOKEN; +const orgUrl = 'dev.azure.com/mseng'; +const project = 'AzureDevOps'; +const repo = 'AzureDevOps'; +const username = process.env.USERNAME || 'azure-pipelines-bot'; +const sourceBranch = process.env.BRANCH_NAME || `courtesy-push-${Date.now()}`; +const commitMessage = 'Update UnifiedDependencies.xml and TfsServer.hosted.xml'; +const dryrun = process.env.DRYRUN === 'true'; + +// Validate required environment variables +if (!token) { + console.error('Error: PAT or TOKEN environment variable is required for git authentication'); + process.exit(1); +} + +if (!azureSourceFolder || !newDeps) { + console.error('Usage: node courtesy-push.js '); + process.exit(1); +} + +/** + * Execute a command in the foreground + * @param {string} command - The command to execute + * @param {string} directory - The directory to execute the command in + * @param {boolean} dryrun - Whether this is a dry run + */ +function execInForeground(command, directory, dryrun = false) { + directory = directory || '.'; + console.log(`% ${command}`); + if (!dryrun) { + try { + cp.execSync(command, { cwd: directory, stdio: [process.stdin, process.stdout, process.stderr] }); + } catch (error) { + console.error(`Command failed: ${command}`); + throw error; + } + } +} + +/** + * Configure git user settings + */ +function gitConfig() { + try { + execInForeground(`${GIT} config --global user.email "${username}@microsoft.com"`, null, dryrun); + execInForeground(`${GIT} config --global user.name "${username}"`, null, dryrun); + } catch (error) { + console.warn('Warning: Could not configure git user settings. This might be expected if already configured.'); + } +} + +/** + * Clone the Azure DevOps repository if it doesn't exist + * @param {string} repoPath - Path where the repo should be cloned + */ +function ensureRepoExists(repoPath) { + if (!fs.existsSync(repoPath)) { + console.log(`Cloning Azure DevOps repository to ${repoPath}`); + const gitUrl = `https://${token}@${orgUrl}/${project}/_git/${repo}`; + execInForeground(`${GIT} clone --depth 1 ${gitUrl} ${repoPath}`, null, dryrun); + } else { + console.log(`Repository already exists at ${repoPath}`); + // Pull latest changes + execInForeground(`${GIT} pull origin master`, repoPath, dryrun); + } +} + +/** + * Commit and push changes to the Azure DevOps repository + * @param {string} repoPath - Path to the repository + * @param {string} targetToCommit - Path to the files to commit + */ +function commitAndPushChanges(repoPath, targetToCommit) { + console.log('Adding changes to git...'); + execInForeground(`${GIT} add ${targetToCommit}`, repoPath, dryrun); + + gitConfig(); + + console.log(`Creating branch ${sourceBranch}...`); + execInForeground(`${GIT} checkout -b ${sourceBranch}`, repoPath, dryrun); + + console.log('Committing changes...'); + execInForeground(`${GIT} commit -m "${commitMessage}"`, repoPath, dryrun); + + console.log('Pushing changes...'); + execInForeground(`${GIT} push --force origin ${sourceBranch}`, repoPath, dryrun); +} + /** * Helper function to check if the value is included in the array but not equal to the value in the array * E.g. We compared generated task names such as Mseng.MS.TF.DistributedTask.Tasks.AppCenterDistributeV1_Node20 @@ -220,6 +311,11 @@ async function updateUnifiedDeps(unifiedDepsPath, newUnifiedDepsPath) { * @param {Object} depsToUpdate - structure to track added/removed dependencies (formed in updateUnifiedDeps) */ async function updateTfsServerDeps(pathToTfsCore) { + // Ensure the Azure DevOps repository exists + const repoPath = azureSourceFolder; + ensureRepoExists(repoPath); + + // Update the unified dependencies const depsToUpdate = await updateUnifiedDeps(unifiedDepsPath, newDeps); const tfsCore = fs.readFileSync(pathToTfsCore, 'utf8'); @@ -251,6 +347,47 @@ async function updateTfsServerDeps(pathToTfsCore) { fs.writeFileSync(pathToTfsCore, xml); console.log('Inserting into Tfs Servicing Core file done.'); + + // Commit and push changes if there are any updates + if (depsToUpdate.added.length > 0 || depsToUpdate.removed.length > 0) { + console.log(`Dependencies updated: ${depsToUpdate.added.length} added, ${depsToUpdate.removed.length} removed`); + + // Commit both the unified dependencies file and the TFS server file + const filesToCommit = [ + path.relative(repoPath, unifiedDepsPath), + path.relative(repoPath, pathToTfsCore) + ].join(' '); + + commitAndPushChanges(repoPath, filesToCommit); + console.log('Changes committed and pushed successfully.'); + + // Output branch name for Azure Pipelines to use (in case it was modified) + console.log(`##vso[task.setvariable variable=actualBranchName]${sourceBranch}`); + + } else { + console.log('No dependency changes detected. Nothing to commit.'); + } +} + +/** + * Main execution function + */ +async function main() { + try { + console.log('Starting courtesy push process...'); + console.log(`Azure source folder: ${azureSourceFolder}`); + console.log(`New dependencies file: ${newDeps}`); + console.log(`Branch name: ${sourceBranch}`); + console.log(`Dry run: ${dryrun}`); + + await updateTfsServerDeps(tfsServerPath); + + console.log('Courtesy push process completed successfully.'); + } catch (error) { + console.error('Error during courtesy push process:', error.message); + process.exit(1); + } } -updateTfsServerDeps(tfsServerPath); +// Execute the main function +main(); diff --git a/task-lib b/task-lib new file mode 160000 index 000000000000..8ac9e00e7020 --- /dev/null +++ b/task-lib @@ -0,0 +1 @@ +Subproject commit 8ac9e00e702005dc1f8d0dad1f064cc0cf8ad497 diff --git a/tasks-common b/tasks-common new file mode 160000 index 000000000000..d4d4458180f1 --- /dev/null +++ b/tasks-common @@ -0,0 +1 @@ +Subproject commit d4d4458180f1feb4de6a4216061ba224d34fc56f From b9119dfe55cf449e1f3b6cb4bef363ba4c38047d Mon Sep 17 00:00:00 2001 From: surajitshil Date: Wed, 30 Jul 2025 10:17:03 +0530 Subject: [PATCH 02/14] Updating courtesy-push.js and adding Dry Run parameter to avoid PR creation, avoid pushing changes to the feed --- .gitignore | 4 + azure-pipelines.yml | 13 +- ci/build-single-ado-pr-steps.yml | 30 +---- ci/courtesy-push.yml | 43 ++---- ci/courtesy-push/courtesy-push.js | 204 +++++++++++++++++++++++------ ci/courtesy-push/package-lock.json | 2 +- task-lib | 1 - tasks-common | 1 - 8 files changed, 195 insertions(+), 103 deletions(-) delete mode 160000 task-lib delete mode 160000 tasks-common diff --git a/.gitignore b/.gitignore index d966bcd785b9..eea380e7b727 100644 --- a/.gitignore +++ b/.gitignore @@ -223,3 +223,7 @@ _dotnetsdk/ FilesOverriddenForConfigGoHereREADME.txt _generated_local/ + +# Auto-cloned dependencies during build +task-lib/ +tasks-common/ diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3eca9a124735..96361fbd6584 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -41,6 +41,10 @@ parameters: displayName: Publish to test feed (DistributedTasks-test), for infrastucture testing type: boolean default: false +- name: dryRun + displayName: Dry Run (no push, no PR, no feed publish) + type: boolean + default: false variables: - name: currentDate @@ -78,6 +82,11 @@ variables: value: 'true' ${{ else }}: value: 'false' +- name: isDryRun + ${{ if eq(parameters.dryRun, true) }}: + value: 'true' + ${{ else }}: + value: 'false' extends: template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates @@ -133,7 +142,7 @@ extends: # Publish - job: publish - displayName: Publish + displayName: Publish Nuget Artifacts timeoutInMinutes: 360 dependsOn: - build_all_windows @@ -161,7 +170,6 @@ extends: os: windows dependsOn: - publish - enabled: false # disabled for now to remove hard dependency on azuredevops repo as it causes fasle CG issues in tasks repo. condition: | and( succeeded(), @@ -176,6 +184,7 @@ extends: ) templateContext: outputs: + ${{ if not(parameters.dryRun) }}: - output: nuget packagesToPush: '$(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded/IndividualNugetPackages/*/*.nupkg' packageParentPath: '$(Build.SourcesDirectory)' diff --git a/ci/build-single-ado-pr-steps.yml b/ci/build-single-ado-pr-steps.yml index 9a2a1b759b77..99d3a2228799 100644 --- a/ci/build-single-ado-pr-steps.yml +++ b/ci/build-single-ado-pr-steps.yml @@ -38,33 +38,11 @@ steps: # returns branchName - template: /ci/generate-branch-name.yml@self -- script: node azure-pipelines-tasks\ci\courtesy-push\courtesy-push.js AzureDevOps $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded\IndividualNugetPackages\unified_deps.xml +- script: node azure-pipelines-tasks\ci\courtesy-push\courtesy-push.js $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded\IndividualNugetPackages\unified_deps.xml displayName: Update unified deps and create branch env: - USERNAME: $(User) - PAT: $(ACCESS_TOKEN) - USEREMAIL: $(Email) + USERNAME: $(Build.RequestedFor) + PAT: $(System.AccessToken) + USEREMAIL: $(Build.RequestedForEmail) BRANCH_NAME: $(branchName) -- powershell: | - # The JS script has already created the branch and pushed changes - # Use the branch name from the template, but only proceed if JS script set actualBranchName - $releaseBranch = "$(branchName)" - $actualBranch = "$(actualBranchName)" - - if ([string]::IsNullOrEmpty($actualBranch)) { - Write-Host "No branch was created by the JS script (no changes detected)" - exit 0 - } - - Write-Host "Branch created by JS script: $releaseBranch" - Write-Host "Creating Pull Request" - cd azure-pipelines-tasks\ci\courtesy-push - node open-courtesy-push-pull-request.js $releaseBranch - - # Sleep 30 seconds to let PR be created - Start-Sleep -Seconds 30 - displayName: Create PR in Azure DevOps - condition: ne(variables['actualBranchName'], '') - env: - TOKEN: $(System.AccessToken) diff --git a/ci/courtesy-push.yml b/ci/courtesy-push.yml index 44eacc372093..5752cf9a2d2a 100644 --- a/ci/courtesy-push.yml +++ b/ci/courtesy-push.yml @@ -11,7 +11,7 @@ steps: displayName: Copy baseline files to root - powershell: | - cd azure-pipelines-tasks/ci/courtesy-push + cd ci/courtesy-push npm install displayName: npm install @@ -21,15 +21,7 @@ steps: downloadPath: $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded displayName: Download Artifact -- script: node azure-pipelines-tasks\ci\courtesy-push\courtesy-push.js AzureDevOps $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded\IndividualNugetPackages\unified_deps.xml - displayName: Update unified deps and create branch - env: - USERNAME: $(User) - PAT: $(ACCESS_TOKEN) - USEREMAIL: $(Email) - BRANCH_NAME: $(branchName) - -- powershell: ./azure-pipelines-tasks/ci/set-sprint-variables.ps1 +- powershell: $(Build.SourcesDirectory)/ci/set-sprint-variables.ps1 displayName: Set currentSprint variables - powershell: | @@ -37,31 +29,18 @@ steps: Write-Host "##vso[task.setVariable variable=currentDate]$currentDate" displayName: Set currentDate variable -# returns branchName - template: /ci/generate-branch-name.yml@self + parameters: + prefix: users/$(Build.RequestedFor) -- powershell: | - # The JS script has already created the branch and pushed changes - # Use the branch name from the template, but only proceed if JS script set actualBranchName - $releaseBranch = "$(branchName)" - $actualBranch = "$(actualBranchName)" - - if ([string]::IsNullOrEmpty($actualBranch)) { - Write-Host "No branch was created by the JS script (no changes detected)" - exit 0 - } - - Write-Host "Branch created by JS script: $releaseBranch" - Write-Host "Creating Pull Request" - cd azure-pipelines-tasks\ci\courtesy-push - node open-courtesy-push-pull-request.js $releaseBranch - - # Sleep 30 seconds to let PR be created - Start-Sleep -Seconds 30 - displayName: Create PR in Azure DevOps - condition: ne(variables['actualBranchName'], '') +- script: node azure-pipelines-tasks\ci\courtesy-push\courtesy-push.js $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded\IndividualNugetPackages\unified_deps.xml + displayName: Update unified deps and create branch env: - TOKEN: $(System.AccessToken) + USERNAME: $(Build.RequestedFor) + PAT: $(System.AccessToken) + USEREMAIL: $(Build.RequestedForEmail) + BRANCH_NAME: $(branchName) + DRYRUN: $(isDryRun) - powershell: .\azure-pipelines-tasks\ci\courtesy-push\send-notification.ps1 displayName: Send MS Teams notification diff --git a/ci/courtesy-push/courtesy-push.js b/ci/courtesy-push/courtesy-push.js index d829ac4eadcb..803b04fd563f 100644 --- a/ci/courtesy-push/courtesy-push.js +++ b/ci/courtesy-push/courtesy-push.js @@ -3,16 +3,14 @@ const path = require('path'); const xml2js = require('xml2js'); const cp = require('child_process'); -const azureSourceFolder = process.argv[2]; -const newDeps = process.argv[3]; -const unifiedDepsPath = path.join(azureSourceFolder, 'Directory.Packages.props'); -const tfsServerPath = path.join(azureSourceFolder, 'Tfs', 'Service', 'Deploy', 'components', 'TfsServer.hosted.xml'); + +const newDeps = process.argv[2]; const msPrefix = 'Mseng.MS.TF.DistributedTask.Tasks.'; // Git configuration const GIT = 'git'; const token = process.env.PAT || process.env.TOKEN; -const orgUrl = 'dev.azure.com/mseng'; +const orgUrl= 'dev.azure.com/mseng' const project = 'AzureDevOps'; const repo = 'AzureDevOps'; const username = process.env.USERNAME || 'azure-pipelines-bot'; @@ -26,8 +24,8 @@ if (!token) { process.exit(1); } -if (!azureSourceFolder || !newDeps) { - console.error('Usage: node courtesy-push.js '); +if (!newDeps) { + console.error('Usage: node courtesy-push.js '); process.exit(1); } @@ -37,16 +35,14 @@ if (!azureSourceFolder || !newDeps) { * @param {string} directory - The directory to execute the command in * @param {boolean} dryrun - Whether this is a dry run */ -function execInForeground(command, directory, dryrun = false) { +function execInForeground(command, directory) { directory = directory || '.'; console.log(`% ${command}`); - if (!dryrun) { - try { + try { cp.execSync(command, { cwd: directory, stdio: [process.stdin, process.stdout, process.stderr] }); - } catch (error) { + } catch (error) { console.error(`Command failed: ${command}`); throw error; - } } } @@ -55,8 +51,8 @@ function execInForeground(command, directory, dryrun = false) { */ function gitConfig() { try { - execInForeground(`${GIT} config --global user.email "${username}@microsoft.com"`, null, dryrun); - execInForeground(`${GIT} config --global user.name "${username}"`, null, dryrun); + execInForeground(`${GIT} config --global user.email "${username}@microsoft.com"`, null); + execInForeground(`${GIT} config --global user.name "${username}"`, null); } catch (error) { console.warn('Warning: Could not configure git user settings. This might be expected if already configured.'); } @@ -66,16 +62,17 @@ function gitConfig() { * Clone the Azure DevOps repository if it doesn't exist * @param {string} repoPath - Path where the repo should be cloned */ + function ensureRepoExists(repoPath) { - if (!fs.existsSync(repoPath)) { - console.log(`Cloning Azure DevOps repository to ${repoPath}`); - const gitUrl = `https://${token}@${orgUrl}/${project}/_git/${repo}`; - execInForeground(`${GIT} clone --depth 1 ${gitUrl} ${repoPath}`, null, dryrun); - } else { - console.log(`Repository already exists at ${repoPath}`); - // Pull latest changes - execInForeground(`${GIT} pull origin master`, repoPath, dryrun); + const gitUrl = `https://${token}@${orgUrl}/${project}/_git/${repo}`; + + if (fs.existsSync(repoPath)) { + console.log(`Removing existing repository at ${repoPath}`); + fs.rmSync(repoPath, { recursive: true, force: true }); } + + console.log(`Cloning Azure DevOps repository to ${repoPath}`); + execInForeground(`${GIT} clone --depth 1 ${gitUrl} ${repoPath}`, null); } /** @@ -83,20 +80,135 @@ function ensureRepoExists(repoPath) { * @param {string} repoPath - Path to the repository * @param {string} targetToCommit - Path to the files to commit */ + function commitAndPushChanges(repoPath, targetToCommit) { console.log('Adding changes to git...'); - execInForeground(`${GIT} add ${targetToCommit}`, repoPath, dryrun); + + // Debug: Check git status before adding + console.log('\n=== Git Status Before Add ==='); + try { + const gitStatus = cp.execSync('git status --porcelain', { cwd: repoPath, encoding: 'utf8' }); + console.log('Git status output:', gitStatus || '(no changes)'); + + const diffOutput = cp.execSync('git diff --name-only', { cwd: repoPath, encoding: 'utf8' }); + console.log('Modified files:', diffOutput || '(no files)'); + } catch (error) { + console.log('Could not get git status:', error.message); + } + + execInForeground(`${GIT} add ${targetToCommit}`, repoPath, false); + + // Debug: Check git status after adding + console.log('\n=== Git Status After Add ==='); + try { + const gitStatusAfter = cp.execSync('git status --porcelain', { cwd: repoPath, encoding: 'utf8' }); + console.log('Git status after add:', gitStatusAfter || '(no changes staged)'); + } catch (error) { + console.log('Could not get git status after add:', error.message); + } gitConfig(); console.log(`Creating branch ${sourceBranch}...`); - execInForeground(`${GIT} checkout -b ${sourceBranch}`, repoPath, dryrun); + execInForeground(`${GIT} checkout -b ${sourceBranch}`, repoPath); console.log('Committing changes...'); - execInForeground(`${GIT} commit -m "${commitMessage}"`, repoPath, dryrun); + execInForeground(`${GIT} commit -m "${commitMessage}"`, repoPath); console.log('Pushing changes...'); - execInForeground(`${GIT} push --force origin ${sourceBranch}`, repoPath, dryrun); + if(dryrun){ + console.log("SKIPPED THE PUSH COMMAND BECAUSE DRYRUN IS SET TO TRUE") + } + else{ + execInForeground(`${GIT} push origin ${sourceBranch}`, repoPath); + } + +} + +/** + * Create a Pull Request in Azure DevOps + * @param {string} sourceBranch - The source branch name for the PR + */ +async function createPullRequest(sourceBranch) { + console.log('\n=== Creating Pull Request ==='); + + try { + const azdev = require('azure-devops-node-api'); + + if (!token) { + console.error('No token provided for PR creation'); + return; + } + + // const fullOrgUrl = `https://${orgUrl}`; + const authHandler = azdev.getPersonalAccessTokenHandler(token); + + const refs = { + sourceRefName: `refs/heads/${sourceBranch}`, + targetRefName: 'refs/heads/main' // Change to 'refs/heads/master' if your repo uses master + }; + + const pullRequestToCreate = { + ...refs, + title: 'Courtesy Bump of Tasks', + description: `Autogenerated PR to bump the versions of tasks + +This PR was automatically created by the courtesy push process to update: +- Directory.Packages.props with new task dependencies +- TfsServer.hosted.xml with new task configurations + +Branch: ${sourceBranch} +Generated: ${new Date().toISOString()}` + }; + + if(!dryrun){ + + console.log('Getting Azure DevOps connection...'); + const connection = new azdev.WebApi(`https://${orgUrl}`, authHandler); + + console.log('Getting Git API...'); + const gitApi = await connection.getGitApi(); + + console.log('Checking if an active pull request already exists...'); + let existingPRs = await gitApi.getPullRequests(repo, refs, project); + let PR = existingPRs[0]; + + if (PR) { + console.log(`PR already exists: ${PR.pullRequestId}`); + } else { + console.log('Creating new pull request...'); + PR = await gitApi.createPullRequest(pullRequestToCreate, repo, project); + console.log(`Successfully created PR: ${PR.pullRequestId}`); + } + + const prLink = `https://${orgUrl}/${project}/_git/${repo}/pullrequest/${PR.pullRequestId}`; + console.log(`Link to the PR: ${prLink}`); + + // Set Azure Pipeline variables + console.log(`##vso[task.setvariable variable=PR_ID]${PR.pullRequestId}`); + console.log(`##vso[task.setvariable variable=PR_LINK]${prLink}`); + + return { + prId: PR.pullRequestId, + prLink: prLink + }; + }else{ + console.log("================Printing the PR details:================") + console.log(` Source Branch: ${sourceBranch}`); + console.log(` Target Branch: main`); + console.log(` Title: Courtesy Bump of Tasks`); + console.log(` Organization: ${orgUrl}`); + console.log(` Project: ${project}`); + console.log(` Repository: ${repo}`); + console.log(` Pull-Request description:${JSON.stringify(pullRequestToCreate,null,2)}`) + console.log('DRYRUN set to true-skipping actual PR creation...') + } + + + } catch (error) { + console.error('Error creating pull request:', error.message); + throw error; + } } /** @@ -159,17 +271,13 @@ async function getDeps(depArr) { const newDep = depArr[i]; var [ name, version ] = await extractDependency(newDep); const lowercasedName = name.toLowerCase(); - if (!deps.hasOwnProperty(lowercasedName)) deps[lowercasedName] = {}; - const dep = deps[lowercasedName]; - dep.name = name; dep.version = version; dep.depStr = newDep; } - const keys = Object.keys(deps); for (let dep in deps) { @@ -217,7 +325,6 @@ async function removeConfigsForTasks(depsArray, depsForUpdate, updatedDeps) { } const basicName = name.toLowerCase(); - if (isIncludeButNotEqual(basicDepsForUpdate, basicName)) { newDepsArr.splice(index, 1); updatedDepsObj.removed.push(name); @@ -284,9 +391,11 @@ function parseUnifiedDependencies(path) { * The function parses unified dependencies file and updates it with new dependencies/remove unused * Since the generated tasks can only be used and build with default version, if unified_deps.xml doesn't contain * the default version, the specific config (e.g. Node16) will be removed from the list of dependencies - * @param {String} pathToUnifiedDeps - path to UnifiedDependencies.xml - * @param {String} pathToNewUnifiedDeps - path to unified_deps.xml which contains dependencies updated on current week + * @param {String} unifiedDepsPath - path to UnifiedDependencies.xml + * @param {String} newUnifiedDepsPath - path to unified_deps.xml which contains dependencies updated on current week */ + + async function updateUnifiedDeps(unifiedDepsPath, newUnifiedDepsPath) { let currentDependencies = parseUnifiedDependencies(unifiedDepsPath); let updatedDependencies = parseUnifiedDependencies(newUnifiedDepsPath); @@ -310,11 +419,16 @@ async function updateUnifiedDeps(unifiedDepsPath, newUnifiedDepsPath) { * @param {String} pathToTfsCore - path to TfsServer.Servicing.core.xml * @param {Object} depsToUpdate - structure to track added/removed dependencies (formed in updateUnifiedDeps) */ -async function updateTfsServerDeps(pathToTfsCore) { - // Ensure the Azure DevOps repository exists - const repoPath = azureSourceFolder; - ensureRepoExists(repoPath); +async function updateTfsServerDeps() { + const repoName='AzureDevops' + const agentTempDir=process.env.AGENT_TEMPDIRECTORY; + const repoPath=path.join(agentTempDir, repoName); + ensureRepoExists(repoPath); + + const unifiedDepsPath = path.join(repoPath, 'Directory.Packages.props'); + const tfsServerPath = path.join(repoPath, 'Tfs', 'Service', 'Deploy', 'components', 'TfsServer.hosted.xml'); + const pathToTfsCore=tfsServerPath // Update the unified dependencies const depsToUpdate = await updateUnifiedDeps(unifiedDepsPath, newDeps); @@ -359,10 +473,22 @@ async function updateTfsServerDeps(pathToTfsCore) { ].join(' '); commitAndPushChanges(repoPath, filesToCommit); + if(!dryrun) console.log('Changes committed and pushed successfully.'); + else{ + console.log('Changes committed but not pushed because DRYRUN is set to true') + } // Output branch name for Azure Pipelines to use (in case it was modified) console.log(`##vso[task.setvariable variable=actualBranchName]${sourceBranch}`); + + // Create Pull Request + const prResult = await createPullRequest(sourceBranch); + if (prResult) { + console.log(`Pull Request created successfully: ${prResult.prLink}`); + } else { + console.log('Pull Request creation failed or skipped'); + } } else { console.log('No dependency changes detected. Nothing to commit.'); @@ -375,12 +501,10 @@ async function updateTfsServerDeps(pathToTfsCore) { async function main() { try { console.log('Starting courtesy push process...'); - console.log(`Azure source folder: ${azureSourceFolder}`); console.log(`New dependencies file: ${newDeps}`); console.log(`Branch name: ${sourceBranch}`); console.log(`Dry run: ${dryrun}`); - - await updateTfsServerDeps(tfsServerPath); + await updateTfsServerDeps(); console.log('Courtesy push process completed successfully.'); } catch (error) { diff --git a/ci/courtesy-push/package-lock.json b/ci/courtesy-push/package-lock.json index f378d1d9d90d..99b6c01259d3 100644 --- a/ci/courtesy-push/package-lock.json +++ b/ci/courtesy-push/package-lock.json @@ -113,4 +113,4 @@ "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" } } -} +} \ No newline at end of file diff --git a/task-lib b/task-lib deleted file mode 160000 index 8ac9e00e7020..000000000000 --- a/task-lib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8ac9e00e702005dc1f8d0dad1f064cc0cf8ad497 diff --git a/tasks-common b/tasks-common deleted file mode 160000 index d4d4458180f1..000000000000 --- a/tasks-common +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d4d4458180f1feb4de6a4216061ba224d34fc56f From 19e8eb4ec3609a94c4beb8399fc7a6516e88f2cb Mon Sep 17 00:00:00 2001 From: surajitshil Date: Tue, 5 Aug 2025 17:32:00 +0530 Subject: [PATCH 03/14] Fixing parsing errors --- azure-pipelines.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 96361fbd6584..cdaa08651ccf 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -184,11 +184,10 @@ extends: ) templateContext: outputs: - ${{ if not(parameters.dryRun) }}: - output: nuget packagesToPush: '$(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded/IndividualNugetPackages/*/*.nupkg' packageParentPath: '$(Build.SourcesDirectory)' - ${{ if eq(parameters.publishToDistributedTaskTest, true) }}: + ${{ if or(eq(parameters.dryRun, true),eq(parameters.publishToDistributedTaskTest, true)) }}: publishVstsFeed: 'c86767d8-af79-4303-a7e6-21da0ba435e2/9d34d871-8032-4e10-a34a-c7a01e125865' ${{ else }}: publishVstsFeed: 'c86767d8-af79-4303-a7e6-21da0ba435e2/e10d0795-57cd-4d7f-904e-5f39703cb096' From f84e90ed8a6b0a8131c8596b4234877b7f89ef27 Mon Sep 17 00:00:00 2001 From: surajitshil Date: Wed, 6 Aug 2025 13:59:39 +0530 Subject: [PATCH 04/14] Adding DRY RUN parameter in release note step --- ci/build-all-steps.yml | 23 +++++++++++++++-------- ci/ci-release-notes/release-notes.js | 16 +++++++++++++--- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/ci/build-all-steps.yml b/ci/build-all-steps.yml index 6dd421579624..42998fee665a 100644 --- a/ci/build-all-steps.yml +++ b/ci/build-all-steps.yml @@ -78,6 +78,7 @@ steps: - powershell: | $releaseBranch = "$(branchName)" + $isDryRun = "$(isDryRun)" # add config entry to avoid errors while pulling git config --global user.email "$(username)@microsoft.com" @@ -90,13 +91,18 @@ steps: # Pull commits from remote and push branch to git git checkout -b $releaseBranch - Write-Host 'Trying to pull the remote branch..' - git pull https://$(GitHubPAT)@github.com/microsoft/azure-pipelines-tasks $releaseBranch - if (-not $?) { - Write-Host 'Failed to pull the remote branch. This is expected if the remote branch doesn't exist. + + if( $isDryRun -eq 'true' ) { + Write-Host 'DRY RUN: Skipping Git push operations to remote repository' + }else{ + Write-Host 'Trying to pull the remote branch..' + git pull https://$(GitHubPAT)@github.com/microsoft/azure-pipelines-tasks $releaseBranch + if (-not $?) { + Write-Host 'Failed to pull the remote branch. This is expected if the remote branch doesn't exist.' + } + Write-Host 'Trying to push to the remote branch..' + git push https://$(GitHubPAT)@github.com/microsoft/azure-pipelines-tasks $releaseBranch } - Write-Host 'Trying to push to the remote branch..' - git push https://$(GitHubPAT)@github.com/microsoft/azure-pipelines-tasks $releaseBranch condition: | and( succeeded(), @@ -206,11 +212,12 @@ steps: - powershell: | $releaseBranch = "$(branchName)" + $isDryRun = "$(isDryRun)" - if ($(currentSprintWeek) -eq 3) { + if (($(currentSprintWeek) -eq 3) -or ($isDryRun -eq 'true')) { cd $(System.DefaultWorkingDirectory)/ci/ci-release-notes npm install - node release-notes.js --token $(GitHubPAT) --version $(currentSprint) --releaseBranch $releaseBranch + node release-notes.js --token $(GitHubPAT) --version $(currentSprint) --releaseBranch $releaseBranch --isDryRun $isDryRun } else { echo "Skipping since release notes generating on week 3" } diff --git a/ci/ci-release-notes/release-notes.js b/ci/ci-release-notes/release-notes.js index 1d3c27759cdc..8dee169841d2 100644 --- a/ci/ci-release-notes/release-notes.js +++ b/ci/ci-release-notes/release-notes.js @@ -21,11 +21,16 @@ const octokit = new Octokit({ auth: argv.token }); * @param {string} newRelease - Sprint version of the checked release * @returns {Promise} - Exit from the program if the version already exists */ -async function verifyNewReleaseTagOk(newRelease) { +async function verifyNewReleaseTagOk(newRelease,isDryRun) { if (!newRelease || !newRelease.match(VALID_RELEASE_RE)) { console.log(`Invalid version '${newRelease}'. Version must be in the form of .. where each level is 0-999`); process.exit(-1); } + if (isDryRun === 'true') { + console.log('DRY RUN: Skipping actual tag verification step'); + return; + } + try { var tag = 'v' + newRelease; await octokit.repos.getReleaseByTag({ @@ -204,8 +209,9 @@ async function main() { const version = argv.version ? String(argv.version) : null; const branch = argv.branch || 'master'; const releaseBranch = argv.releaseBranch; + const isDryRun= argv.isDryRun; - console.log({version, branch, releaseBranch}); + console.log({version, branch, releaseBranch,isDryRun}); try { if (!version) { console.log('Error: You must supply a version'); @@ -217,7 +223,7 @@ async function main() { process.exit(-1); } - await verifyNewReleaseTagOk(version); + await verifyNewReleaseTagOk(version,isDryRun); checkGitStatus(); const data = await fetchPRsForRelease(branch, version); @@ -225,7 +231,11 @@ async function main() { const PRs = await getPRsFiles(data); const releaseNotes = tempGen.generateReleaseNotesForPRs(PRs, version); console.log('Release Notes:\n', releaseNotes); // Output release notes to console + if(isDryRun=== 'true'){ + console.log('DRY RUN: Skipping actual release creation'); + }else{ await createRelease(releaseNotes, version, releaseBranch); + } } catch (err) { throw err; } From 7c9a382687e23c4df035eab7e1d6084be1fbcbca Mon Sep 17 00:00:00 2001 From: surajitshil Date: Wed, 6 Aug 2025 14:59:39 +0530 Subject: [PATCH 05/14] Fixing paths and identation --- ci/build-all-steps.yml | 1 - ci/ci-release-notes/release-notes.js | 1 - ci/courtesy-push.yml | 10 +++++----- ci/courtesy-push/courtesy-push.js | 8 -------- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/ci/build-all-steps.yml b/ci/build-all-steps.yml index 36628a8306a2..8509af247168 100644 --- a/ci/build-all-steps.yml +++ b/ci/build-all-steps.yml @@ -91,7 +91,6 @@ steps: # Pull commits from remote and push branch to git git checkout -b $releaseBranch - if( $isDryRun -eq 'true' ) { Write-Host 'DRY RUN: Skipping Git push operations to remote repository' }else{ diff --git a/ci/ci-release-notes/release-notes.js b/ci/ci-release-notes/release-notes.js index 8dee169841d2..1b5d76401229 100644 --- a/ci/ci-release-notes/release-notes.js +++ b/ci/ci-release-notes/release-notes.js @@ -30,7 +30,6 @@ async function verifyNewReleaseTagOk(newRelease,isDryRun) { console.log('DRY RUN: Skipping actual tag verification step'); return; } - try { var tag = 'v' + newRelease; await octokit.repos.getReleaseByTag({ diff --git a/ci/courtesy-push.yml b/ci/courtesy-push.yml index 5752cf9a2d2a..3451566c0834 100644 --- a/ci/courtesy-push.yml +++ b/ci/courtesy-push.yml @@ -11,7 +11,7 @@ steps: displayName: Copy baseline files to root - powershell: | - cd ci/courtesy-push + cd azure-pipelines-tasks/ci/courtesy-push npm install displayName: npm install @@ -21,7 +21,7 @@ steps: downloadPath: $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded displayName: Download Artifact -- powershell: $(Build.SourcesDirectory)/ci/set-sprint-variables.ps1 +- powershell: ./azure-pipelines-tasks/ci/set-sprint-variables.ps1 displayName: Set currentSprint variables - powershell: | @@ -37,14 +37,14 @@ steps: displayName: Update unified deps and create branch env: USERNAME: $(Build.RequestedFor) - PAT: $(System.AccessToken) + TOKEN: $(System.AccessToken) USEREMAIL: $(Build.RequestedForEmail) BRANCH_NAME: $(branchName) DRYRUN: $(isDryRun) - powershell: .\azure-pipelines-tasks\ci\courtesy-push\send-notification.ps1 displayName: Send MS Teams notification - condition: and(eq(variables['build.reason'], 'Schedule'), ne(variables['actualBranchName'], '')) + condition: eq(variables['build.reason'], 'Schedule') env: TEAMS_WEBHOOK: $(MSTeamsUri) - + \ No newline at end of file diff --git a/ci/courtesy-push/courtesy-push.js b/ci/courtesy-push/courtesy-push.js index 803b04fd563f..fc4b00b7ddaf 100644 --- a/ci/courtesy-push/courtesy-push.js +++ b/ci/courtesy-push/courtesy-push.js @@ -23,7 +23,6 @@ if (!token) { console.error('Error: PAT or TOKEN environment variable is required for git authentication'); process.exit(1); } - if (!newDeps) { console.error('Usage: node courtesy-push.js '); process.exit(1); @@ -83,8 +82,6 @@ function ensureRepoExists(repoPath) { function commitAndPushChanges(repoPath, targetToCommit) { console.log('Adding changes to git...'); - - // Debug: Check git status before adding console.log('\n=== Git Status Before Add ==='); try { const gitStatus = cp.execSync('git status --porcelain', { cwd: repoPath, encoding: 'utf8' }); @@ -97,8 +94,6 @@ function commitAndPushChanges(repoPath, targetToCommit) { } execInForeground(`${GIT} add ${targetToCommit}`, repoPath, false); - - // Debug: Check git status after adding console.log('\n=== Git Status After Add ==='); try { const gitStatusAfter = cp.execSync('git status --porcelain', { cwd: repoPath, encoding: 'utf8' }); @@ -139,8 +134,6 @@ async function createPullRequest(sourceBranch) { console.error('No token provided for PR creation'); return; } - - // const fullOrgUrl = `https://${orgUrl}`; const authHandler = azdev.getPersonalAccessTokenHandler(token); const refs = { @@ -266,7 +259,6 @@ async function getDeps(depArr) { const deps = {}; const getDependantConfigs = (arrKeys, packageName) => arrKeys.filter(key => key.includes(packageName) && key !== packageName); - // first run we form structures for (let i = 0; i < depArr.length; i++) { const newDep = depArr[i]; var [ name, version ] = await extractDependency(newDep); From 1fc1b4caecf6ef8bf302048681690a719680cc62 Mon Sep 17 00:00:00 2001 From: surajitshil Date: Wed, 6 Aug 2025 16:14:37 +0530 Subject: [PATCH 06/14] Move AzureDevOps repository checkout from pipeline to JavaScript logic to avoid CG issues --- ci/build-all-steps.yml | 16 ++++++++-------- ci/ci-release-notes/release-notes.js | 2 +- ci/courtesy-push/courtesy-push.js | 11 +++-------- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/ci/build-all-steps.yml b/ci/build-all-steps.yml index 8509af247168..de7eb1a7e064 100644 --- a/ci/build-all-steps.yml +++ b/ci/build-all-steps.yml @@ -92,15 +92,15 @@ steps: # Pull commits from remote and push branch to git git checkout -b $releaseBranch if( $isDryRun -eq 'true' ) { - Write-Host 'DRY RUN: Skipping Git push operations to remote repository' + Write-Host "DRY RUN: Skipping Git push operations to remote repository" }else{ - Write-Host 'Trying to pull the remote branch..' - git pull https://$(GitHubPAT)@github.com/microsoft/azure-pipelines-tasks $releaseBranch - if (-not $?) { - Write-Host 'Failed to pull the remote branch. This is expected if the remote branch doesn't exist.' - } - Write-Host 'Trying to push to the remote branch..' - git push https://$(GitHubPAT)@github.com/microsoft/azure-pipelines-tasks $releaseBranch + Write-Host "Trying to pull the remote branch.." + git pull https://$(GitHubPAT)@github.com/microsoft/azure-pipelines-tasks $releaseBranch + if (-not $?) { + Write-Host "Failed to pull the remote branch. This is expected if the remote branch doesn't exist." + } + Write-Host "Trying to push to the remote branch.." + git push https://$(GitHubPAT)@github.com/microsoft/azure-pipelines-tasks $releaseBranch } condition: | and( diff --git a/ci/ci-release-notes/release-notes.js b/ci/ci-release-notes/release-notes.js index 1b5d76401229..ac65a4e9dd4a 100644 --- a/ci/ci-release-notes/release-notes.js +++ b/ci/ci-release-notes/release-notes.js @@ -233,7 +233,7 @@ async function main() { if(isDryRun=== 'true'){ console.log('DRY RUN: Skipping actual release creation'); }else{ - await createRelease(releaseNotes, version, releaseBranch); + await createRelease(releaseNotes, version, releaseBranch); } } catch (err) { throw err; diff --git a/ci/courtesy-push/courtesy-push.js b/ci/courtesy-push/courtesy-push.js index fc4b00b7ddaf..033fc419e9e3 100644 --- a/ci/courtesy-push/courtesy-push.js +++ b/ci/courtesy-push/courtesy-push.js @@ -38,10 +38,10 @@ function execInForeground(command, directory) { directory = directory || '.'; console.log(`% ${command}`); try { - cp.execSync(command, { cwd: directory, stdio: [process.stdin, process.stdout, process.stderr] }); + cp.execSync(command, { cwd: directory, stdio: [process.stdin, process.stdout, process.stderr] }); } catch (error) { - console.error(`Command failed: ${command}`); - throw error; + console.error(`Command failed: ${command}`); + throw error; } } @@ -101,15 +101,11 @@ function commitAndPushChanges(repoPath, targetToCommit) { } catch (error) { console.log('Could not get git status after add:', error.message); } - gitConfig(); - console.log(`Creating branch ${sourceBranch}...`); execInForeground(`${GIT} checkout -b ${sourceBranch}`, repoPath); - console.log('Committing changes...'); execInForeground(`${GIT} commit -m "${commitMessage}"`, repoPath); - console.log('Pushing changes...'); if(dryrun){ console.log("SKIPPED THE PUSH COMMAND BECAUSE DRYRUN IS SET TO TRUE") @@ -117,7 +113,6 @@ function commitAndPushChanges(repoPath, targetToCommit) { else{ execInForeground(`${GIT} push origin ${sourceBranch}`, repoPath); } - } /** From 4908d4012be36846e2c7f4509124a7fda4f059c2 Mon Sep 17 00:00:00 2001 From: surajitshil Date: Thu, 7 Aug 2025 16:24:22 +0530 Subject: [PATCH 07/14] Reverting the paths based on checkout --- ci/build-single-ado-pr-steps.yml | 14 ++++++-------- ci/courtesy-push.yml | 20 +++++--------------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/ci/build-single-ado-pr-steps.yml b/ci/build-single-ado-pr-steps.yml index 99d3a2228799..6ccd1ea963fc 100644 --- a/ci/build-single-ado-pr-steps.yml +++ b/ci/build-single-ado-pr-steps.yml @@ -12,12 +12,11 @@ steps: versionSpec: 20.x - script: | - cd azure-pipelines-tasks npm install displayName: npm install - script: | - cd azure-pipelines-tasks/ci/courtesy-push + cd ci/courtesy-push npm install displayName: npm install for courtesy push @@ -27,7 +26,7 @@ steps: downloadPath: $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded displayName: Download Artifact -- powershell: ./azure-pipelines-tasks/ci/set-sprint-variables.ps1 +- powershell: ./ci/set-sprint-variables.ps1 displayName: Set currentSprint variables - powershell: | @@ -38,11 +37,10 @@ steps: # returns branchName - template: /ci/generate-branch-name.yml@self -- script: node azure-pipelines-tasks\ci\courtesy-push\courtesy-push.js $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded\IndividualNugetPackages\unified_deps.xml +- script: node ci\courtesy-push\courtesy-push.js $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded\IndividualNugetPackages\unified_deps.xml displayName: Update unified deps and create branch env: - USERNAME: $(Build.RequestedFor) - PAT: $(System.AccessToken) - USEREMAIL: $(Build.RequestedForEmail) + TOKEN: $(System.AccessToken) BRANCH_NAME: $(branchName) - + DRYRUN: $(isDryRun) + USERNAME: $(username) \ No newline at end of file diff --git a/ci/courtesy-push.yml b/ci/courtesy-push.yml index 3451566c0834..a11f8f777ca2 100644 --- a/ci/courtesy-push.yml +++ b/ci/courtesy-push.yml @@ -5,13 +5,7 @@ steps: displayName: Install nuget - powershell: | - $sourcePath = "$(Build.SourcesDirectory)/azure-pipelines-tasks/.gdn" - $destinationPath = "$(Build.SourcesDirectory)/" - Copy-Item -Path $sourcePath -Destination $destinationPath -Recurse - displayName: Copy baseline files to root - -- powershell: | - cd azure-pipelines-tasks/ci/courtesy-push + cd ci/courtesy-push npm install displayName: npm install @@ -21,7 +15,7 @@ steps: downloadPath: $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded displayName: Download Artifact -- powershell: ./azure-pipelines-tasks/ci/set-sprint-variables.ps1 +- powershell: ./ci/set-sprint-variables.ps1 displayName: Set currentSprint variables - powershell: | @@ -30,21 +24,17 @@ steps: displayName: Set currentDate variable - template: /ci/generate-branch-name.yml@self - parameters: - prefix: users/$(Build.RequestedFor) -- script: node azure-pipelines-tasks\ci\courtesy-push\courtesy-push.js $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded\IndividualNugetPackages\unified_deps.xml +- script: node ci\courtesy-push\courtesy-push.js $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded\IndividualNugetPackages\unified_deps.xml displayName: Update unified deps and create branch env: - USERNAME: $(Build.RequestedFor) TOKEN: $(System.AccessToken) - USEREMAIL: $(Build.RequestedForEmail) BRANCH_NAME: $(branchName) DRYRUN: $(isDryRun) + USERNAME: $(username) -- powershell: .\azure-pipelines-tasks\ci\courtesy-push\send-notification.ps1 +- powershell: .\ci\courtesy-push\send-notification.ps1 displayName: Send MS Teams notification condition: eq(variables['build.reason'], 'Schedule') env: TEAMS_WEBHOOK: $(MSTeamsUri) - \ No newline at end of file From f1985e277f35d8b9b1b7c6fdc36ab6aa08819550 Mon Sep 17 00:00:00 2001 From: surajitshil Date: Thu, 7 Aug 2025 16:56:14 +0530 Subject: [PATCH 08/14] Minor fixes in path resolution --- ci/courtesy-push.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/courtesy-push.yml b/ci/courtesy-push.yml index a11f8f777ca2..82af472658fc 100644 --- a/ci/courtesy-push.yml +++ b/ci/courtesy-push.yml @@ -5,7 +5,7 @@ steps: displayName: Install nuget - powershell: | - cd ci/courtesy-push + cd $(Build.SourcesDirectory)/ci/courtesy-push npm install displayName: npm install @@ -15,7 +15,7 @@ steps: downloadPath: $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded displayName: Download Artifact -- powershell: ./ci/set-sprint-variables.ps1 +- powershell: $(Build.SourcesDirectory)/ci/set-sprint-variables.ps1 displayName: Set currentSprint variables - powershell: | @@ -25,7 +25,7 @@ steps: - template: /ci/generate-branch-name.yml@self -- script: node ci\courtesy-push\courtesy-push.js $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded\IndividualNugetPackages\unified_deps.xml +- script: node $(Build.SourcesDirectory)/ci/courtesy-push/courtesy-push.js $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded/IndividualNugetPackages/unified_deps.xml displayName: Update unified deps and create branch env: TOKEN: $(System.AccessToken) @@ -33,7 +33,7 @@ steps: DRYRUN: $(isDryRun) USERNAME: $(username) -- powershell: .\ci\courtesy-push\send-notification.ps1 +- powershell: $(Build.SourcesDirectory)/ci/courtesy-push/send-notification.ps1 displayName: Send MS Teams notification condition: eq(variables['build.reason'], 'Schedule') env: From 3f4315442bcd9a61d7aa133807ab48a5c5c1a39f Mon Sep 17 00:00:00 2001 From: surajitshil Date: Fri, 8 Aug 2025 13:11:54 +0530 Subject: [PATCH 09/14] Adding access token for cloning Azure DevOps repo in courtesy-push.js --- ci/courtesy-push.yml | 3 ++- ci/courtesy-push/courtesy-push.js | 8 ++++---- ci/get-AzDo-pat.yml | 11 +++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 ci/get-AzDo-pat.yml diff --git a/ci/courtesy-push.yml b/ci/courtesy-push.yml index 82af472658fc..f04f67e420ee 100644 --- a/ci/courtesy-push.yml +++ b/ci/courtesy-push.yml @@ -24,11 +24,12 @@ steps: displayName: Set currentDate variable - template: /ci/generate-branch-name.yml@self +- template: /ci/get-AzDo-pat.yml@self - script: node $(Build.SourcesDirectory)/ci/courtesy-push/courtesy-push.js $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded/IndividualNugetPackages/unified_deps.xml displayName: Update unified deps and create branch env: - TOKEN: $(System.AccessToken) + TOKEN: $(AzDo_PAT) BRANCH_NAME: $(branchName) DRYRUN: $(isDryRun) USERNAME: $(username) diff --git a/ci/courtesy-push/courtesy-push.js b/ci/courtesy-push/courtesy-push.js index 033fc419e9e3..de71741930c3 100644 --- a/ci/courtesy-push/courtesy-push.js +++ b/ci/courtesy-push/courtesy-push.js @@ -9,7 +9,7 @@ const msPrefix = 'Mseng.MS.TF.DistributedTask.Tasks.'; // Git configuration const GIT = 'git'; -const token = process.env.PAT || process.env.TOKEN; +const token = process.env.TOKEN; const orgUrl= 'dev.azure.com/mseng' const project = 'AzureDevOps'; const repo = 'AzureDevOps'; @@ -133,7 +133,7 @@ async function createPullRequest(sourceBranch) { const refs = { sourceRefName: `refs/heads/${sourceBranch}`, - targetRefName: 'refs/heads/main' // Change to 'refs/heads/master' if your repo uses master + targetRefName: 'refs/heads/master' }; const pullRequestToCreate = { @@ -183,7 +183,7 @@ Generated: ${new Date().toISOString()}` }else{ console.log("================Printing the PR details:================") console.log(` Source Branch: ${sourceBranch}`); - console.log(` Target Branch: main`); + console.log(` Target Branch: master`); console.log(` Title: Courtesy Bump of Tasks`); console.log(` Organization: ${orgUrl}`); console.log(` Project: ${project}`); @@ -407,7 +407,7 @@ async function updateUnifiedDeps(unifiedDepsPath, newUnifiedDepsPath) { * @param {Object} depsToUpdate - structure to track added/removed dependencies (formed in updateUnifiedDeps) */ async function updateTfsServerDeps() { - const repoName='AzureDevops' + const repoName='AzureDevOps' const agentTempDir=process.env.AGENT_TEMPDIRECTORY; const repoPath=path.join(agentTempDir, repoName); diff --git a/ci/get-AzDo-pat.yml b/ci/get-AzDo-pat.yml new file mode 100644 index 000000000000..f08b24562f32 --- /dev/null +++ b/ci/get-AzDo-pat.yml @@ -0,0 +1,11 @@ +steps: +- task: AzureCLI@2 + inputs: + azureSubscription: ARM - WIF - manual + scriptType: pscore + scriptLocation: inlineScript + inlineScript: | + az account set --subscription $(SUBSCRIPTION_ID) + $accessToken = az account get-access-token --resource $(RESOURCE_ID) --query accessToken --output tsv + echo "##vso[task.setvariable variable=AzDo_PAT;issecret=true]$accessToken" + displayName: Get Azure DevOps Access Token From 9fef21ea7945df816ff2b9951760a0275be0a07d Mon Sep 17 00:00:00 2001 From: surajitshil Date: Fri, 8 Aug 2025 13:24:30 +0530 Subject: [PATCH 10/14] Changing token value in build-single-ado-pr-steps.yml --- ci/build-single-ado-pr-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build-single-ado-pr-steps.yml b/ci/build-single-ado-pr-steps.yml index 6ccd1ea963fc..13fdf82e752c 100644 --- a/ci/build-single-ado-pr-steps.yml +++ b/ci/build-single-ado-pr-steps.yml @@ -40,7 +40,7 @@ steps: - script: node ci\courtesy-push\courtesy-push.js $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded\IndividualNugetPackages\unified_deps.xml displayName: Update unified deps and create branch env: - TOKEN: $(System.AccessToken) + TOKEN: $(AzDo_PAT) BRANCH_NAME: $(branchName) DRYRUN: $(isDryRun) USERNAME: $(username) \ No newline at end of file From 956dd9cc92f24f0e6b83635a2fb7c545144e501c Mon Sep 17 00:00:00 2001 From: surajitshil Date: Fri, 8 Aug 2025 15:28:05 +0530 Subject: [PATCH 11/14] Creating a separate pipeline yml for release --- .azure-pipelines/.vsts.release.yml | 220 +++++++++++++++++++++++++++++ azure-pipelines.yml | 149 +------------------ 2 files changed, 227 insertions(+), 142 deletions(-) create mode 100644 .azure-pipelines/.vsts.release.yml diff --git a/.azure-pipelines/.vsts.release.yml b/.azure-pipelines/.vsts.release.yml new file mode 100644 index 000000000000..f6aebb06fdc2 --- /dev/null +++ b/.azure-pipelines/.vsts.release.yml @@ -0,0 +1,220 @@ +# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool. +# This pipeline will be extended to the OneESPT template + +trigger: none + +resources: + repositories: + - repository: 1ESPipelineTemplates + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + +parameters: +- name: task_deployment + displayName: Choose deployment options + type: string + default: 'Deploy task of Sprint' + values: + - 'Deploy all Tasks' + - 'Deploy task of Sprint' + - 'Deploy Hotfix' +- name: task_name + displayName: | + To 'Deploy Hotfix' provide task names (e.g. BashV3,AzureCLIV1,PowerShellV2) else leave to default + type: string + default: 'TaskNameVN' +- name: enableCodeQL + displayName: Enable CodeQL for run + type: boolean + default: false +- name: includeLocalPackagesBuildConfig + displayName: Flag to update LocalPackages buildconfig (for testing, this will be made default later) + type: boolean + default: false # note: keep in sync with ci\ci-test-tasks\canary-tests-v2.yml +- name: skip_publish + displayName: skipPublish (Not for production use) + type: boolean + default: false +- name: publishToDistributedTaskTest + displayName: Publish to test feed (DistributedTasks-test), for infrastucture testing + type: boolean + default: false +- name: dryRun + displayName: Dry Run (no push, no PR, no feed publish) + type: boolean + default: false + +variables: +- name: currentDate + value: $[ format('{0:yyyy}{0:MM}{0:dd}', pipeline.startTime) ] +- name: taskName + value: ${{ parameters.task_name }} +- name: taskNameIsSet + value: ${{ not(or(eq(parameters.task_deployment, 'Deploy all Tasks'), eq(parameters.task_deployment, 'Deploy task of Sprint'))) }} +- name: runCodeQl + value: ${{ eq(parameters.enableCodeQL, true) }} +- name: system.debug + value: true +- name: includeLocalPackagesBuildConfigParameter + ${{ if eq(parameters.includeLocalPackagesBuildConfig, true) }}: + value: '--includeLocalPackagesBuildConfig' + ${{ else }}: + value: '' +- name: IncludeLocalPackagesBuildConfigTest + ${{ if eq(parameters.includeLocalPackagesBuildConfig, true) }}: + value: '1' + ${{ else }}: + value: '' +- name: tasksSkipPublish + ${{ if eq(parameters.skip_publish, true) }}: + value: 'true' + ${{ else }}: + value: 'false' +- name: DEPLOY_ALL_TASKSVAR + ${{ if eq(parameters.task_deployment,'Deploy all Tasks') }}: + value: 'true' + ${{ else }}: + value: 'false' +- name: isDryRun + ${{ if eq(parameters.dryRun, true) }}: + value: 'true' + ${{ else }}: + value: 'false' + +extends: + template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates + parameters: + settings: + skipBuildTagsForGitHubPullRequests: true + featureFlags: + autoBaseline: false + sdl: + sbom: + enabled: true + baseline: + baselineSet: default + baselineFile: $(Build.SourcesDirectory)/.gdn/.gdnbaselines + sourceAnalysisPool: + name: 1ES-ABTT-Shared-Pool + image: abtt-windows-2022 + os: windows + sourceRepositoriesToScan: + exclude: + - repository: AzureDevOps + - repository: ConfigChange + customBuildTags: + - ES365AIMigrationTooling + stages: + - stage: main + jobs: + # All tasks on Windows + - job: build_all_windows + displayName: Build all tasks (Windows) + condition: eq(variables.os, 'Windows_NT') + timeoutInMinutes: 1440 # AntiMalware takes 3 hours to scan tasks.zip + pool: + name: 1ES-ABTT-Shared-Pool + image: abtt-windows-2022 + os: windows + templateContext: + outputs: + - output: buildArtifacts + displayName: 'Publish package artifact' + condition: > + and( + succeeded(), + ne(variables['build.reason'], 'PullRequest'), + ne(variables['numTasks'], 0) + ) + PathtoPublish: _package/tasks.zip + ArtifactName: package + sbomBuildDropPath: $(Build.SourcesDirectory)/_package + steps: + - template: /ci/build-all-steps.yml@self + parameters: + os: Windows_NT + + # Publish + - job: publish + displayName: Publish Nuget Artifacts + timeoutInMinutes: 360 + dependsOn: + - build_all_windows + condition: and(succeeded(), ne(variables['build.reason'], 'PullRequest'), eq(variables['tasksSkipPublish'], 'false')) + pool: + name: 1ES-ABTT-Shared-Pool + image: abtt-windows-2022 + os: windows + templateContext: + outputs: + - output: buildArtifacts + displayName: 'Publish per task NuGet package artifact' + PathtoPublish: _package/nuget-packages + ArtifactName: IndividualNuGetPackages + steps: + - template: /ci/publish-steps.yml@self + + # Courtesy Push + - job: courtesy_push + displayName: Courtesy Push + timeoutInMinutes: 180 + pool: + name: 1ES-ABTT-Shared-Pool + image: abtt-windows-2022 + os: windows + dependsOn: + - publish + condition: | + and( + succeeded(), + eq(variables['COURTESY_PUSH'], 'true'), + or( + eq(variables['build.reason'], 'Schedule'), + and( + eq(variables['build.reason'], 'Manual'), + eq(variables['FORCE_COURTESY_PUSH'], 'true') + ) + ) + ) + templateContext: + outputs: + - output: nuget + packagesToPush: '$(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded/IndividualNugetPackages/*/*.nupkg' + packageParentPath: '$(Build.SourcesDirectory)' + ${{ if or(eq(parameters.dryRun, true),eq(parameters.publishToDistributedTaskTest, true)) }}: + publishVstsFeed: 'c86767d8-af79-4303-a7e6-21da0ba435e2/9d34d871-8032-4e10-a34a-c7a01e125865' + ${{ else }}: + publishVstsFeed: 'c86767d8-af79-4303-a7e6-21da0ba435e2/e10d0795-57cd-4d7f-904e-5f39703cb096' + nuGetFeedType: internal + displayName: Push Nuget package + allowPackageConflicts: $(COURTESY_PUSH) + steps: + - checkout: self + - template: /ci/courtesy-push.yml@self + + - job: build_all_tasks_for_deployments + displayName: Build all tasks for deployments (Windows) + dependsOn: + - courtesy_push + - build_all_windows + condition: succeeded() + timeoutInMinutes: 360 + pool: + name: 1ES-ABTT-Shared-Pool + image: abtt-windows-2022 + os: windows + variables: + task_pattern: $[dependencies.build_all_windows.outputs['getTaskPattern.task_pattern']] + templateContext: + outputs: + - output: buildArtifacts + displayName: 'Publish package artifact' + PathtoPublish: _package/tasks.zip + sbomBuildDropPath: $(Build.SourcesDirectory)/_package + ArtifactName: allTasks + steps: + - template: /ci/build-all-tasks.yml@self + parameters: + deploy_all_tasks: ${{ eq(parameters.task_deployment, 'Deploy all Tasks') }} + \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 89b8e61e92dc..28d794d97951 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -12,77 +12,25 @@ resources: name: 1ESPipelineTemplates/1ESPipelineTemplates ref: refs/tags/release -parameters: -- name: task_deployment - displayName: Choose deployment options - type: string - default: 'Deploy task of Sprint' - values: - - 'Deploy all Tasks' - - 'Deploy task of Sprint' - - 'Deploy Hotfix' -- name: task_name - displayName: | - To 'Deploy Hotfix' provide task names (e.g. BashV3,AzureCLIV1,PowerShellV2) else leave to default - type: string - default: 'TaskNameVN' -- name: enableCodeQL - displayName: Enable CodeQL for run - type: boolean - default: false -- name: includeLocalPackagesBuildConfig - displayName: Flag to update LocalPackages buildconfig (for testing, this will be made default later) - type: boolean - default: false # note: keep in sync with ci\ci-test-tasks\canary-tests-v2.yml -- name: skip_publish - displayName: skipPublish (Not for production use) - type: boolean - default: false -- name: publishToDistributedTaskTest - displayName: Publish to test feed (DistributedTasks-test), for infrastucture testing - type: boolean - default: false -- name: dryRun - displayName: Dry Run (no push, no PR, no feed publish) - type: boolean - default: false - variables: - name: currentDate value: $[ format('{0:yyyy}{0:MM}{0:dd}', pipeline.startTime) ] - name: taskName - value: ${{ parameters.task_name }} + value: 'TaskNameVN' - name: taskNameIsSet - value: ${{ not(or(eq(parameters.task_deployment, 'Deploy all Tasks'), eq(parameters.task_deployment, 'Deploy task of Sprint'))) }} + value: false - name: runCodeQl - value: ${{ eq(parameters.enableCodeQL, true) }} + value: false - name: system.debug value: true - name: includeLocalPackagesBuildConfigParameter - ${{ if eq(parameters.includeLocalPackagesBuildConfig, true) }}: - value: '--includeLocalPackagesBuildConfig' - ${{ else }}: - value: '' + value: '' - name: IncludeLocalPackagesBuildConfigTest - ${{ if eq(parameters.includeLocalPackagesBuildConfig, true) }}: - value: '1' - ${{ else }}: - value: '' -- name: tasksSkipPublish - ${{ if eq(parameters.skip_publish, true) }}: - value: 'true' - ${{ else }}: - value: 'false' + value: '' - name: DEPLOY_ALL_TASKSVAR - ${{ if eq(parameters.task_deployment,'Deploy all Tasks') }}: - value: 'true' - ${{ else }}: - value: 'false' + value: 'false' - name: isDryRun - ${{ if eq(parameters.dryRun, true) }}: - value: 'true' - ${{ else }}: - value: 'false' + value: 'false' extends: template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates @@ -137,89 +85,6 @@ extends: parameters: os: Windows_NT - # Publish - - job: publish - displayName: Publish Nuget Artifacts - timeoutInMinutes: 360 - dependsOn: - - build_all_windows - condition: and(succeeded(), ne(variables['build.reason'], 'PullRequest'), eq(variables['tasksSkipPublish'], 'false')) - pool: - name: 1ES-ABTT-Shared-Pool - image: abtt-windows-2022 - os: windows - templateContext: - outputs: - - output: buildArtifacts - displayName: 'Publish per task NuGet package artifact' - PathtoPublish: _package/nuget-packages - ArtifactName: IndividualNuGetPackages - steps: - - template: /ci/publish-steps.yml@self - - # Courtesy Push - - job: courtesy_push - displayName: Courtesy Push - timeoutInMinutes: 180 - pool: - name: 1ES-ABTT-Shared-Pool - image: abtt-windows-2022 - os: windows - dependsOn: - - publish - condition: | - and( - succeeded(), - eq(variables['COURTESY_PUSH'], 'true'), - or( - eq(variables['build.reason'], 'Schedule'), - and( - eq(variables['build.reason'], 'Manual'), - eq(variables['FORCE_COURTESY_PUSH'], 'true') - ) - ) - ) - templateContext: - outputs: - - output: nuget - packagesToPush: '$(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded/IndividualNugetPackages/*/*.nupkg' - packageParentPath: '$(Build.SourcesDirectory)' - ${{ if or(eq(parameters.dryRun, true),eq(parameters.publishToDistributedTaskTest, true)) }}: - publishVstsFeed: 'c86767d8-af79-4303-a7e6-21da0ba435e2/9d34d871-8032-4e10-a34a-c7a01e125865' - ${{ else }}: - publishVstsFeed: 'c86767d8-af79-4303-a7e6-21da0ba435e2/e10d0795-57cd-4d7f-904e-5f39703cb096' - nuGetFeedType: internal - displayName: Push Nuget package - allowPackageConflicts: $(COURTESY_PUSH) - steps: - - checkout: self - - template: /ci/courtesy-push.yml@self - - - job: build_all_tasks_for_deployments - displayName: Build all tasks for deployments (Windows) - dependsOn: - - courtesy_push - - build_all_windows - condition: succeeded() - timeoutInMinutes: 360 - pool: - name: 1ES-ABTT-Shared-Pool - image: abtt-windows-2022 - os: windows - variables: - task_pattern: $[dependencies.build_all_windows.outputs['getTaskPattern.task_pattern']] - templateContext: - outputs: - - output: buildArtifacts - displayName: 'Publish package artifact' - PathtoPublish: _package/tasks.zip - sbomBuildDropPath: $(Build.SourcesDirectory)/_package - ArtifactName: allTasks - steps: - - template: /ci/build-all-tasks.yml@self - parameters: - deploy_all_tasks: ${{ eq(parameters.task_deployment, 'Deploy all Tasks') }} - # All tasks on Linux - job: build_all_linux displayName: Build all tasks (Linux) From 6e9fcbb11dcaf735729196910845910487837a26 Mon Sep 17 00:00:00 2001 From: surajitshil Date: Fri, 8 Aug 2025 16:08:57 +0530 Subject: [PATCH 12/14] Minor change in .md file --- Tasks/GradleV2/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tasks/GradleV2/README.md b/Tasks/GradleV2/README.md index 5719bbe0246e..5893c596df3d 100644 --- a/Tasks/GradleV2/README.md +++ b/Tasks/GradleV2/README.md @@ -71,7 +71,7 @@ The repository should look something like this: |-- .gitignore |-- build.gradle |-- gradlew -|-- gradlew.bat +|-- gradlew.bat ``` From c10fb28adb28c1a7da44d28a365709c50d416326 Mon Sep 17 00:00:00 2001 From: surajitshil Date: Fri, 8 Aug 2025 16:21:19 +0530 Subject: [PATCH 13/14] Updating GradleV2 version for testing /azp run --- Tasks/GradleV2/task.json | 2 +- Tasks/GradleV2/task.loc.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tasks/GradleV2/task.json b/Tasks/GradleV2/task.json index 068bf01b068a..1addb12dc5b7 100644 --- a/Tasks/GradleV2/task.json +++ b/Tasks/GradleV2/task.json @@ -16,7 +16,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 247, + "Minor": 261, "Patch": 1 }, "releaseNotes": "Configuration of the SonarQube analysis was moved to the [SonarQube](https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarqube) or [SonarCloud](https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarcloud) extensions, in task `Prepare Analysis Configuration`", diff --git a/Tasks/GradleV2/task.loc.json b/Tasks/GradleV2/task.loc.json index e6924b799091..db1021f3c05e 100644 --- a/Tasks/GradleV2/task.loc.json +++ b/Tasks/GradleV2/task.loc.json @@ -16,7 +16,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 247, + "Minor": 261, "Patch": 1 }, "releaseNotes": "ms-resource:loc.releaseNotes", From 1063c2ef55964fec9f3c31a8b98a1b9737cf72a8 Mon Sep 17 00:00:00 2001 From: surajitshil Date: Fri, 8 Aug 2025 17:02:11 +0530 Subject: [PATCH 14/14] Reveting the version of GradleV2 task --- Tasks/GradleV2/README.md | 2 +- Tasks/GradleV2/task.json | 2 +- Tasks/GradleV2/task.loc.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tasks/GradleV2/README.md b/Tasks/GradleV2/README.md index 5893c596df3d..5719bbe0246e 100644 --- a/Tasks/GradleV2/README.md +++ b/Tasks/GradleV2/README.md @@ -71,7 +71,7 @@ The repository should look something like this: |-- .gitignore |-- build.gradle |-- gradlew -|-- gradlew.bat +|-- gradlew.bat ``` diff --git a/Tasks/GradleV2/task.json b/Tasks/GradleV2/task.json index 1addb12dc5b7..068bf01b068a 100644 --- a/Tasks/GradleV2/task.json +++ b/Tasks/GradleV2/task.json @@ -16,7 +16,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 261, + "Minor": 247, "Patch": 1 }, "releaseNotes": "Configuration of the SonarQube analysis was moved to the [SonarQube](https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarqube) or [SonarCloud](https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarcloud) extensions, in task `Prepare Analysis Configuration`", diff --git a/Tasks/GradleV2/task.loc.json b/Tasks/GradleV2/task.loc.json index db1021f3c05e..e6924b799091 100644 --- a/Tasks/GradleV2/task.loc.json +++ b/Tasks/GradleV2/task.loc.json @@ -16,7 +16,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 261, + "Minor": 247, "Patch": 1 }, "releaseNotes": "ms-resource:loc.releaseNotes",