-
Suggestion
-
Resolution: Unresolved
-
None
-
None
-
0
-
When using the build warning parser together with Bitbucket it is important that the filename in the warning message is a relative path from the root of the repo otherwise Bitbucket will not be able to place the warning in-line in the code of a Pull Request. In many cases the filename in the warning message is instead an absolute path, or a relative path from the build folder.
Example:
{ "repositoryId":1, "fileName":"C:/Builds/bamboo-build/xyz/src/source.c", "lineNumber":9, "message":"unreferenced formal parameter", "severity":"NORMAL", "category":"C4100", "source":"MSBuild" }
In this case "C:/Builds/bamboo-build/xyz/" needs to be removed from the "fileName".
This could be achieved by adding an extra option to the Build Warning Parser task where the user can enter one or more strings that should be removed from the beginning of the fileName.
Yeah...
Our work-around is to `tee` the logs to a file:
and add a power shell script task to fix the logs:
$path = "${bamboo.build.working.directory}\src\" cat build_log.txt | %{$_ -replace [regex]::Escape($path),""} | Out-File build_log_fixed.txt -Encoding UTF8