Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Announce message notifications via fedmsg #253

Closed

Conversation

jeremycline
Copy link
Member

Send a notification of the notification we're about to send via fedmsg.
Make sure the consumer does not try to process that notification.

@abompard I thought I'd just put this up and we could talk about the details of what you need on the PR. I was thinking about implementing a simple formatter for the message so it would arrive on your end as human-readable, but I thought you might want to control that so maybe it makes sense to just resend the original fedmsg. Also, I don't know whether the message topic should be "notification.{user}.{context}" or "notification.{context}.{user}" - the first lets you subscribe to all contexts for a user, or all contexts for all users, while the second lets you subscribe to all users for a context, or all contexts for all users.

@abompard
Copy link
Member

abompard commented Nov 9, 2017

For Hubs I'll just listen to all context for all users, I think, so it doesn't matter. However outside of Hubs it feels like the most common use case would be to subscribe to all contexts for a user, so {user}.{context} feels like a better approach.

Do you have examples of messages with and without the simple formatter?

@jeremycline
Copy link
Member Author

The un-formatted message would just be a fedmsg with {'original_message': whatever_the_original_fedmsg_was}. The formatted message would be that, with the message run through fedmsg.meta.msg2title and fedmsg.meta.msg2subtitle. You'd also be able to do that on the Hubs end and it would let you easily adjust the format if necessary.

@abompard
Copy link
Member

Let's keep the original message then, thanks!

Send a notification of the notification we're about to send via fedmsg.
Make sure the consumer does not try to process that notification.

Signed-off-by: Jeremy Cline <jeremy@jcline.org>
@codecov
Copy link

codecov bot commented Nov 10, 2017

Codecov Report

Merging #253 into develop will increase coverage by 0.08%.
The diff coverage is 71.42%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #253      +/-   ##
===========================================
+ Coverage    55.23%   55.32%   +0.08%     
===========================================
  Files           72       72              
  Lines         3760     3767       +7     
  Branches       495      496       +1     
===========================================
+ Hits          2077     2084       +7     
+ Misses        1606     1605       -1     
- Partials        77       78       +1
Impacted Files Coverage Δ
fmn/consumer.py 63.21% <0%> (-1.49%) ⬇️
fmn/tasks.py 75% <100%> (+2.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 86e337e...f5da020. Read the comment docs.

@jeremycline jeremycline changed the title [WIP] Announce message notifications via fedmsg Announce message notifications via fedmsg Nov 10, 2017
if 'fmn.notification' in topic:
# This is a notification of a notification we've sent. Processing it
# would lead to a positive feedback loop.
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this unit-tested? I think it should be, it's pretty important.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely agree. Sorry for the slow response, I got caught up in a bunch of other stuff. After I get the next round of FMN bugfixes in and deployed, I'll write tests for this and get it in 2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants