Let's tollerate invalid gating.yaml files when they have: * malformed yaml syntax * RemoteRule inside the gating.yaml ...just skip the check and log a warning.
This is the first part of code for this issue: https://pagure.io/greenwave/issue/221 The second part will be to return a synthetic result with the information of what did wrong.
I wrote the test really quickly, but I tested also manually, so it should be fine. Please let me know if you notice more strange cases.
Invalid gating.yaml should be treated as failed test.
gating.yaml
Throwing an exception looks much better.
But that's exactly the point of the PR... That we shouldn't throw an exception, but just give a warning and continue
Oh, I thought, the point was to get proper error handling when the file is invalid.
Anyway, here, raising an exception makes more sense than returning a -1 or None.
It is about handling the error, but also about the fact that if there is an error you don't have a way to "waive" that error. Anyhow I wrote everything in the issue: https://pagure.io/greenwave/issue/221
I also didn't like very much to return -1... I guess I can throw a different exception than the others (RuntimeError) and catch it outside this function where it is called.
rebased onto aadab3c8792cee8b640723edc0be813607ccbce6
rebased onto f71613976fc406250c38cfe5153e7335f50383d9
1 new commit added
Add a fake result to inform the user of an error
rebased onto d63b0ed2bc8fde1b97659a728dfb7279531fb142
I've added a commit with all the necessary changes as a secondo commit. I have some conflicts... but I'll fix them tomorrow.
Pull-Request has been closed by gnaponie
Closing this one since we decided for a different approach: https://pagure.io/greenwave/issue/221#comment-517716
Let's tollerate invalid gating.yaml files when they have:
* malformed yaml syntax
* RemoteRule inside the gating.yaml
...just skip the check and log a warning.