Skip to content

Commit c968679

Browse files
Add new symbol validation issues. (#7015)
Add the new validation issues.
1 parent 5a7e13a commit c968679

6 files changed

Lines changed: 30 additions & 10 deletions

File tree

src/NuGetGallery.Core/Extensions/ValidationIssueExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ public static string ToMarkdownString(this ValidationIssue validationIssue, stri
5959
return "The uploaded symbols package contains pdb(s) for a corresponding dll(s) not found in the nuget package.";
6060
case ValidationIssueCode.SymbolErrorCode_PdbIsNotPortable:
6161
return "The uploaded symbols package contains one or more pdbs that are not portable.";
62+
case ValidationIssueCode.SymbolErrorCode_SnupkgDoesNotContainSymbols:
63+
return "The uploaded symbols package does not contain any symbol files.";
64+
case ValidationIssueCode.SymbolErrorCode_SnupkgContainsEntriesNotSafeForExtraction:
65+
return "The uploaded symbols package contains entries that are not safe for extraction.";
6266
default:
6367
return "There was an unknown failure when validating your package.";
6468
}

src/NuGetGallery.Core/NuGetGallery.Core.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,19 +219,19 @@
219219
</ItemGroup>
220220
<ItemGroup>
221221
<PackageReference Include="NuGet.Services.Entities">
222-
<Version>2.43.0</Version>
222+
<Version>2.44.0</Version>
223223
</PackageReference>
224224
<PackageReference Include="NuGet.Services.FeatureFlags">
225-
<Version>2.43.0</Version>
225+
<Version>2.44.0</Version>
226226
</PackageReference>
227227
<PackageReference Include="NuGet.Services.Messaging.Email">
228-
<Version>2.43.0</Version>
228+
<Version>2.44.0</Version>
229229
</PackageReference>
230230
<PackageReference Include="NuGet.Services.Validation">
231-
<Version>2.43.0</Version>
231+
<Version>2.44.0</Version>
232232
</PackageReference>
233233
<PackageReference Include="NuGet.Services.Validation.Issues">
234-
<Version>2.43.0</Version>
234+
<Version>2.44.0</Version>
235235
</PackageReference>
236236
<PackageReference Include="NuGet.StrongName.AnglicanGeek.MarkdownMailer">
237237
<Version>1.2.0</Version>

src/NuGetGallery/NuGetGallery.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,7 +2124,7 @@
21242124
<Version>2.2.0</Version>
21252125
</PackageReference>
21262126
<PackageReference Include="NuGet.Services.Licenses">
2127-
<Version>2.43.0</Version>
2127+
<Version>2.44.0</Version>
21282128
</PackageReference>
21292129
<PackageReference Include="NuGet.StrongName.AnglicanGeek.MarkdownMailer">
21302130
<Version>1.2.0</Version>
@@ -2348,16 +2348,16 @@
23482348
<Version>5.0.0-preview1.5665</Version>
23492349
</PackageReference>
23502350
<PackageReference Include="NuGet.Services.KeyVault">
2351-
<Version>2.43.0</Version>
2351+
<Version>2.44.0</Version>
23522352
</PackageReference>
23532353
<PackageReference Include="NuGet.Services.Logging">
2354-
<Version>2.43.0</Version>
2354+
<Version>2.44.0</Version>
23552355
</PackageReference>
23562356
<PackageReference Include="NuGet.Services.Owin">
2357-
<Version>2.43.0</Version>
2357+
<Version>2.44.0</Version>
23582358
</PackageReference>
23592359
<PackageReference Include="NuGet.Services.Sql">
2360-
<Version>2.43.0</Version>
2360+
<Version>2.44.0</Version>
23612361
</PackageReference>
23622362
<PackageReference Include="Owin">
23632363
<Version>1.0.0</Version>

src/NuGetGallery/Views/Packages/_ValidationIssue.cshtml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@
7373
The uploaded symbols package contains one or more pdbs that are not portable.
7474
</text>
7575
break;
76+
case ValidationIssueCode.SymbolErrorCode_SnupkgDoesNotContainSymbols:
77+
<text>
78+
The uploaded symbols package does not contain any symbol files.
79+
</text>
80+
break;
81+
case ValidationIssueCode.SymbolErrorCode_SnupkgContainsEntriesNotSafeForExtraction:
82+
<text>
83+
The uploaded symbols package contains entries that are not safe for extraction.
84+
</text>
85+
break;
7686
default:
7787
<text>
7888
There was an unknown failure when validating your package.

tests/NuGetGallery.Facts/Infrastructure/Mail/MarkdownMessageServiceFacts.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2326,6 +2326,10 @@ private static string ParseValidationIssue(ValidationIssue validationIssue, stri
23262326
return "The uploaded symbols package contains pdb(s) for a corresponding dll(s) not found in the nuget package.";
23272327
case ValidationIssueCode.SymbolErrorCode_PdbIsNotPortable:
23282328
return "The uploaded symbols package contains one or more pdbs that are not portable.";
2329+
case ValidationIssueCode.SymbolErrorCode_SnupkgDoesNotContainSymbols:
2330+
return "The uploaded symbols package does not contain any symbol files.";
2331+
case ValidationIssueCode.SymbolErrorCode_SnupkgContainsEntriesNotSafeForExtraction:
2332+
return "The uploaded symbols package contains entries that are not safe for extraction.";
23292333
default:
23302334
return "There was an unknown failure when validating your package.";
23312335
}

tests/NuGetGallery.Facts/Views/Packages/ValidationIssueFacts.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ public static IEnumerable<ValidationIssue> KnownValidationIssues
102102
yield return ValidationIssue.SymbolErrorCode_ChecksumDoesNotMatch;
103103
yield return ValidationIssue.SymbolErrorCode_MatchingAssemblyNotFound;
104104
yield return ValidationIssue.SymbolErrorCode_PdbIsNotPortable;
105+
yield return ValidationIssue.SymbolErrorCode_SnupkgDoesNotContainSymbols;
106+
yield return ValidationIssue.SymbolErrorCode_SnupkgContainsEntriesNotSafeForExtraction;
105107
yield return new UnauthorizedCertificateFailure("thumbprint");
106108
}
107109
}

0 commit comments

Comments
 (0)