#159 Add a --get parameter to search if there are waivers
Closed by ralph. Opened by pingou.
pingou/waiverdb get_waivers  into  master

Download 159.patch

This is far from ideal, the current implementation basically does not allow
having multiple actions on the same script, we cannot do things like:
waiverdb-cli new
waiverdb-cli get
waiverdb-cli delete
...
without breaking backward compatibility.

So in order to get the functionality for retrieving waivers, I have added a
--get parameter which allows, using the same syntax to either set or get
waivers against the specified subject.
It's not ideal, but from my testing it does work as expected.

We may consider refactoring this one day, but it is not a priority for the
moment.

Fixes https://pagure.io/waiverdb/issue/152

Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

@gnaponie, can you provide review on this one?

@ralph yes, I'll put some comment before the end of the day

"Comment" can be "None" and in that case it will print something like:
Waiver from user, created on 2018-04-18T13:21:54.842490 for: None

So maybe we can print the comment only if is not None.

Can you put some test? Something similar to this:
https://paste.fedoraproject.org/paste/YDoUvwRbs5ef-qLfneL8Qw

It would be cool also a test that creates a waiver and then checks that the waiver-cli --get is returning the "1 waiver found" or so.

I think we could add subcommands create and list, and then for backwards compatibility if no subcommand is given, treat it like create. If someone wants to tackle a patch for that :-) There is no ambiguity in the parsing because it doesn't currently accept any positional arguments.

Hmm, I thought we enforced that the comment was non-empty on the server side?

@dcallagh sounds nice, let's see if we can do this with click though :s

No, we don't...
Example:

waiverdb-cli -t dist.rpmdeplint -s '{"item": "qclib-1.3.1-3.fc28", "type": "koji_build"}' -p "fedora-28"
Created waiver 20 for result with subject {"item": "qclib-1.3.1-3.fc28", "type": "koji_build"} and testcase dist.rpmdeplint

Also in the API. We can change it.

edit: https://pagure.io/waiverdb/pull-request/167

How open would you be in dropping click for basic argparse? If so I'll see if I can get argparse to work, because so far not much luck with click

I like Click, but if argparse gets the job done then it's fine too.

@pingou, I'm going to close this one for now to get it out of the review queue. Can you resubmit when you have cycles to circle back on it?

Pull-Request has been closed by ralph

Sure will do, note that the current PR was working afaik, the rework is about getting it in a better shape only.

Build 0bf26a56be48323c4f2c6c15b02793eabc9c98da FAILED!
Rebase or make new commits to rebuild.

Metadata