From c0216e98409d0228a292083ae118e7f59250ee11 Mon Sep 17 00:00:00 2001 From: Darren Miller Date: Mon, 30 Sep 2024 10:37:30 -0700 Subject: [PATCH 1/9] Update pipeline to use template --- .azure-devops/build-pipeline.yaml | 57 ------------------------- .azure-devops/full-pipeline.yml | 62 +++++++++++++++------------- .azure-devops/steps/build.yaml | 10 ++--- .azure-devops/steps/cleanup.yaml | 4 +- .azure-devops/steps/devcerts.yml | 12 +++--- .azure-devops/steps/edgewebview.yml | 36 ++++++++-------- .azure-devops/steps/npm-install.yaml | 10 ++--- .azure-devops/steps/run-tests.yaml | 10 ++--- .azure-devops/steps/test.yml | 18 ++++---- 9 files changed, 84 insertions(+), 135 deletions(-) delete mode 100644 .azure-devops/build-pipeline.yaml diff --git a/.azure-devops/build-pipeline.yaml b/.azure-devops/build-pipeline.yaml deleted file mode 100644 index 10af5be87..000000000 --- a/.azure-devops/build-pipeline.yaml +++ /dev/null @@ -1,57 +0,0 @@ -# Build a general Node.js project with npm. -# Add steps that analyze code, save build artifacts, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript - -parameters: -- name: clean - displayName: Checkout clean - type: boolean - default: true - values: - - false - - true - -trigger: - branches: - include: - - master - -resources: - repositories: - - repository: self - type: git - ref: master - -jobs: -- job: Windows - pool: - name: OPX Windows 1903 Dogfood Pool - GitHub - steps: - - checkout: self - clean: ${{ parameters.clean }} - - template: ./steps/npm-install.yaml - - template: ./steps/build.yaml - - template: ./steps/run-tests.yaml - - template: ./steps/cleanup.yaml - -- job: Mac - pool: - name: OPX Mac Dogfood Pool - steps: - - checkout: self - clean: ${{ parameters.clean }} - - template: ./steps/npm-install.yaml - - template: ./steps/build.yaml - - template: ./steps/run-tests.yaml - - template: ./steps/cleanup.yaml - -- job: Linux - pool: - name: Azure Pipelines - vmImage: ubuntu-latest - steps: - - checkout: self - clean: ${{ parameters.clean }} - - template: ./steps/npm-install.yaml - - template: ./steps/build.yaml - - template: ./steps/run-tests.yaml diff --git a/.azure-devops/full-pipeline.yml b/.azure-devops/full-pipeline.yml index dc51dd5d2..b9b1c9778 100644 --- a/.azure-devops/full-pipeline.yml +++ b/.azure-devops/full-pipeline.yml @@ -2,31 +2,37 @@ # Add steps that analyze code, save build artifacts, deploy, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/javascript -jobs: - - job: Windows_10_Latest - pool: - name: OE-OfficeClientApps - steps: - - template: ./steps/npm-install.yaml - - template: ./steps/build.yaml - - template: ./steps/devcerts.yml - - template: ./steps/edgewebview.yml - - template: ./steps/test.yml - - - job: Mac - pool: - name: OPX Mac Dogfood Pool - steps: - - template: ./steps/npm-install.yaml - - template: ./steps/build.yaml - - template: ./steps/test.yml - - template: ./steps/cleanup.yaml - - - job: Linux - pool: - name: Azure Pipelines - vmImage: ubuntu-latest - steps: - - template: ./steps/npm-install.yaml - - template: ./steps/build.yaml - - template: ./steps/test.yml +resources: + repositories: + - repository: CustomPipelineTemplates + type: git + name: 1ESPipelineTemplates/OfficePipelineTemplates + ref: refs/tags/release +extends: + template: /v1/Office.Unofficial.PipelineTemplate.yml@CustomPipelineTemplates + parameters: + sdl: + eslint: + configuration: required + parser: '@typescript-eslint/parser' + parserOptions: sourceType:module + stages: + - stage: stage + jobs: + - job: Windows_10_Latest + pool: + name: OE-OfficeClientApps + steps: + - template: ./steps/npm-install.yaml + - template: ./steps/build.yaml + - template: ./steps/devcerts.yml + - template: ./steps/edgewebview.yml + - template: ./steps/test.yml + - job: Linux + pool: + name: Azure Pipelines + vmImage: ubuntu-latest + steps: + - template: ./steps/npm-install.yaml + - template: ./steps/build.yaml + - template: ./steps/test.yml diff --git a/.azure-devops/steps/build.yaml b/.azure-devops/steps/build.yaml index 1aee7dd66..6ae24d883 100644 --- a/.azure-devops/steps/build.yaml +++ b/.azure-devops/steps/build.yaml @@ -1,6 +1,6 @@ steps: - - task: Npm@1 - displayName: "Build" - inputs: - command: custom - customCommand: "run build" +- task: Npm@1 + displayName: "Build" + inputs: + command: custom + customCommand: "run build" \ No newline at end of file diff --git a/.azure-devops/steps/cleanup.yaml b/.azure-devops/steps/cleanup.yaml index 29e868b7d..328e1549d 100644 --- a/.azure-devops/steps/cleanup.yaml +++ b/.azure-devops/steps/cleanup.yaml @@ -1,3 +1,3 @@ steps: - - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 - displayName: "Cleanup" +- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 + displayName: "Cleanup" \ No newline at end of file diff --git a/.azure-devops/steps/devcerts.yml b/.azure-devops/steps/devcerts.yml index 960d2dbfe..975377881 100644 --- a/.azure-devops/steps/devcerts.yml +++ b/.azure-devops/steps/devcerts.yml @@ -1,7 +1,7 @@ steps: - - script: | - echo Install Office-AddinDev-Certs at machine level - call npm install office-addin-dev-certs - call npx office-addin-dev-certs install --machine - - displayName: 'Install add-in dev cert' +- script: | + echo Install Office-AddinDev-Certs at machine level + call npm install office-addin-dev-certs + call npx office-addin-dev-certs install --machine + + displayName: 'Install add-in dev cert' \ No newline at end of file diff --git a/.azure-devops/steps/edgewebview.yml b/.azure-devops/steps/edgewebview.yml index 8ce3be724..59a6d6f3c 100644 --- a/.azure-devops/steps/edgewebview.yml +++ b/.azure-devops/steps/edgewebview.yml @@ -1,19 +1,19 @@ steps: - - script: | - echo Enable EdgeWebView Loopback - call npx office-addin-dev-settings appcontainer EdgeWebView --loopback --yes - - echo Set Edge WebView Registry Settings - - set PATH1="HKEY_CURRENT_USER\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Mappings\S-1-15-2-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646" - - reg add %PATH1% /f /v DisplayName /t REG_SZ /d "@{Microsoft.Win32WebViewHost_10.0.19041.423_neutral_neutral_cw5n1h2txyewy?ms-resource://Windows.Win32WebViewHost/resources/DisplayName}" - reg add %PATH1% /f /v Moniker /t REG_SZ /d "microsoft.win32webviewhost_cw5n1h2txyewy" - - set PATH2="HKEY_CURRENT_USER\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Mappings\S-1-15-2-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646\Children\S-1-15-2-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646-3829197285-1050560373-949424154-522343454" - - reg add %PATH2% /f /v DisplayName /t REG_SZ /d "microsoft.win32webviewhost_cw5n1h2txyewy/123" - reg add %PATH2% /f /v Moniker /t REG_SZ /d "123" - reg add %PATH2% /f /v ParentMoniker /t REG_SZ /d "microsoft.win32webviewhost_cw5n1h2txyewy" - - displayName: 'Enable Edge WebView' +- script: | + echo Enable EdgeWebView Loopback + call npx office-addin-dev-settings appcontainer EdgeWebView --loopback --yes + + echo Set Edge WebView Registry Settings + + set PATH1="HKEY_CURRENT_USER\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Mappings\S-1-15-2-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646" + + reg add %PATH1% /f /v DisplayName /t REG_SZ /d "@{Microsoft.Win32WebViewHost_10.0.19041.423_neutral_neutral_cw5n1h2txyewy?ms-resource://Windows.Win32WebViewHost/resources/DisplayName}" + reg add %PATH1% /f /v Moniker /t REG_SZ /d "microsoft.win32webviewhost_cw5n1h2txyewy" + + set PATH2="HKEY_CURRENT_USER\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Mappings\S-1-15-2-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646\Children\S-1-15-2-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646-3829197285-1050560373-949424154-522343454" + + reg add %PATH2% /f /v DisplayName /t REG_SZ /d "microsoft.win32webviewhost_cw5n1h2txyewy/123" + reg add %PATH2% /f /v Moniker /t REG_SZ /d "123" + reg add %PATH2% /f /v ParentMoniker /t REG_SZ /d "microsoft.win32webviewhost_cw5n1h2txyewy" + + displayName: 'Enable Edge WebView' \ No newline at end of file diff --git a/.azure-devops/steps/npm-install.yaml b/.azure-devops/steps/npm-install.yaml index 54dd6f094..67d9401d0 100644 --- a/.azure-devops/steps/npm-install.yaml +++ b/.azure-devops/steps/npm-install.yaml @@ -1,6 +1,6 @@ steps: - - task: Npm@1 - displayName: "Install NPM packages" - inputs: - command: custom - customCommand: "install" +- task: Npm@1 + displayName: "Install NPM packages" + inputs: + command: custom + customCommand: "install" \ No newline at end of file diff --git a/.azure-devops/steps/run-tests.yaml b/.azure-devops/steps/run-tests.yaml index f6a97d89c..b2a3d6335 100644 --- a/.azure-devops/steps/run-tests.yaml +++ b/.azure-devops/steps/run-tests.yaml @@ -1,6 +1,6 @@ steps: - - task: Npm@1 - displayName: "Run tests" - inputs: - command: custom - customCommand: "run test" +- task: Npm@1 + displayName: "Run tests" + inputs: + command: custom + customCommand: "run test" \ No newline at end of file diff --git a/.azure-devops/steps/test.yml b/.azure-devops/steps/test.yml index 5077cf2b8..6cd25116a 100644 --- a/.azure-devops/steps/test.yml +++ b/.azure-devops/steps/test.yml @@ -1,10 +1,10 @@ steps: - - task: CmdLine@2 - inputs: - script: | - echo Running Tests - - npm run test - - echo Done running tests - displayName: 'Run Tests' +- task: CmdLine@2 + inputs: + script: | + echo Running Tests + + npm run test + + echo Done running tests + displayName: 'Run Tests' \ No newline at end of file From 4b8d03db2d180b8052ad015d1ed2bee39b29be9d Mon Sep 17 00:00:00 2001 From: Darren Miller Date: Mon, 30 Sep 2024 11:44:44 -0700 Subject: [PATCH 2/9] Fix yaml file references --- .azure-devops/full-pipeline.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.azure-devops/full-pipeline.yml b/.azure-devops/full-pipeline.yml index b9b1c9778..d810dcc3f 100644 --- a/.azure-devops/full-pipeline.yml +++ b/.azure-devops/full-pipeline.yml @@ -23,16 +23,16 @@ extends: pool: name: OE-OfficeClientApps steps: - - template: ./steps/npm-install.yaml - - template: ./steps/build.yaml - - template: ./steps/devcerts.yml - - template: ./steps/edgewebview.yml - - template: ./steps/test.yml + - template: /.azure-devops/steps/npm-install.yaml + - template: /.azure-devops/steps/build.yaml + - template: /.azure-devops/steps/devcerts.yml + - template: /.azure-devops/steps/edgewebview.yml + - template: /.azure-devops/steps/test.yml - job: Linux pool: name: Azure Pipelines vmImage: ubuntu-latest steps: - - template: ./steps/npm-install.yaml - - template: ./steps/build.yaml - - template: ./steps/test.yml + - template: /.azure-devops/steps/npm-install.yaml + - template: /.azure-devops/steps/build.yaml + - template: /.azure-devops/steps/test.yml From d4add7ca64dd4ea43a03316f13b749f58d438ba6 Mon Sep 17 00:00:00 2001 From: Darren Miller Date: Mon, 30 Sep 2024 12:02:47 -0700 Subject: [PATCH 3/9] Add ending to yaml file paths references --- .azure-devops/full-pipeline.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.azure-devops/full-pipeline.yml b/.azure-devops/full-pipeline.yml index d810dcc3f..750f120a6 100644 --- a/.azure-devops/full-pipeline.yml +++ b/.azure-devops/full-pipeline.yml @@ -23,16 +23,16 @@ extends: pool: name: OE-OfficeClientApps steps: - - template: /.azure-devops/steps/npm-install.yaml - - template: /.azure-devops/steps/build.yaml - - template: /.azure-devops/steps/devcerts.yml - - template: /.azure-devops/steps/edgewebview.yml - - template: /.azure-devops/steps/test.yml + - template: /.azure-devops/steps/npm-install.yaml@self + - template: /.azure-devops/steps/build.yaml@self + - template: /.azure-devops/steps/devcerts.yml@self + - template: /.azure-devops/steps/edgewebview.yml@self + - template: /.azure-devops/steps/test.yml@self - job: Linux pool: name: Azure Pipelines vmImage: ubuntu-latest steps: - - template: /.azure-devops/steps/npm-install.yaml - - template: /.azure-devops/steps/build.yaml - - template: /.azure-devops/steps/test.yml + - template: /.azure-devops/steps/npm-install.yaml@self + - template: /.azure-devops/steps/build.yaml@self + - template: /.azure-devops/steps/test.yml@self From a299c7f26407431465638223c609dfcb022779c5 Mon Sep 17 00:00:00 2001 From: Darren Miller Date: Mon, 30 Sep 2024 12:13:32 -0700 Subject: [PATCH 4/9] Make windows pool the default for all setps --- .azure-devops/full-pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-devops/full-pipeline.yml b/.azure-devops/full-pipeline.yml index 750f120a6..2632e019e 100644 --- a/.azure-devops/full-pipeline.yml +++ b/.azure-devops/full-pipeline.yml @@ -11,6 +11,8 @@ resources: extends: template: /v1/Office.Unofficial.PipelineTemplate.yml@CustomPipelineTemplates parameters: + pool: + name: OE-OfficeClientApps sdl: eslint: configuration: required @@ -20,8 +22,6 @@ extends: - stage: stage jobs: - job: Windows_10_Latest - pool: - name: OE-OfficeClientApps steps: - template: /.azure-devops/steps/npm-install.yaml@self - template: /.azure-devops/steps/build.yaml@self From 0f2ef0363f6db8cc99fdc4ffca94aec65782c8b8 Mon Sep 17 00:00:00 2001 From: Darren Miller Date: Mon, 30 Sep 2024 12:29:43 -0700 Subject: [PATCH 5/9] Change linux pool --- .azure-devops/full-pipeline.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.azure-devops/full-pipeline.yml b/.azure-devops/full-pipeline.yml index 2632e019e..f271f3f8a 100644 --- a/.azure-devops/full-pipeline.yml +++ b/.azure-devops/full-pipeline.yml @@ -30,8 +30,9 @@ extends: - template: /.azure-devops/steps/test.yml@self - job: Linux pool: - name: Azure Pipelines - vmImage: ubuntu-latest + name: pt-validation-ppe + image: pt-validation-ppe-linux + os: linux steps: - template: /.azure-devops/steps/npm-install.yaml@self - template: /.azure-devops/steps/build.yaml@self From 7b6327b516fb52795c5f57d4aeae48b06336b4ea Mon Sep 17 00:00:00 2001 From: Darren Miller Date: Mon, 30 Sep 2024 15:55:37 -0700 Subject: [PATCH 6/9] Try other linux image --- .azure-devops/full-pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-devops/full-pipeline.yml b/.azure-devops/full-pipeline.yml index f271f3f8a..bfb5007d4 100644 --- a/.azure-devops/full-pipeline.yml +++ b/.azure-devops/full-pipeline.yml @@ -30,8 +30,8 @@ extends: - template: /.azure-devops/steps/test.yml@self - job: Linux pool: - name: pt-validation-ppe - image: pt-validation-ppe-linux + name: Azure-Pipelines-1ESPT-ExDShared + image: ubuntu-latest os: linux steps: - template: /.azure-devops/steps/npm-install.yaml@self From 5354284b50c6abc7fc179c233d47e582f5fe307b Mon Sep 17 00:00:00 2001 From: Darren Miller Date: Tue, 1 Oct 2024 11:09:37 -0700 Subject: [PATCH 7/9] Try different eslint config --- .azure-devops/full-pipeline.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.azure-devops/full-pipeline.yml b/.azure-devops/full-pipeline.yml index bfb5007d4..af16b8cdb 100644 --- a/.azure-devops/full-pipeline.yml +++ b/.azure-devops/full-pipeline.yml @@ -13,11 +13,14 @@ extends: parameters: pool: name: OE-OfficeClientApps + featureFlags: + scanAllEslintScriptExtensions: true sdl: eslint: configuration: required parser: '@typescript-eslint/parser' parserOptions: sourceType:module + targetsESLint: $(Build.SourcesDirectory)/packages/**/**/*.ts stages: - stage: stage jobs: From 19b2bf87633650c4c595eafcc7a579b0daef52af Mon Sep 17 00:00:00 2001 From: Darren Miller Date: Tue, 1 Oct 2024 13:11:13 -0700 Subject: [PATCH 8/9] Another eslint config test --- .azure-devops/full-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-devops/full-pipeline.yml b/.azure-devops/full-pipeline.yml index af16b8cdb..1560929ec 100644 --- a/.azure-devops/full-pipeline.yml +++ b/.azure-devops/full-pipeline.yml @@ -20,7 +20,7 @@ extends: configuration: required parser: '@typescript-eslint/parser' parserOptions: sourceType:module - targetsESLint: $(Build.SourcesDirectory)/packages/**/**/*.ts + targetsESLint: $(Build.SourcesDirectory)/packages/**/*.ts stages: - stage: stage jobs: From 48503dce1f4c141912c4dd17285d3164fc844984 Mon Sep 17 00:00:00 2001 From: Darren Miller Date: Tue, 1 Oct 2024 13:41:56 -0700 Subject: [PATCH 9/9] Monorepo linter settings --- .azure-devops/full-pipeline.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.azure-devops/full-pipeline.yml b/.azure-devops/full-pipeline.yml index 1560929ec..255e7c4ba 100644 --- a/.azure-devops/full-pipeline.yml +++ b/.azure-devops/full-pipeline.yml @@ -13,14 +13,12 @@ extends: parameters: pool: name: OE-OfficeClientApps - featureFlags: - scanAllEslintScriptExtensions: true sdl: eslint: configuration: required parser: '@typescript-eslint/parser' parserOptions: sourceType:module - targetsESLint: $(Build.SourcesDirectory)/packages/**/*.ts + project:['./packages/*/tsconfig.json'] stages: - stage: stage jobs: