From 6268f2c204563c18a2defa38b215895ae514ded0 Mon Sep 17 00:00:00 2001 From: praveenkuttappan Date: Mon, 7 Jun 2021 23:38:55 -0400 Subject: [PATCH 01/14] Initial script change --- eng/scripts/Rush-Update.ps1 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 eng/scripts/Rush-Update.ps1 diff --git a/eng/scripts/Rush-Update.ps1 b/eng/scripts/Rush-Update.ps1 new file mode 100644 index 000000000000..2242ed65e18c --- /dev/null +++ b/eng/scripts/Rush-Update.ps1 @@ -0,0 +1,20 @@ +rush update --recheck +$changed = git diff +if ($changed) +{ + Write-Host "Changes detected after running rush update --recheck" + + # Verify that only pnpm-lock.yaml is changed + $files = (git status -s) + $files = $files.Where({$_ -notmatch "pnpm-lock.yaml"}) + if ($files.Count -gt 0) + { + Write-Error "Repo has more changes than pnpm-lock.yaml file. This should not happen when running rush update --recheck." + Write-Host "Run rush udpate --recheck manually after cloning azure-sdk-for-js repo and create pull request." + exit 1 + } + + // submit pull request +} + +Write-Host "No change is detected in pnpm-lock.yaml" From 61eaf44140ced88cc1a1dcf59c2c8ef885343e1e Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Tue, 8 Jun 2021 00:26:15 -0400 Subject: [PATCH 02/14] New pipeline to automaterush update recheck --- eng/pipelines/rush-update.yml | 36 +++++++++++++++++++++++++++++++++++ eng/scripts/Rush-Update.ps1 | 20 ------------------- 2 files changed, 36 insertions(+), 20 deletions(-) create mode 100644 eng/pipelines/rush-update.yml delete mode 100644 eng/scripts/Rush-Update.ps1 diff --git a/eng/pipelines/rush-update.yml b/eng/pipelines/rush-update.yml new file mode 100644 index 000000000000..291ba92626b0 --- /dev/null +++ b/eng/pipelines/rush-update.yml @@ -0,0 +1,36 @@ +trigger: none + +pr: + branches: + include: + - master + - main + paths: + include: + - eng/pipelines/rush-update.yml + +jobs: + - job: 'ValidateDependencies' + variables: + - template: ../variables/globals.yml + + pool: + name: azsdk-pool-mms-ubuntu-1804-general + vmImage: MMSUbuntu18.04 + + steps: + - template: /eng/pipelines/templates/steps/common.yml + + - script: | + node common/scripts/install-run-rush.js install + rush update --recheck + condition: and(succeeded()) + displayName: "Run Rush Update" + + - template: /eng/common/pipelines/templates/steps/create-pull-request.yml + parameters: + RepoName: azure-sdk-for-js + PRBranchName: automated-rush-update-$(Build.BuildId) + CommitMsg: "rush update recheck" + PRTitle: "Automatic rush update" + CloseAfterOpenForTesting: '${{ parameters.TestPipeline }}' diff --git a/eng/scripts/Rush-Update.ps1 b/eng/scripts/Rush-Update.ps1 deleted file mode 100644 index 2242ed65e18c..000000000000 --- a/eng/scripts/Rush-Update.ps1 +++ /dev/null @@ -1,20 +0,0 @@ -rush update --recheck -$changed = git diff -if ($changed) -{ - Write-Host "Changes detected after running rush update --recheck" - - # Verify that only pnpm-lock.yaml is changed - $files = (git status -s) - $files = $files.Where({$_ -notmatch "pnpm-lock.yaml"}) - if ($files.Count -gt 0) - { - Write-Error "Repo has more changes than pnpm-lock.yaml file. This should not happen when running rush update --recheck." - Write-Host "Run rush udpate --recheck manually after cloning azure-sdk-for-js repo and create pull request." - exit 1 - } - - // submit pull request -} - -Write-Host "No change is detected in pnpm-lock.yaml" From a187e8cf9758e109a728567e535f18d31df74e53 Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Tue, 8 Jun 2021 14:37:08 -0400 Subject: [PATCH 03/14] Added step to create PR --- eng/pipelines/rush-update.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/eng/pipelines/rush-update.yml b/eng/pipelines/rush-update.yml index 291ba92626b0..d708ebb32628 100644 --- a/eng/pipelines/rush-update.yml +++ b/eng/pipelines/rush-update.yml @@ -1,13 +1,7 @@ trigger: none +pr: none -pr: - branches: - include: - - master - - main - paths: - include: - - eng/pipelines/rush-update.yml +# This pipeline is used to create PR automatically for rush update by running rush update --recheck jobs: - job: 'ValidateDependencies' @@ -31,6 +25,5 @@ jobs: parameters: RepoName: azure-sdk-for-js PRBranchName: automated-rush-update-$(Build.BuildId) - CommitMsg: "rush update recheck" + CommitMsg: "Automatic rush update recheck" PRTitle: "Automatic rush update" - CloseAfterOpenForTesting: '${{ parameters.TestPipeline }}' From 6f10c6ff06be185717b8185b0d5d623d76274a52 Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Tue, 8 Jun 2021 15:10:30 -0400 Subject: [PATCH 04/14] Fix path to variables template --- eng/pipelines/rush-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/rush-update.yml b/eng/pipelines/rush-update.yml index d708ebb32628..006d56fa5edd 100644 --- a/eng/pipelines/rush-update.yml +++ b/eng/pipelines/rush-update.yml @@ -6,7 +6,7 @@ pr: none jobs: - job: 'ValidateDependencies' variables: - - template: ../variables/globals.yml + - template: /eng/pipelines/templates/variables/globals.yml pool: name: azsdk-pool-mms-ubuntu-1804-general From a3a1cd516f1929e29c51065f19de7db24cb9719e Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Tue, 8 Jun 2021 15:12:35 -0400 Subject: [PATCH 05/14] Fix path to variables template --- eng/pipelines/rush-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/rush-update.yml b/eng/pipelines/rush-update.yml index 006d56fa5edd..9dc783ae2525 100644 --- a/eng/pipelines/rush-update.yml +++ b/eng/pipelines/rush-update.yml @@ -18,10 +18,10 @@ jobs: - script: | node common/scripts/install-run-rush.js install rush update --recheck - condition: and(succeeded()) displayName: "Run Rush Update" - template: /eng/common/pipelines/templates/steps/create-pull-request.yml + condition: succeeded() parameters: RepoName: azure-sdk-for-js PRBranchName: automated-rush-update-$(Build.BuildId) From 5fbe5611a440d9afa107836e7251300dd7cc208e Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Tue, 8 Jun 2021 15:13:03 -0400 Subject: [PATCH 06/14] Fix path to variables template --- eng/pipelines/rush-update.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/pipelines/rush-update.yml b/eng/pipelines/rush-update.yml index 9dc783ae2525..fc243e119bc4 100644 --- a/eng/pipelines/rush-update.yml +++ b/eng/pipelines/rush-update.yml @@ -21,7 +21,6 @@ jobs: displayName: "Run Rush Update" - template: /eng/common/pipelines/templates/steps/create-pull-request.yml - condition: succeeded() parameters: RepoName: azure-sdk-for-js PRBranchName: automated-rush-update-$(Build.BuildId) From f54c6fc0a093bdf3b8a24a47210ee8745610371a Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Tue, 8 Jun 2021 16:54:18 -0400 Subject: [PATCH 07/14] run rush using rush runner --- eng/pipelines/rush-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/rush-update.yml b/eng/pipelines/rush-update.yml index fc243e119bc4..beca2bb3597e 100644 --- a/eng/pipelines/rush-update.yml +++ b/eng/pipelines/rush-update.yml @@ -17,7 +17,7 @@ jobs: - script: | node common/scripts/install-run-rush.js install - rush update --recheck + node common/scripts/install-run-rush.js update --recheck displayName: "Run Rush Update" - template: /eng/common/pipelines/templates/steps/create-pull-request.yml From 9a4899e16f63222619d148cd5d4545f60a36883b Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Tue, 8 Jun 2021 17:19:55 -0400 Subject: [PATCH 08/14] run rush using rush runner --- eng/pipelines/rush-update.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/pipelines/rush-update.yml b/eng/pipelines/rush-update.yml index beca2bb3597e..4fb0c22d17da 100644 --- a/eng/pipelines/rush-update.yml +++ b/eng/pipelines/rush-update.yml @@ -26,3 +26,4 @@ jobs: PRBranchName: automated-rush-update-$(Build.BuildId) CommitMsg: "Automatic rush update recheck" PRTitle: "Automatic rush update" + BaseBranchName: master From b1986ad05b9b8abae427bedcfed3af900ac1404c Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Tue, 8 Jun 2021 17:27:20 -0400 Subject: [PATCH 09/14] Remove debug changes --- eng/pipelines/rush-update.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/pipelines/rush-update.yml b/eng/pipelines/rush-update.yml index 4fb0c22d17da..beca2bb3597e 100644 --- a/eng/pipelines/rush-update.yml +++ b/eng/pipelines/rush-update.yml @@ -26,4 +26,3 @@ jobs: PRBranchName: automated-rush-update-$(Build.BuildId) CommitMsg: "Automatic rush update recheck" PRTitle: "Automatic rush update" - BaseBranchName: master From a812f3291834383fa2caa24a5e14dfce2cbb8177 Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Mon, 14 Jun 2021 16:23:05 -0400 Subject: [PATCH 10/14] Add rush update in aggregate report pipeline --- eng/pipelines/aggregate-reports.yml | 24 ++++++++++++++++++++++++ eng/pipelines/rush-update.yml | 28 ---------------------------- 2 files changed, 24 insertions(+), 28 deletions(-) delete mode 100644 eng/pipelines/rush-update.yml diff --git a/eng/pipelines/aggregate-reports.yml b/eng/pipelines/aggregate-reports.yml index 04df984b1566..c456ddb9db91 100644 --- a/eng/pipelines/aggregate-reports.yml +++ b/eng/pipelines/aggregate-reports.yml @@ -75,3 +75,27 @@ jobs: - task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@3 displayName: 'Publish Security Analysis Logs' condition: succeededOrFailed() + +- job: 'RushUpdate' + variables: + - template: /eng/pipelines/templates/variables/globals.yml + + pool: + name: azsdk-pool-mms-ubuntu-1804-general + vmImage: MMSUbuntu18.04 + + steps: + - template: /eng/pipelines/templates/steps/common.yml + + - script: | + node common/scripts/install-run-rush.js install + node common/scripts/install-run-rush.js update --recheck + displayName: "Run Rush Update" + + - template: /eng/common/pipelines/templates/steps/create-pull-request.yml + parameters: + RepoName: azure-sdk-for-js + PRBranchName: automated-rush-update + CommitMsg: "Automatic rush update recheck" + PRTitle: "Automatic rush update" + PushArgs: "-f" diff --git a/eng/pipelines/rush-update.yml b/eng/pipelines/rush-update.yml deleted file mode 100644 index beca2bb3597e..000000000000 --- a/eng/pipelines/rush-update.yml +++ /dev/null @@ -1,28 +0,0 @@ -trigger: none -pr: none - -# This pipeline is used to create PR automatically for rush update by running rush update --recheck - -jobs: - - job: 'ValidateDependencies' - variables: - - template: /eng/pipelines/templates/variables/globals.yml - - pool: - name: azsdk-pool-mms-ubuntu-1804-general - vmImage: MMSUbuntu18.04 - - steps: - - template: /eng/pipelines/templates/steps/common.yml - - - script: | - node common/scripts/install-run-rush.js install - node common/scripts/install-run-rush.js update --recheck - displayName: "Run Rush Update" - - - template: /eng/common/pipelines/templates/steps/create-pull-request.yml - parameters: - RepoName: azure-sdk-for-js - PRBranchName: automated-rush-update-$(Build.BuildId) - CommitMsg: "Automatic rush update recheck" - PRTitle: "Automatic rush update" From 16582575ba15cfee6a2f463811bc9d20cbb905bf Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Mon, 14 Jun 2021 16:26:54 -0400 Subject: [PATCH 11/14] Run rush update only on internal --- eng/pipelines/aggregate-reports.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/pipelines/aggregate-reports.yml b/eng/pipelines/aggregate-reports.yml index c456ddb9db91..89ba3290b011 100644 --- a/eng/pipelines/aggregate-reports.yml +++ b/eng/pipelines/aggregate-reports.yml @@ -77,6 +77,7 @@ jobs: condition: succeededOrFailed() - job: 'RushUpdate' + condition: eq(variables['System.TeamProject'], 'internal') variables: - template: /eng/pipelines/templates/variables/globals.yml From bcf2dde3df507f1a6a747a30273c3cebb717d521 Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Mon, 14 Jun 2021 16:35:32 -0400 Subject: [PATCH 12/14] Run rush update only on internal --- eng/pipelines/aggregate-reports.yml | 40 ++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/eng/pipelines/aggregate-reports.yml b/eng/pipelines/aggregate-reports.yml index 89ba3290b011..bd061135e15d 100644 --- a/eng/pipelines/aggregate-reports.yml +++ b/eng/pipelines/aggregate-reports.yml @@ -76,27 +76,27 @@ jobs: displayName: 'Publish Security Analysis Logs' condition: succeededOrFailed() -- job: 'RushUpdate' - condition: eq(variables['System.TeamProject'], 'internal') - variables: - - template: /eng/pipelines/templates/variables/globals.yml +- ${{if eq(variables['System.TeamProject'], 'internal')}}: + - job: 'RushUpdate' + variables: + - template: /eng/pipelines/templates/variables/globals.yml - pool: - name: azsdk-pool-mms-ubuntu-1804-general - vmImage: MMSUbuntu18.04 + pool: + name: azsdk-pool-mms-ubuntu-1804-general + vmImage: MMSUbuntu18.04 - steps: - - template: /eng/pipelines/templates/steps/common.yml + steps: + - template: /eng/pipelines/templates/steps/common.yml - - script: | - node common/scripts/install-run-rush.js install - node common/scripts/install-run-rush.js update --recheck - displayName: "Run Rush Update" + - script: | + node common/scripts/install-run-rush.js install + node common/scripts/install-run-rush.js update --recheck + displayName: "Run Rush Update" - - template: /eng/common/pipelines/templates/steps/create-pull-request.yml - parameters: - RepoName: azure-sdk-for-js - PRBranchName: automated-rush-update - CommitMsg: "Automatic rush update recheck" - PRTitle: "Automatic rush update" - PushArgs: "-f" + - template: /eng/common/pipelines/templates/steps/create-pull-request.yml + parameters: + RepoName: azure-sdk-for-js + PRBranchName: automated-rush-update + CommitMsg: "Automatic rush update recheck" + PRTitle: "Automatic rush update" + PushArgs: "-f" From 95ec7aadd32737130977078ee09ffe813436b21f Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Thu, 17 Jun 2021 09:55:23 -0400 Subject: [PATCH 13/14] Remove internal project condition --- eng/pipelines/aggregate-reports.yml | 39 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/eng/pipelines/aggregate-reports.yml b/eng/pipelines/aggregate-reports.yml index bd061135e15d..c456ddb9db91 100644 --- a/eng/pipelines/aggregate-reports.yml +++ b/eng/pipelines/aggregate-reports.yml @@ -76,27 +76,26 @@ jobs: displayName: 'Publish Security Analysis Logs' condition: succeededOrFailed() -- ${{if eq(variables['System.TeamProject'], 'internal')}}: - - job: 'RushUpdate' - variables: - - template: /eng/pipelines/templates/variables/globals.yml +- job: 'RushUpdate' + variables: + - template: /eng/pipelines/templates/variables/globals.yml - pool: - name: azsdk-pool-mms-ubuntu-1804-general - vmImage: MMSUbuntu18.04 + pool: + name: azsdk-pool-mms-ubuntu-1804-general + vmImage: MMSUbuntu18.04 - steps: - - template: /eng/pipelines/templates/steps/common.yml + steps: + - template: /eng/pipelines/templates/steps/common.yml - - script: | - node common/scripts/install-run-rush.js install - node common/scripts/install-run-rush.js update --recheck - displayName: "Run Rush Update" + - script: | + node common/scripts/install-run-rush.js install + node common/scripts/install-run-rush.js update --recheck + displayName: "Run Rush Update" - - template: /eng/common/pipelines/templates/steps/create-pull-request.yml - parameters: - RepoName: azure-sdk-for-js - PRBranchName: automated-rush-update - CommitMsg: "Automatic rush update recheck" - PRTitle: "Automatic rush update" - PushArgs: "-f" + - template: /eng/common/pipelines/templates/steps/create-pull-request.yml + parameters: + RepoName: azure-sdk-for-js + PRBranchName: automated-rush-update + CommitMsg: "Automatic rush update recheck" + PRTitle: "Automatic rush update" + PushArgs: "-f" From 002e13c6ec636a3fe73ca42629c0a1ce73c96a20 Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Thu, 17 Jun 2021 15:01:41 -0400 Subject: [PATCH 14/14] Pass base branch name --- eng/pipelines/aggregate-reports.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eng/pipelines/aggregate-reports.yml b/eng/pipelines/aggregate-reports.yml index c456ddb9db91..e20d314b0f8f 100644 --- a/eng/pipelines/aggregate-reports.yml +++ b/eng/pipelines/aggregate-reports.yml @@ -87,6 +87,8 @@ jobs: steps: - template: /eng/pipelines/templates/steps/common.yml + - template: /eng/common/pipelines/templates/steps/set-default-branch.yml + - script: | node common/scripts/install-run-rush.js install node common/scripts/install-run-rush.js update --recheck @@ -95,7 +97,9 @@ jobs: - template: /eng/common/pipelines/templates/steps/create-pull-request.yml parameters: RepoName: azure-sdk-for-js + BaseBranchName: $(DefaultBranch) PRBranchName: automated-rush-update CommitMsg: "Automatic rush update recheck" PRTitle: "Automatic rush update" + PRBody: "Automatic rush update PR" PushArgs: "-f"