-
Notifications
You must be signed in to change notification settings - Fork 378
[release/3.x] Fix SDL error reporting #7654
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
Conversation
| @@ -36,16 +36,26 @@ git add . | |||
| if ($LASTEXITCODE -ne 0) { | |||
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.
is leaving this as not $global:LASTEXITCODE intentional?
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.
Yes, the only problem is setting $LASTEXITCODE. We could change every instance to $global:LASTEXITCODE to be on the safe side but I think it's an overkill.
MattGal
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.
Signing off as changes seem reasonable but I'd like to see a run where this properly fails, since that's called out in the original issue.
|
@MattGal I've linked two example builds in the description. |
Thanks, I didn't realize the 2nd one was with this change. |
riarenas
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.
Changes look good to me. But this is a behavior change that might impact repos (we were hiding these errors when found), so I would look for approval from @mmitche or @markwilkie. They might have additional thoughts. Also, could you fill out the template in your PR description for changes to the release branches? https://github.com/dotnet/arcade/blob/main/Documentation/Policy/AskModeTellModeTemplate.md
|
Thanks for the comments @riarenas. I have updated the description based on the template. |
|
This PR should be ready. It's waiting only for approvals. I also have the same changes prepared for |
|
@mmitche @markwilkie can we get a sign-off on this backport? |
Description
Related issue: #7616
This PR introduces following changes:
$LASTEXITCODEvariable by calling$LASTEXITCODE = 0at the beginning of scripts. It should be$global:LASTEXITCODE = 0.Write-HosttoWrite-Errorwhere appropriate.Microsoft.DotNet.XUnitRunnerUap_TemporaryKey.pfxcertificate that SDL reports as vulnerabilitymain.Example build: https://dev.azure.com/dnceng/internal/_build/results?buildId=1250730
Example build that failed because of SDL error: https://dev.azure.com/dnceng/internal/_build/results?buildId=1248474
Customer Impact
Without fixing the error handling we may miss security issues reported by the SDL scanner.
Regression
There can be possible changes in behavior because we were ignoring all errors in SDL step before. Now they will fail the build.
Risk
The biggest risk is that fixing the error handling will make pipelines fail on SDL stage because of errors that we previously silently ignored.
Workarounds
If our target is to fail the build on SDL errors then I believe this the minimal amount of changes we have to make. The alternative is to keep track of the issues manually but this seems impractical in the long term.