From c5202fb44468bbda9fcfd609622f1169a762b773 Mon Sep 17 00:00:00 2001 From: MerlynOMsft <44985659+merlynomsft@users.noreply.github.com> Date: Fri, 25 Oct 2024 17:25:26 -0700 Subject: [PATCH] fix for build all tasks --- azure-pipelines.yml | 5 +++++ ci/filter-tasks.js | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index db653efe355e..16285b1edf08 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -64,6 +64,11 @@ variables: value: 'true' ${{ else }}: value: 'false' +- name: DEPLOY_ALL_TASKSVAR + ${{ if eq(parameters.deploy_all_tasks, true) }}: + value: 'true' + ${{ else }}: + value: 'false' extends: template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates diff --git a/ci/filter-tasks.js b/ci/filter-tasks.js index 9f94547b4de0..e860d5ac08d5 100644 --- a/ci/filter-tasks.js +++ b/ci/filter-tasks.js @@ -222,6 +222,7 @@ var setTaskVariables = function(tasks, tasksForDowngradingCheck) { var buildReason = process.env['BUILD_REASON'].toLowerCase(); var forceCourtesyPush = process.env['FORCE_COURTESY_PUSH'] && process.env['FORCE_COURTESY_PUSH'].toLowerCase() === 'true'; var taskNameIsSet = process.env['TASKNAMEISSET'] && process.env['TASKNAMEISSET'].toLowerCase() === 'true'; +var deployAllTasks = process.env['DEPLOY_ALL_TASKSVAR'] && process.env['DEPLOY_ALL_TASKSVAR'].toLowerCase() === 'true'; if (taskNameIsSet) { var taskName = process.env['TASKNAME']; @@ -240,7 +241,7 @@ const ciBuildReasonList = [AzpBuildReason.Individualci, AzpBuildReason.Batchedci async function filterTasks () { try { - if (ciBuildReasonList.includes(buildReason) || (forceCourtesyPush && !taskNameIsSet)) { + if (ciBuildReasonList.includes(buildReason) || (forceCourtesyPush && !taskNameIsSet && !deployAllTasks)) { // If CI, we will compare any tasks that have updated versions. const tasks = await getTasksToBuildForCI(); setTaskVariables(tasks, tasks); @@ -250,7 +251,10 @@ async function filterTasks () { const regex = /^refs\/pull\/(\d+)\/merge$/; const prIdMatch = buildSourceBranch.match(regex); - if (buildReason == AzpBuildReason.Pullrequest) { + if (deployAllTasks) + { + setTaskVariables(makeOptions.tasks, makeOptions.tasks); + } else if (buildReason == AzpBuildReason.Pullrequest) { // If PR, we will compare any tasks that could have been affected based on the diff. const tasks = await getTasksToBuildForPR(null, false); const tasksForDowngradingCheck = await getTasksToBuildForPR(null, true);