Skip to content

Commit

Permalink
CI Improvements for .NET SDK 8.0.301 update (#1926)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastien-marichal authored Jun 5, 2024
1 parent 25cfc85 commit 5dd8cae
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 14 deletions.
6 changes: 6 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
<!-- protobuf-packages = Google.Protobuf -->
<owners>Microsoft;sharwell;meirb;kzu;dotnetfoundation;castleproject;jonorossi;onovotny;fluentassertions;jamesnk;CycloneDX;grpc-packages;protobuf-packages</owners>
</repository>
<author name="Microsoft">
<!-- Subject Name: CN=Microsoft Corporation, valid from 2023-07-27 -->
<certificate fingerprint="566A31882BE208BE4422F7CFD66ED09F5D4524A5994F50CCC8B05EC0528C1353" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
<!-- Subject Name: CN=Microsoft Corporation, valid from: 2020-09-30 -->
<certificate fingerprint="AA12DA22A49BCE7D5C1AE64CC1F3D892F150DA76140F210ABD2CBFFCA2C18A27" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
</author>
<author name="SonarSource">
<!-- Subject Name: CN=SonarSource SA, valid from 2023-10-17 -->
<certificate fingerprint="A943C46DBA193D99C1135FFE33D3337524E9B3F05B416B9314E168CD206EF427" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
Expand Down
1 change: 1 addition & 0 deletions SonarScanner.MSBuild.sln
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
src\Directory.Build.targets = src\Directory.Build.targets
src\DotnetVersions.props = src\DotnetVersions.props
sonar-docs\analysis\scan\sonarscanner-for-msbuild.md = sonar-docs\analysis\scan\sonarscanner-for-msbuild.md
NuGet.Config = NuGet.Config
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LogArgs", "Tests\LogArgs\LogArgs.csproj", "{25334485-0BF1-4A3D-A1B6-E646D89D15DB}"
Expand Down
2 changes: 1 addition & 1 deletion its/projects/TwoDrivesTwoProjects/TwoDrivesTwoProjects.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VisualStudioVersion = 17.2.32526.322
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefaultDrive", "DefaultDrive\DefaultDrive.csproj", "{5B64B1C0-C68F-4585-B02A-8789CD7C31CE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DriveZ", "Z:\DriveZ.csproj", "{1B0529BA-29F3-49F1-9977-99050FAC907A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DriveZ", "Z:\Subfolder\DriveZ.csproj", "{1B0529BA-29F3-49F1-9977-99050FAC907A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
14 changes: 12 additions & 2 deletions its/projects/VueWithAspBackend/NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,22 @@
</config>
<trustedSigners>
<repository name="nuget.org" serviceIndex="https://api.nuget.org/v3/index.json">
<!-- Subject Name: CN=NuGet.org Repository by Microsoft, valid from 10/04/2018 -->
<!-- Subject Name: CN=NuGet.org Repository by Microsoft, valid from 2018-04-10 -->
<certificate fingerprint="0E5F38F57DC1BCC806D8494F4F90FBCEDD988B46760709CBEEC6F4219AA6157D" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
<!-- Subject Name: CN=NuGet.org Repository by Microsoft, valid from 16/02/2021 -->
<!-- Subject Name: CN=NuGet.org Repository by Microsoft, valid from 2021-02-16 -->
<certificate fingerprint="5A2901D6ADA3D18260B9C6DFE2133C95D74B9EEF6AE0E5DC334C8454D1477DF4" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
<!-- Subject Name: CN=NuGet.org Repository by Microsoft, valid from 2024-02-23 -->
<certificate fingerprint="1F4B311D9ACC115C8DC8018B5A49E00FCE6DA8E2855F9F014CA6F34570BC482D" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
<!-- domaindrivendev = for Swashbuckle Swagger integration-->
<owners>Microsoft;domaindrivendev</owners>
</repository>
<authors>
<author name="Microsoft">
<!-- Subject Name: CN=Microsoft Corporation, valid from 2023-07-27 -->
<certificate fingerprint="566A31882BE208BE4422F7CFD66ED09F5D4524A5994F50CCC8B05EC0528C1353" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
<!-- Subject Name: CN=Microsoft Corporation, valid from: 2020-09-30 -->
<certificate fingerprint="AA12DA22A49BCE7D5C1AE64CC1F3D892F150DA76140F210ABD2CBFFCA2C18A27" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
</author>
</authors>
</trustedSigners>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -1108,17 +1108,9 @@ private BuildResult runAnalysisWithoutProjectBasedDir(Path projectDir) {

ORCHESTRATOR.executeBuild(scanner);

// build project
String[] arguments = new String[]{"build", folderName + ".sln"};
int status = CommandExecutor.create().execute(Command.create("dotnet")
.addArguments(arguments)
// verbosity level: change 'm' to 'd' for detailed logs
.addArguments("-v:m")
.addArgument("/warnaserror:AD0001")
.setEnvironmentVariable(VstsUtils.ENV_SOURCES_DIRECTORY, "")
.setDirectory(projectDir.toFile()), 5 * 60 * 1000);
BuildResult buildResult = TestUtils.runDotnetCommand(projectDir, "build", folderName + ".sln", "--no-incremental");

assertThat(status).isZero();
assertThat(buildResult.getLastStatus()).isZero();

// use executeBuildQuietly to allow for failure
return ORCHESTRATOR.executeBuildQuietly(TestUtils.newScanner(ORCHESTRATOR, projectDir, ScannerClassifier.NET, token)
Expand Down Expand Up @@ -1219,7 +1211,7 @@ private void validateRazorProject(String projectName) throws IOException {

ORCHESTRATOR.executeBuild(TestUtils.newScannerBegin(ORCHESTRATOR, localProjectKey, projectDir, token, ScannerClassifier.NET_FRAMEWORK));
TestUtils.runNuGet(ORCHESTRATOR, projectDir, false, "restore");
TestUtils.runMSBuild(ORCHESTRATOR, projectDir, "/t:Rebuild", "/nr:false");
TestUtils.runDotnetCommand(projectDir, "build", "--no-incremental");
BuildResult result = TestUtils.executeEndStepAndDumpResults(ORCHESTRATOR, projectDir, localProjectKey, token);

assertTrue(result.isSuccess());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ public static void runNuGet(Orchestrator orch, Path projectDir, Boolean useDefau
public static BuildResult runDotnetCommand(Path workingDir, String dotnetCommand, String... arguments) {
var argumentList = new ArrayList<>(Arrays.asList(arguments));
argumentList.add(0, dotnetCommand);
argumentList.add("-warnaserror:AD0001");
argumentList.add("-nodereuse:false"); // This is mandatory, otherwise process node locks the dlls in .sonarqube preventing the test to delete temp directory
argumentList.add("--verbosity:minimal"); // Change to "detailed" if more information is needed

var buildResult = new BuildResult();
StreamConsumer.Pipe writer = new StreamConsumer.Pipe(buildResult.getLogsWriter());
Expand Down

0 comments on commit 5dd8cae

Please sign in to comment.