ocurity / dracon

Security scanning & static analysis tool - forked and rewritten from @thought-machine/dracon
https://ocurity.com
Apache License 2.0
61 stars 9 forks source link

Minor fix to prevent failures of database migrations tests #156

Closed ptzianos closed 2 months ago

ptzianos commented 2 months ago

Stacked on top of https://github.com/ocurity/dracon/pull/155

In the last couple of days the migrations test have failed locally for no apparent reason, since no code related to them has changed, the dependency versions have not changed and neither have the migrations themselves. After a little bit of digging it looks like something in the ubuntu container is causing the 'OutOrStderr' function call in the migrations inspect command to return the stderr instead of stdout which in turn causes the jq check in the migrations bash script to get an empty input instead of the JSON doc which in turn causes it to fail immediately. Changing the 'OutOrStderr' to 'OutOrStdout' ensures that the code will always output to stdout as expected or whatever is the out stream.

ptzianos commented 2 months ago

Raised an issue about the issue of reviewdog reporting errors in replaced lines: https://github.com/reviewdog/reviewdog/issues/1725