Add the --query argument to fedmsg-tail #226

Merged
merged 8 commits into from Feb 25, 2014

Projects

None yet

3 participants

@pypingou
Member

No description provided.

@ralphbean
Collaborator

I think this error message doesn't quite fit. d is not a config dict.. I think it is the message. So "Key %s not found in message" might be a better message.

Member

true there, wrong copy/paste from fedmsg-config, sorry

@ralphbean
Collaborator

RFE: Right now this accepts one argument like fedmsg-tail --query msg.commit.author.

Can it be enhanced to handle a comma separated list of queries? fedmsg-tail --query timestamp,topic,msg.agent,msg.commit.author?

@olasd
olasd commented Feb 24, 2014

I think it would be a good idea to put the query language in a common module (probably fedmsg.utils) so that both locations that use it share the same query language, and the same enhancements/bugfixes.

@pypingou
Member

Updated, putting it on fedmsg.utils is a good idea but I'm not confident enough to do the change w/o internet connection, so either we wait for tomorrow or I'll do another pull-request :)

@pypingou
Member

Finally got it working:

$ fedmsg-tail --query=topic,msg.agent,msg.commit.username,msg.owner
[2014-02-25 11:30:30][    fedmsg    INFO] 
org.fedoraproject.prod.buildsys.build.state.change
rathann
[2014-02-25 11:30:32][    fedmsg    INFO] 
org.fedoraproject.prod.buildsys.repo.init
[2014-02-25 11:30:37][    fedmsg    INFO] 
org.fedoraproject.prod.buildsys.tag
rathann
@ralphbean
Collaborator

Looks good to me. @pypingou, do you want to take on @olasd's comment about sharing this code between fedmsg-tail and fedmsg-config?

@pypingou
Member

@ralphbean in a way yes, on the other they now share very little code, fedmsg-config does not have the iterative function. What do you think?

ralphbean added some commits Feb 20, 2014
@ralphbean ralphbean Handle dates too.
fedmsg.encoding can handle encoding datetime objects and time structs.

This allows it to handle datetime.date objects too.
212f5f3
@ralphbean ralphbean 0.7.6 d9ceaec
@ralphbean ralphbean Combine the dict_query from fedmsg-config and fedmsg-tail into the sa…
…me function.
efd8d24
@ralphbean
Collaborator

on the other they now share very little code, fedmsg-config does not have the iterative function. What do you think?

I put forward a proposal in #227.

@ralphbean
Collaborator

I'm assuming the 👍 from #227 carries over here, no?

@ralphbean ralphbean merged commit aaf3362 into develop Feb 25, 2014

1 check was pending

Details default The Travis CI build is in progress
@ralphbean ralphbean deleted the feature/fedmsg-tail-query branch Feb 25, 2014
@pypingou
Member

I would not 👍 my own request ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment