From bb4acaeaf37c39577625d2748c1a60d163d55f6a Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Mon, 8 Jul 2024 09:42:55 -0700 Subject: [PATCH 1/9] chore: fix here string --- .azure-pipelines/apiscan.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/apiscan.yml b/.azure-pipelines/apiscan.yml index 1e308bd..c4d6e39 100644 --- a/.azure-pipelines/apiscan.yml +++ b/.azure-pipelines/apiscan.yml @@ -30,7 +30,8 @@ extends: os: Windows steps: - pwsh: | - echo @" + echo @" + From 90c3bc2f9d118fe5f789748507c586ab216805ee Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Mon, 8 Jul 2024 09:57:23 -0700 Subject: [PATCH 2/9] more fixes --- .azure-pipelines/apiscan.yml | 14 +++++++------- setup-packages.ps1 | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.azure-pipelines/apiscan.yml b/.azure-pipelines/apiscan.yml index c4d6e39..3efacfc 100644 --- a/.azure-pipelines/apiscan.yml +++ b/.azure-pipelines/apiscan.yml @@ -31,13 +31,13 @@ extends: steps: - pwsh: | echo @" - - - - - - - + + + + + + + "@ > nuget.config displayName: Change feed diff --git a/setup-packages.ps1 b/setup-packages.ps1 index 257c259..42bd818 100644 --- a/setup-packages.ps1 +++ b/setup-packages.ps1 @@ -1,6 +1,8 @@ $SDK_VERSION = "1.37.0" $TEMP_PACKAGE_DIR = "temp_packages" +mkdir $TEMP_PACKAGE_DIR + dotnet add package Microsoft.CognitiveServices.Speech --version $SDK_VERSION --package-directory $TEMP_PACKAGE_DIR dotnet add package Microsoft.CognitiveServices.Speech.Extension.Embedded.SR --version $SDK_VERSION --package-directory $TEMP_PACKAGE_DIR dotnet add package Microsoft.CognitiveServices.Speech.Extension.Embedded.TTS --version $SDK_VERSION --package-directory $TEMP_PACKAGE_DIR From 07d4c085eaa7c5f794cd898c2939b7863c48df98 Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Mon, 8 Jul 2024 14:29:21 -0700 Subject: [PATCH 3/9] More adjustments --- .azure-pipelines/apiscan.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines/apiscan.yml b/.azure-pipelines/apiscan.yml index 3efacfc..a993a6e 100644 --- a/.azure-pipelines/apiscan.yml +++ b/.azure-pipelines/apiscan.yml @@ -19,7 +19,7 @@ extends: sdl: sourceAnalysisPool: 1es-windows-2022-x64 tsa: - enabled: true + enabled: false # TSA is already covered by pipeline.yml stages: - stage: Build @@ -43,11 +43,8 @@ extends: - task: NuGetAuthenticate@1 - - pwsh: ./setup-packages.ps1 - displayName: Download and extract C# packages - - script: npm ci - displayName: Install and build + displayName: Build - task: CopyFiles@2 inputs: From 493ab7c31149248a2ede7c815fd57a7366894f66 Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Fri, 2 Aug 2024 13:44:35 -0700 Subject: [PATCH 4/9] chore: enable APIScan --- .azure-pipelines/apiscan.yml | 99 ++++++++++++++++++------------------ .vscode/settings.json | 7 +++ 2 files changed, 57 insertions(+), 49 deletions(-) diff --git a/.azure-pipelines/apiscan.yml b/.azure-pipelines/apiscan.yml index a993a6e..3733ea2 100644 --- a/.azure-pipelines/apiscan.yml +++ b/.azure-pipelines/apiscan.yml @@ -24,57 +24,58 @@ extends: stages: - stage: Build jobs: - - job: APIScan - pool: - name: 1es-windows-2022-x64 - os: Windows - steps: - - pwsh: | - echo @" - - - - - - - - "@ > nuget.config - displayName: Change feed + - job: APIScan + pool: + name: 1es-windows-2022-x64 + os: Windows + steps: + - pwsh: | + echo @" + + + + + + + + "@ > nuget.config + displayName: Change feed - - task: NuGetAuthenticate@1 + - task: NuGetAuthenticate@1 - - script: npm ci - displayName: Build + - script: npm ci + displayName: Build - - task: CopyFiles@2 - inputs: - SourceFolder: '$(Build.SourcesDirectory)/build' - Contents: | - '**\*.dll' - '**\*.node' - '**\*.pdb' - TargetFolder: '$(Agent.TempDirectory)/apiscan' - flattenFolders: true - displayName: Copy files for APIScan - condition: succeeded() + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/build" + Contents: | + '**\*.dll' + '**\*.node' + '**\*.pdb' + TargetFolder: "$(Agent.TempDirectory)/apiscan" + flattenFolders: true + displayName: Copy files for APIScan + condition: succeeded() - # Run APIScan - # - task: APIScan@2 - # inputs: - # softwareFolder: '$(Agent.TempDirectory)/apiscan' - # softwareName: 'vscode-node-speech' - # softwareVersionNum: '1' - # isLargeApp: false - # toolVersion: 'Latest' - # displayName: Run APIScan - # condition: succeeded() - # env: - # AzureServicesAuthConnectionString: $(apiscan-connectionstring) + - task: APIScan@2 + inputs: + softwareFolder: "$(Agent.TempDirectory)/apiscan" + softwareName: "vscode-node-speech" + softwareVersionNum: "1" + isLargeApp: false + toolVersion: "Latest" + azureSubscription: "vscode-apiscan" + displayName: Run APIScan + condition: succeeded() + env: + AzureServicesAuthConnectionString: $(apiscan-connectionstring) + SYSTEM_ACCESSTOKEN: $(System.AccessToken) - - task: PublishSecurityAnalysisLogs@3 - displayName: Publish security logs - inputs: - ArtifactName: 'CodeAnalysisLogs' - ArtifactType: 'Container' - AllTools: true - ToolLogsNotFoundAction: 'Standard' + - task: PublishSecurityAnalysisLogs@3 + displayName: Publish security logs + inputs: + ArtifactName: "CodeAnalysisLogs" + ArtifactType: "Container" + AllTools: true + ToolLogsNotFoundAction: "Standard" diff --git a/.vscode/settings.json b/.vscode/settings.json index f1e1553..1ae0482 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -85,4 +85,11 @@ "git.branchProtectionPrompt": "alwaysCommitToNewBranch", "git.branchRandomName.enable": true, "git.pullBeforeCheckout": true, + "[yaml]": { + "editor.insertSpaces": true, + "editor.tabSize": 2, + "editor.autoIndent": "advanced", + "diffEditor.ignoreTrimWhitespace": false, + "editor.formatOnSave": true + } } \ No newline at end of file From b1bbbc5569f6d08c0045259f438ecd0b39b5a2e4 Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Fri, 2 Aug 2024 14:02:17 -0700 Subject: [PATCH 5/9] chore: fix CopyFiles --- .azure-pipelines/apiscan.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/apiscan.yml b/.azure-pipelines/apiscan.yml index 3733ea2..f786610 100644 --- a/.azure-pipelines/apiscan.yml +++ b/.azure-pipelines/apiscan.yml @@ -48,11 +48,10 @@ extends: - task: CopyFiles@2 inputs: - SourceFolder: "$(Build.SourcesDirectory)/build" Contents: | - '**\*.dll' - '**\*.node' - '**\*.pdb' + build/**/*.dll + build/**/*.node + build/**/*.pdb TargetFolder: "$(Agent.TempDirectory)/apiscan" flattenFolders: true displayName: Copy files for APIScan From 66a5fe8ad0ca203d6dc296f743c86364aeedcff6 Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Fri, 2 Aug 2024 14:10:28 -0700 Subject: [PATCH 6/9] Add variable group --- .azure-pipelines/apiscan.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.azure-pipelines/apiscan.yml b/.azure-pipelines/apiscan.yml index f786610..7a77b3a 100644 --- a/.azure-pipelines/apiscan.yml +++ b/.azure-pipelines/apiscan.yml @@ -28,6 +28,8 @@ extends: pool: name: 1es-windows-2022-x64 os: Windows + variables: + - group: "API Scan" steps: - pwsh: | echo @" From 0b90d8543751a84f2c08228058a73b189041bbea Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Fri, 2 Aug 2024 14:25:16 -0700 Subject: [PATCH 7/9] Add cache folder --- .azure-pipelines/apiscan.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines/apiscan.yml b/.azure-pipelines/apiscan.yml index 7a77b3a..7f42120 100644 --- a/.azure-pipelines/apiscan.yml +++ b/.azure-pipelines/apiscan.yml @@ -54,6 +54,7 @@ extends: build/**/*.dll build/**/*.node build/**/*.pdb + .cache/SpeechSDK/**/*.pdb TargetFolder: "$(Agent.TempDirectory)/apiscan" flattenFolders: true displayName: Copy files for APIScan From 4f6b656243f93ffc66bf76fe006298ce9147bcf2 Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Fri, 2 Aug 2024 14:57:06 -0700 Subject: [PATCH 8/9] Add symbolsFolder arg --- .azure-pipelines/apiscan.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines/apiscan.yml b/.azure-pipelines/apiscan.yml index 7f42120..68384ea 100644 --- a/.azure-pipelines/apiscan.yml +++ b/.azure-pipelines/apiscan.yml @@ -65,6 +65,7 @@ extends: softwareFolder: "$(Agent.TempDirectory)/apiscan" softwareName: "vscode-node-speech" softwareVersionNum: "1" + symbolsFolder: "srv*https://symweb.azurefd.net;$(Agent.TempDirectory)/apiscan" isLargeApp: false toolVersion: "Latest" azureSubscription: "vscode-apiscan" From 699f7c23c386e2f294f7cca84071a1fb5adc7910 Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:18:50 -0700 Subject: [PATCH 9/9] chore: create include.gypi --- .azure-pipelines/apiscan.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.azure-pipelines/apiscan.yml b/.azure-pipelines/apiscan.yml index 68384ea..c2e5355 100644 --- a/.azure-pipelines/apiscan.yml +++ b/.azure-pipelines/apiscan.yml @@ -45,6 +45,31 @@ extends: - task: NuGetAuthenticate@1 + - pwsh: | + $includes = @' + { + 'target_defaults': { + 'conditions': [ + ['OS=="win"', { + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalOptions': [ + '/profile' + ] + } + } + }] + ] + } + } + '@ + + if (!(Test-Path "~/.gyp")) { + mkdir "~/.gyp" + echo $includes > "~/.gyp/include.gypi" + } + displayName: Create include.gypi + - script: npm ci displayName: Build