Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract api scan to a separate pipeline #1498

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions .azure-pipelines/vscode-gradle-apiscan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: $(Date:yyyyMMdd).$(Rev:r)
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
trigger: none
pr: none
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
pool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Windows_2022
os: windows
sdl:
sourceAnalysisPool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Windows_2022
os: windows
spotBugs:
enabled: false
stages:
- stage: Build
jobs:
- job: Job_1
displayName: VSCode-Gradle-API-SCAN
templateContext:
outputs:
- output: pipelineArtifact
artifactName: extension
targetPath: $(Build.ArtifactStagingDirectory)
displayName: "Publish Artifact: extension"
steps:
- checkout: self
fetchTags: true
- task: JavaToolInstaller@0
displayName: Install Java 11
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: NodeTool@0
displayName: Install Node 16.14.2
inputs:
versionSpec: '16.14.2'
- task: Gradle@2
displayName: Build
inputs:
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
tasks: 'build'
- task: Gradle@2
displayName: PrepareForRelease
inputs:
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
tasks: 'prepareForRelease'
- bash: chmod +x gradle-server
workingDirectory: $(Build.SourcesDirectory)/extension/lib
displayName: Set permission
- task: DownloadBuildArtifacts@1
displayName: 'Download Build Server Artifacts'
inputs:
buildType: specific
project: 'a4d27ce2-a42d-4b71-8eef-78cee9a9728e'
pipeline: 16493
downloadType: specific
extractTars: false
- task: CopyFiles@2
displayName: 'Copy Build Server Artifacts'
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/build-server/server/build/libs'
Contents: '**'
TargetFolder: $(Build.SourcesDirectory)/extension/server
- task: JavaToolInstaller@0
displayName: Install Java 17
inputs:
versionSpec: '17'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: Gradle@2
displayName: Build
inputs:
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
tasks: ':extension:copyJdtlsPluginJar'
- bash: npx @vscode/vsce@latest package
workingDirectory: $(Build.SourcesDirectory)/extension
displayName: Package VSIX
- task: CopyFiles@2
displayName: "Copy Files for APIScan"
inputs:
Contents: "extension/*.vsix"
TargetFolder: $(Agent.TempDirectory)/APIScanFiles
condition: and(succeeded(), ne(variables['DisableAPIScan'], 'true'))
### Run latest version of APIScan listed at https://www.1eswiki.com/wiki/APIScan_Build_Task
- task: APIScan@2
displayName: Run APIScan
inputs:
softwareFolder: $(Agent.TempDirectory)/APIScanFiles
softwareName: "vscode-gradle"
softwareVersionNum: "$(Build.BuildId)"
isLargeApp: false
toolVersion: "Latest"
condition: and(succeeded(), ne(variables['DisableAPIScan'], 'true'))
env:
AzureServicesAuthConnectionString: runAs=App;AppId=$(ApiScanClientId);TenantId=$(ApiScanTenant);AppKey=$(ApiScanSecret)
23 changes: 2 additions & 21 deletions .azure-pipelines/vscode-gradle-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ extends:
parameters:
pool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Windows_2022
os: windows
image: 1ES_JavaTooling_Ubuntu-2004
os: linux
sdl:
sourceAnalysisPool:
name: 1ES_JavaTooling_Pool
Expand Down Expand Up @@ -183,25 +183,6 @@ extends:
- bash: npx @vscode/vsce@latest package --pre-release
workingDirectory: $(Build.SourcesDirectory)/extension
displayName: Package VSIX
### Copy files for APIScan
- task: CopyFiles@2
displayName: "Copy Files for APIScan"
inputs:
Contents: "extension/*.vsix"
TargetFolder: $(Agent.TempDirectory)/APIScanFiles
condition: and(succeeded(), ne(variables['DisableAPIScan'], 'true'))
### Run latest version of APIScan listed at https://www.1eswiki.com/wiki/APIScan_Build_Task
- task: APIScan@2
displayName: Run APIScan
inputs:
softwareFolder: $(Agent.TempDirectory)/APIScanFiles
softwareName: "vscode-gradle"
softwareVersionNum: "$(Build.BuildId)"
isLargeApp: false
toolVersion: "Latest"
condition: and(succeeded(), ne(variables['DisableAPIScan'], 'true'))
env:
AzureServicesAuthConnectionString: runAs=App;AppId=$(ApiScanClientId);TenantId=$(ApiScanTenant);AppKey=$(ApiScanSecret)
- task: CopyFiles@2
displayName: Copy VSIX
inputs:
Expand Down
22 changes: 2 additions & 20 deletions .azure-pipelines/vscode-gradle-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ extends:
parameters:
pool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Windows_2022
os: windows
image: 1ES_JavaTooling_Ubuntu-2004
os: linux
sdl:
sourceAnalysisPool:
name: 1ES_JavaTooling_Pool
Expand Down Expand Up @@ -178,24 +178,6 @@ extends:
- bash: npx @vscode/vsce@latest package
workingDirectory: $(Build.SourcesDirectory)/extension
displayName: Package VSIX
- task: CopyFiles@2
displayName: "Copy Files for APIScan"
inputs:
Contents: "extension/*.vsix"
TargetFolder: $(Agent.TempDirectory)/APIScanFiles
condition: and(succeeded(), ne(variables['DisableAPIScan'], 'true'))
### Run latest version of APIScan listed at https://www.1eswiki.com/wiki/APIScan_Build_Task
- task: APIScan@2
displayName: Run APIScan
inputs:
softwareFolder: $(Agent.TempDirectory)/APIScanFiles
softwareName: "vscode-gradle"
softwareVersionNum: "$(Build.BuildId)"
isLargeApp: false
toolVersion: "Latest"
condition: and(succeeded(), ne(variables['DisableAPIScan'], 'true'))
env:
AzureServicesAuthConnectionString: runAs=App;AppId=$(ApiScanClientId);TenantId=$(ApiScanTenant);AppKey=$(ApiScanSecret)
- task: CopyFiles@2
displayName: Copy VSIX
inputs:
Expand Down
2 changes: 1 addition & 1 deletion extension/src/bs/BuildServerController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
}
}),
commands.registerCommand(SEND_TELEMETRY_CMD, (data: string | object | Error) => {
let jsonObj: { [key: string]: any };

Check warning on line 63 in extension/src/bs/BuildServerController.ts

View workflow job for this annotation

GitHub Actions / Build & Analyse

Unexpected any. Specify a different type
if (typeof data === "string") {
jsonObj = JSON.parse(data);
} else {
Expand Down Expand Up @@ -129,7 +129,7 @@
machineStatus.hasProjectAtWorkspaceRoot = (await this.hasProjectAtWorkspaceRoot()).toString();
sendInfo("", {
kind: "machineStatus",
data: JSON.stringify(machineStatus),
data2: JSON.stringify(machineStatus),
});
}

Expand Down
2 changes: 1 addition & 1 deletion extension/src/logger/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class Logger {
this.log(error, LogVerbosity.ERROR);
sendInfo("", {
kind: "gradleTaskServerError",
data: error,
data2: error,
});
}

Expand Down
Loading