mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-06 15:16:56 +01:00
Reject conflicting merged corrections
This commit is contained in:
parent
8c3216eec4
commit
dfe87111a8
2 changed files with 14 additions and 0 deletions
|
|
@ -351,6 +351,16 @@ try {
|
||||||
-SourceRoot $tmp -SourcePaths $sourcePath -RetrievedArticlePaths $articlePath, $supportingArticlePath
|
-SourceRoot $tmp -SourcePaths $sourcePath -RetrievedArticlePaths $articlePath, $supportingArticlePath
|
||||||
Assert-True (-not $acceptedTextOnlyMerge.normalized) 'supporting references permit an overlapping A and B merge with different messages and no suggested code'
|
Assert-True (-not $acceptedTextOnlyMerge.normalized) 'supporting references permit an overlapping A and B merge with different messages and no suggested code'
|
||||||
|
|
||||||
|
$conflictingSupportingLeaf = $supportingFindingLeaf | ConvertTo-Json -Depth 20 | ConvertFrom-Json
|
||||||
|
$conflictingSupportingLeaf.findings[0].'suggested-code' = 'ToolTip = ''Customer name'';'
|
||||||
|
$conflictingCorrectionMerge = $mergedSuperReport | ConvertTo-Json -Depth 20 | ConvertFrom-Json
|
||||||
|
$conflictingCorrectionMerge.'sub-results' = @($mergeOwnerLeaf, $conflictingSupportingLeaf)
|
||||||
|
Set-Content -LiteralPath $reportPath -Value ($conflictingCorrectionMerge | ConvertTo-Json -Depth 20) -Encoding utf8NoBOM
|
||||||
|
Assert-ThrowsLike -Pattern '*SUPER_FINDING_MISSING*' -Action {
|
||||||
|
& $validator -ReportPath $reportPath -BCQualityRoot $Root -SkillKind super `
|
||||||
|
-SourceRoot $tmp -SourcePaths $sourcePath -RetrievedArticlePaths $articlePath, $supportingArticlePath
|
||||||
|
}
|
||||||
|
|
||||||
$unmergedSupportingFinding = $supportingFindingLeaf.findings[0] | ConvertTo-Json -Depth 20 | ConvertFrom-Json
|
$unmergedSupportingFinding = $supportingFindingLeaf.findings[0] | ConvertTo-Json -Depth 20 | ConvertFrom-Json
|
||||||
$unmergedSupportingFinding | Add-Member -NotePropertyName 'from-sub-skill' -NotePropertyValue 'al-security-review'
|
$unmergedSupportingFinding | Add-Member -NotePropertyName 'from-sub-skill' -NotePropertyValue 'al-security-review'
|
||||||
$unmergedDuplicates = $mergedSuperReport | ConvertTo-Json -Depth 20 | ConvertFrom-Json
|
$unmergedDuplicates = $mergedSuperReport | ConvertTo-Json -Depth 20 | ConvertFrom-Json
|
||||||
|
|
|
||||||
|
|
@ -204,8 +204,12 @@ function Get-SemanticErrors {
|
||||||
}
|
}
|
||||||
|
|
||||||
$sameCorrection = Test-SameCorrection $RolledFinding $LeafFinding
|
$sameCorrection = Test-SameCorrection $RolledFinding $LeafFinding
|
||||||
|
$correctionsConflict = (Test-HasProperty $RolledFinding 'suggested-code') -and
|
||||||
|
(Test-HasProperty $LeafFinding 'suggested-code') -and
|
||||||
|
$RolledFinding.'suggested-code' -cne $LeafFinding.'suggested-code'
|
||||||
$explicitCrossRuleMerge = $leafReferences.Count -and
|
$explicitCrossRuleMerge = $leafReferences.Count -and
|
||||||
$rolledReferences.Count -gt $leafReferences.Count -and
|
$rolledReferences.Count -gt $leafReferences.Count -and
|
||||||
|
-not $correctionsConflict -and
|
||||||
(Test-ReferencesInclude $rolledReferences $leafReferences)
|
(Test-ReferencesInclude $rolledReferences $leafReferences)
|
||||||
if (-not $sameCorrection -and -not $explicitCrossRuleMerge) {
|
if (-not $sameCorrection -and -not $explicitCrossRuleMerge) {
|
||||||
return $false
|
return $false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue