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

fixes #7666, #7667, #7668 - errata mail notifications #4780

Merged
merged 3 commits into from Dec 8, 2014
Merged

fixes #7666, #7667, #7668 - errata mail notifications #4780

merged 3 commits into from Dec 8, 2014

Conversation

stbenjam
Copy link
Contributor

No description provided.

@@ -0,0 +1,37 @@
module Katello
Copy link
Member

Choose a reason for hiding this comment

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

Tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

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.

@stbenjam stbenjam changed the title fixes #7668 - errata summary mail fixes #7666, #7668 - errata notifications for hosts and repo sync Nov 10, 2014
@stbenjam
Copy link
Contributor Author

Updated to include all the mail notifications. Needs a review.

Here's how they look:
http://imgur.com/a/6IaqT

@stbenjam stbenjam changed the title fixes #7666, #7668 - errata notifications for hosts and repo sync fixes #7666, #7667, #7668 - errata mail notifications Nov 11, 2014
@stbenjam
Copy link
Contributor Author

A couple notes:

color: #CCCCCC !important;
}
</style>
<div style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #3f3f3f; background-color: #f1f1f1;">
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

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.

@stbenjam
Copy link
Contributor Author

[test]

1 similar comment
@stbenjam
Copy link
Contributor Author

[test]


mail(:to => user.mail,
:subject => _("Katello Host Advisory"),
:date => Time.now)
Copy link
Contributor

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)

@waldenraines
Copy link
Contributor

Tested this out and it worked for me. I'll hold off on an ACK though as others still may have additional comments.

@ehelms
Copy link
Member

ehelms commented Dec 2, 2014

ACK for me, my comments were addressed, I just couldn't ever get my testing to work.

@jlsherrill
Copy link
Member

One small issue when syncing a new repo:

NoMethodError: undefined method `updated_at' for nil:NilClass
Backtrace:
/home/jlsherri/git/katello/app/lib/actions/katello/repository/errata_mail.rb:19:in `plan'
/home/jlsherri/.rvm/gems/ruby-1.9.3-p448/gems/dynflow-0.7.5/lib/dynflow/action.rb:411:in `block (3 levels) in execute_plan'
/home/jlsherri/.rvm/gems/ruby-1.9.3-p448/gems/dynflow-0.7.5/lib/dynflow/middleware/stack.rb:26:in `call'
/home/jlsherri/.rvm/gems/ruby-1.9.3-p448/gems/dynflow-0.7.5/lib/dynflow/middleware/stack.rb:26:in `pass'
/home/jlsherri/.rvm/gems/ruby-1.9.3-p448/gems/dynflow-0.7.5/lib/dynflow/middleware.rb:16:in `pass'

@jlsherrill
Copy link
Member

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.") %
Copy link
Member

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.'

@stbenjam
Copy link
Contributor Author

stbenjam commented Dec 2, 2014

@jlsherrill Is there an upstream repo smaller than EPEL that has errata?

@stbenjam
Copy link
Contributor Author

stbenjam commented Dec 2, 2014

@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!

@jlsherrill
Copy link
Member

@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.

@stbenjam
Copy link
Contributor Author

stbenjam commented Dec 4, 2014

@jlsherrill Updated, thanks - this should fix the issues you raised:

  • Use Time.now for calculating errata for repos w/out any (e.g. new repos)
  • Repo errata is calculated based on the join table, to cover the multiple copies case

@stbenjam
Copy link
Contributor Author

stbenjam commented Dec 4, 2014

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"

@stbenjam
Copy link
Contributor Author

stbenjam commented Dec 8, 2014

#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
Copy link
Member

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.

@jlsherrill
Copy link
Member

ACK pending small wording change and jenkins

stbenjam added a commit that referenced this pull request Dec 8, 2014
fixes #7666, #7667, #7668 - errata mail notifications
@stbenjam stbenjam merged commit da77ba3 into Katello:master Dec 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants