New smart API to list issues
~Based on #2530~ (merged)
Closes #2533
All issues that are not returned as known/closed/unresolved can be considered as new.
I noticed the same combination of (analyzer, level, check, message) may be reported multiple times per file, which would lead to inconsistent returned values. For example, a new issues could be reported as known (if a similar issue is known on this file) or an issue could be returned as both unresolved and closed (in case there are multiple similar issues on a file, and only one has been closed).
I think we should keep this endpoint KISS, and handle such edge cases in the bot.
You will also need to serialize the previous_diff_id when applicable (on unresolved & closed issues).
This does not invalidate the fact that a 400 should be raised when it's not present in these cases