Skip to content
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

SCAN4NET-88 INFO level for invalid project GUIDs messages #2205

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

costin-zaharia-sonarsource
Copy link
Member

@costin-zaharia-sonarsource costin-zaharia-sonarsource commented Sep 19, 2024

@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod bot changed the title INFO level for invalid project GUIDs messages SCAN4NET-88 INFO level for invalid project GUIDs messages Sep 19, 2024
Base automatically changed from costin/cleanup-E2EAnalysisTests to master September 19, 2024 14:33
@@ -145,7 +145,7 @@ Error: {1}</value>
<value>Failed to resolve path relative to project file. Path: {0}</value>
</data>
<data name="WPIF_MissingOrInvalidProjectGuid" xml:space="preserve">
<value>The project does not have a valid ProjectGuid. Analysis results for this project will not be uploaded. Project file: {0}</value>
<value>Sonar: The project does not have a valid ProjectGuid. Analysis results for this project will not be uploaded. Project file: {0}</value>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we log messages during project build, we prefix them with "Sonar:". The message will appear in the following form:

       SonarWriteProjectData:
         Sonar: The project does not have a valid ProjectGuid. Analysis results for this project will not be uploaded. Project file: D:\src\playgroud\AzureFunctions\AzureFunctions\obj\Debug\net8.0\WorkerExtensions\WorkerExtensions.csproj
         Sonar: (WorkerExtensions.csproj) Project processed successfully

@@ -106,7 +106,7 @@ public override bool Execute()
}
else
{
Log.LogWarning(Resources.WPIF_MissingOrInvalidProjectGuid, FullProjectPath);
Log.LogMessage(MessageImportance.High, Resources.WPIF_MissingOrInvalidProjectGuid, FullProjectPath);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to set high importance so the message will be displayed even when dotnet build is called without a verbosity parameter.

The logs will look like this:

  Determining projects to restore...
  All projects are up-to-date for restore.
  WorkerExtensions -> D:\src\playgroud\AzureFunctions\AzureFunctions\obj\Debug\net8.0\WorkerExtensions\buildout\Microsoft.Azure.Functions.Worker.Extensions.dll
  Sonar: The project does not have a valid ProjectGuid. Analysis results for this project will not be uploaded. Project file: D:\src\playgroud\AzureFunctions\AzureFunctions\obj\Debug\net8.0\WorkerExtensions\WorkerExtensions.csproj
  Sonar: (WorkerExtensions.csproj) Project processed successfully
  AzureFunctions -> D:\src\playgroud\AzureFunctions\AzureFunctions\bin\Debug\net8.0\AzureFunctions.dll
  Sonar: (AzureFunctions.csproj) Project processed successfully

Copy link

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gregory-paidis-sonarsource gregory-paidis-sonarsource merged commit 6294440 into master Sep 20, 2024
19 checks passed
@gregory-paidis-sonarsource gregory-paidis-sonarsource deleted the costin/invalid-guid-message branch September 20, 2024 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants