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
fixes #7666, #7667, #7668 - errata mail notifications #4780
Conversation
@@ -0,0 +1,37 @@ | |||
module Katello |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed this earlier, but we do tend to put copyright notices at the top of all of our files.
Updated to include all the mail notifications. Needs a review. Here's how they look: |
A couple notes:
|
color: #CCCCCC !important; | ||
} | ||
</style> | ||
<div style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #3f3f3f; background-color: #f1f1f1;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder about all of these inline styles and how they will affect the ability to easily change the styling of these emails in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're a bit stuck there, it's the only option for some very popular web mail providers (e.g. Gmail). We're lucky they're supporting CSS at all these days.
I did break some things out as partials, but even then, the styles are in-line on those tables too.
It could all be abstracted away to helpers or something, but the nature of e-mail notifications is that I don't expect the number of e-mail types to ever become more than a handful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, I'm fine with using helpers in the future if we ever need to change these or add more. Don't want to create a premature abstraction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could create variables with the common css attributes and use those variables when styling.
See: variable (https://github.com/theforeman/foreman/pull/1910/files#diff-4b17df40367067144fb027cc5533ecefR1)
usage: https://github.com/theforeman/foreman/pull/1910/files#diff-4b17df40367067144fb027cc5533ecefR7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah that looks nicer. At this point though, I want to get this in for the Katello 2.1 RC so will have to do it as a separate PR later.
[test] |
1 similar comment
[test] |
|
||
mail(:to => user.mail, | ||
:subject => _("Katello Host Advisory"), | ||
:date => Time.now) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Time.zone.now will respect the system's current timezone (see theforeman/foreman#1880)
Tested this out and it worked for me. I'll hold off on an ACK though as others still may have additional comments. |
ACK for me, my comments were addressed, I just couldn't ever get my testing to work. |
One small issue when syncing a new repo:
|
When I sync a repo pointed to a particular upstream repo, I get an email that shows the proper counts. However, if i create a 2nd repo pointed to the same upstream url and sync it, i get an email but it shows 0 new errata. |
|
||
<% all_errata = @content_hosts.authorized_as(@user, :view_content_hosts).map(&:available_errata).flatten.sort_by(&:id).uniq %> | ||
|
||
<%= (_("The promotion of %{content_view} to <b>%{environment}</b> has completed. %{count} errata are available to your hosts.") % |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might would say '%{count} needed errata are available to your host.'
@jlsherrill Is there an upstream repo smaller than EPEL that has errata? |
@jlsherrill Oh disregard, I found https://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/test_simple_errata/. I didn't realize they had more than zoo! |
@stbenjam i've been using mostly non-upstream repos such as resilient storage and the rhev-agent repos. Its hard to test errata with real freely available repos :/ I need to do a tad more testing with a client, will do that first thing in the morning. |
@jlsherrill Updated, thanks - this should fix the issues you raised:
|
By the way, the pulp repos with errata don't really work... the errata types on those are all marked as "enhancements" instead of "enhancement" |
#4851 needs to be merged for tests to pass again here. |
<table border="0" cellpadding="20" cellspacing="0" width="100%" id="emailFooter" style="background-color: #e1e2e3;" bgcolor="#e1e2e3"> | ||
<tr> | ||
<td align="left" valign="top" style="font-size: 82%; padding: 0px 20px;"> | ||
<p>Note: The number in parentheses reflects applicable errata from the Library environment. You will |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change:
Note: The number in parentheses reflects applicable errata from the Library environment.
to something like:
Note: The number in parentheses reflects applicable errata unavailable to the system but available from the synced content in Library.
ACK pending small wording change and jenkins |
No description provided.