Skip to content

Commit 4db586f

Browse files
committed
Add TSP diagnostic for binlog usage
1 parent c892744 commit 4db586f

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

csharp/autobuilder/Semmle.Autobuild.CSharp/CSharpAutobuilder.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,20 @@ private BuildScript AddBuildlessStartedDiagnostic()
116116
markdownMessage: "C# was extracted with build-mode set to 'none'. This means that all C# source in the working directory will be scanned, with build tools, such as Nuget and Dotnet CLIs, only contributing information about external dependencies.",
117117
severity: DiagnosticMessage.TspSeverity.Note
118118
));
119+
120+
// For the time being we are adding an additional message regarding the binlog usage. In the future, we might want to remove the buildless messages altogether when the binlog option is specified.
121+
if (actions.GetEnvironmentVariable(CSharpAutobuildOptions.ExtractorOptionBinlog) is not null)
122+
{
123+
AddDiagnostic(new DiagnosticMessage(
124+
Options.Language,
125+
"buildless/binlog",
126+
"C# was extracted with the experimental 'binlog' option",
127+
visibility: new DiagnosticMessage.TspVisibility(statusPage: true, cliSummaryTable: true, telemetry: true),
128+
markdownMessage: "C# was extracted with the experimental 'binlog' option.",
129+
severity: DiagnosticMessage.TspSeverity.Note
130+
));
131+
}
132+
119133
return 0;
120134
});
121135
}

csharp/ql/integration-tests/all-platforms/binlog/diagnostics.expected

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,17 @@
2626
"telemetry": true
2727
}
2828
}
29+
{
30+
"markdownMessage": "C# was extracted with the experimental 'binlog' option.",
31+
"severity": "note",
32+
"source": {
33+
"extractorName": "csharp",
34+
"id": "csharp/autobuilder/buildless/binlog",
35+
"name": "C# was extracted with the experimental 'binlog' option"
36+
},
37+
"visibility": {
38+
"cliSummaryTable": true,
39+
"statusPage": true,
40+
"telemetry": true
41+
}
42+
}

0 commit comments

Comments
 (0)