Open lsandov1 opened 8 years ago
'url' and 'log' fields are redundant, but because they are all optional, it doesn't really matter. The user can decide what they want to do for their test results, either link to the logs, which can be a link to a complex system, or upload a log file, or both if that makes any sense for that project.
Other observations:
You're missing the file name then. If using pure JSON, the log file object should probably look like:
'log_file': { 'name': 'the-file-name.txt', content: 'XXXXX' }
Log coming from tests should be store into DB
Ideas
The system should be able to store the logs coming from the tests done for specific series. There are two possible ways to do this
Adding another field in the JSON POST request
POST /api/1.0/series/47/test-results/ HTTP/1.1
{ "test_name": "checkpatch.pl", "state": "success", "url": "", "summary": "total: 0 errors, 0 warnings, 10 lines checked" "log": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" }
Allowing another post route to accept the following request
POST /api/1.0/series/47/test-results/log HTTP/1.1
{ "log": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" }
Option 1 looks a bit redundant to have two fields (url and log) containing the same content. Option 2 is perhaps cleaner but users needs to do a second request, affecting the user experience and perhaps hitting the server performance.
Some related questions: can users post a log of any side? should log be stored into the DB, or just in the filesystem and server just need to store the filename?
Refefences