-
Notifications
You must be signed in to change notification settings - Fork 1k
Automate triggering of CLI security build. #7357
Conversation
|
@nguerrera since Livar is OOF, would you PTAL. This PR is a follow up of #7296 |
| "name": "DotNet-Cli-Trusted", | ||
| "url": "https://devdiv.visualstudio.com/DevDiv/_git/DotNet-Cli-Trusted", | ||
| "defaultBranch": "refs/heads/master", | ||
| "defaultBranch": "refs/heads/sec_ext", |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@ravimeda, Does the |
|
Good question, Michael. The way I was thinking is, the root build invokes |
|
|
||
| try | ||
| { | ||
| if(Test-Path "$latestVersionFilePath") |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| $latestVersionUrl = "$UrlPrefix/$Branch/$Filename" | ||
| $latestVersionFilePath = ".\latest.version" | ||
| $env:CliLatestCommitSha = "" | ||
| $env:CliLatestPackageId = "" |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@MichaelSimons addressed the following through 0d837ca
PTAL. |
| $retryCount = 1 | ||
| $oldEap = $ErrorActionPreference | ||
|
|
||
| while ($retryCount -le 3) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| try | ||
| { | ||
| return (Invoke-WebRequest -Uri "$latestVersionUrl" -UseBasicParsing).Content.Split([Environment]::NewLine, [System.StringSplitOptions]::RemoveEmptyEntries) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| $latestVersionUrl = "$UrlPrefix/$Branch/$Filename" | ||
| $latestVersionContent = Get-VersionInfo | ||
|
|
||
| if (-not [string]::IsNullOrWhiteSpace($latestVersionContent) -and $latestVersionContent.Length -eq 2) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| "inputs": { | ||
| "scriptType": "filePath", | ||
| "scriptName": "$(Build.SourcesDirectory)\\build\\buildpipeline\\security\\Get-LatestVersion.ps1", | ||
| "arguments": "-Branch \"$(CodeBase)\"", |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Addressed the following through d6bd18e
PTAL Thanks again. |
MichaelSimons
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@nguerrera FYI I will merge as soon as the checks pass. |
|
@nguerrera please could you merge this PR. The two failures appear unrelated to these changes. |
|
@dotnet-bot test OpenSUSE42.1 x64 Debug Build |
|
requeueing these tests, they should be healthy |
|
Thanks all! |
These changes allow automatic queuing of security build.
build/buildpipeline/security/Get-LatestVersion.ps1is invoked by the root build (https://devdiv.visualstudio.com/DevDiv/_build/index?context=allDefinitions&path=%5CDotNet%5CSecurity&definitionId=6698&_a=completed) to retrieve commit SHA and package Id from latest.version. This info is passed onto the build leg i.e.DotNet-CLI-Security-Windows.json, which perform the scanning of assemblies and sources for security issues.Refer (https://github.com/dotnet/core-eng/issues/1401).
Post merge, I will setup a trigger to run security build once per day, and cleanup documentation at https://github.com/dotnet/core-eng/blob/master/Documentation/Project-Docs/security-builds.md
@livarcocc PTAL.
Cc @MichaelSimons