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

Use msg2long_form api for bodhi backend stuff #96

Closed
ralphbean opened this issue Jun 5, 2014 · 9 comments · Fixed by #251
Closed

Use msg2long_form api for bodhi backend stuff #96

ralphbean opened this issue Jun 5, 2014 · 9 comments · Fixed by #251

Comments

@ralphbean
Copy link
Contributor

We would use it for bodhi when the masher finishes in order to generate a big templated email.

We could use mako templates for it behind the scenes.

@ralphbean
Copy link
Contributor Author

Here's an example of what bodhi needs sent: https://github.com/fedora-infra/bodhi/blob/master/bodhi/mail.py#L273

ralphbean added a commit to fedora-infra/fedmsg that referenced this issue Sep 17, 2014
This will eventually be used by bodhi and FMN to send out bigger, more
informative blocks of text.

For fedora-infra/fedmsg_meta_fedora_infrastructure#96
@ralphbean
Copy link
Contributor Author

Noting here that we now have the msg2long_form API and we use it many different places (git commits, github events, koji builds, copr builds, etc..).

But we still need to do the implementation of producing those long bits of text for the bodhi backend process.

@ralphbean ralphbean changed the title Add a msg2long_form api call User msg2long_form api for bodhi backend stuff Mar 8, 2015
@ralphbean ralphbean changed the title User msg2long_form api for bodhi backend stuff Use msg2long_form api for bodhi backend stuff Mar 8, 2015
@codenamesubho
Copy link
Contributor

@ralphbean , i would like to work on this.
msg2long_form returns a unicode string. I assume the usage would be similar to fmn
https://github.com/fedora-infra/fmn.consumer/blob/95b06b47d0ce33794ef034f44316f26bb78c1e03/fmn/consumer/backends/mail.py#L100

And the line to replace would be
https://github.com/fedora-infra/bodhi/blob/master/bodhi/mail.py#L426

Let me know if i am going wrong.

@ralphbean
Copy link
Contributor Author

Yeah! We never quite figured out how this was supposed to work with bodhi2.

There were two options we were tossing around, if I remember correctly:

  • Have the template for the big message live in the code in this repo, and fill in the template with details from the bodhi message when it arrives.
  • Have the template live in the bodhi code, have bodhi fill out the template with all the details, and then stuff the finished string into the fedmsg message. The long_form code in fedmsg meta would just extra that giant string from the message and return it.

@lmacken, do you have an opinion either way on this one?

@lmacken
Copy link
Contributor

lmacken commented Mar 24, 2015

So in bodhi2 I basically ported the old mail module over for the update announcement emails that go to the package-announce-list. These are big templates that require a bunch of koji calls to generate, and that doesn't seem like something we want to do in the meta package.

https://github.com/fedora-infra/bodhi/blob/pyramid/bodhi/mail.py

I'm open to migrating some of those misc messages over to meta/FMN somehow.

@codenamesubho
Copy link
Contributor

@ralphbean , so i guess the method 2 is what we will be implementing. In that case please guide me on how i should go ahead with this fix .

@ralphbean
Copy link
Contributor Author

@ghost-script would you feel comfortable getting into some of the bodhi2 code? It seems like those templates are going to need to be filled out with data from koji calls and then sent along with the data in the fedmsg.publish(...) call from bodhi. fedmsg_meta can then just extract those whole strings and return them.

@codenamesubho
Copy link
Contributor

@ralphbean , i am comfortable with working with bodhi2 code. So in that case we need to implement msg2long_form api to fill the email templates with the data then push it into fedmsg.

@ralphbean
Copy link
Contributor Author

Not quite. I don't think it will actually make any use of the long_form or msg2* stuff on the bodhi2 side of things. I think it'll just be cut-and-dry python there.

i.e. this big template will need to be filled in and stuffed into the fedmsg messages that get published from there: https://github.com/fedora-infra/bodhi/blob/pyramid/bodhi/mail.py#L237

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

Successfully merging a pull request may close this issue.

3 participants