MBS is generating build logs to upload them to Koji when module build is successfully done. In case the module build fails, there is no way to include the build log to Koji - Koji content generator cannot generate failed build.
This new "module-build-logs" endpoint allows people to access the build log of any module build - even the failed one. This is especially useful for MBS admins, because they don't have to login the machine to check the journalctl or other logging backend and search there for all log messages related to particular build. Instead, they can just query MBS to get the build log relevant to the module build.
Since the failed build logs are not by default stored permanently, they can be removed after some time by cron or other service (Although we are not doing that right now). Therefore this does not have to return the log in all cases, but there is very big change that for some time after the module build fail, the log will be available via MBS API.
I am thinking of streaming approach instead of just
.read()
. What do you think? See: http://flask.pocoo.org/docs/0.12/patterns/streaming/