-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
digest email initial functionality #2711
Conversation
Generated by 🚫 Danger |
@ViditChitkara Which part of #2104 are you working? |
@jywarren as discussed, I added a simple list of subscribed content to the email content. It would be great, if you could review the code. |
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.
This looks great. Let's try merging it when it's ready (just ping me!) and then we can subscribe ourselves to see how it works!
app/jobs/digest_mail_job.rb
Outdated
class DigestMailJob < ActiveJob::Base | ||
queue_as :default | ||
|
||
def perform(*args) |
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.
This looks cool but could you add an inline comment explaining a little more about what it does? Thanks!!
@@ -377,6 +377,11 @@ def social_link(site) | |||
nil | |||
end | |||
|
|||
def send_digest_email | |||
top_picks = self.content_followed_in_period(Time.now - 1.week, 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.
Ooh cool! @StlMaris123 check out this being used!!!
Can you also share a screenshot of what it looks like now, in this PR? Thank you very much!!! |
Are there any CodeClimate recommendations you'd like to adjust as well? 👍 👍 👍 |
Sure I'll do!! |
For testing this out, we would require resque gem for asynchronous testing. However, if no. of users are limited we could create a rake task and test it out on test servers or something. Creating another pr for resque integration. |
I hope this looks good to be merged. What do you say? |
Working on #2738 for adding resque as queuing backend. |
Great can you add the rescue change to this PR so they can be merged
together? With both merged, should it work or do we need extra
configuration from @icarito?
…On Mon, May 21, 2018, 3:37 PM Vidit ***@***.***> wrote:
Working on #2738 <#2738> for
adding resque as queuing backend.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2711 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ_WmaZIWnACSHSPoVC90cNRvPvYMks5t0xdagaJpZM4T6X2X>
.
|
Maybe we would require some redis related configs on our server(don't
exactly how that would be done). Maybe @icarito would be able to describe
the exact requirements.
|
@jywarren should I add resque changes here or should we merge them separately?? We can do it either ways and also, should we switch to sidekiq? |
Hi, we need the Redis service for this to work. Fortunately this can be setup directly from the docker-compose.yml file. I gave instructions on #2738 |
67bc0b7
to
8ea2446
Compare
travis is running fine here!! |
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.
Let's add a test here before merging please? Even something simple.
What will trigger the digest sending? At this point it'll be if you have the right user tag right? Can you annotate in this PR description what exact user tag is needed to test it? Thanks!!!
Gemfile.lock
Outdated
@@ -218,7 +218,6 @@ GEM | |||
mini_portile2 (~> 2.3.0) | |||
nokogumbo (1.5.0) | |||
nokogiri | |||
oauth (0.5.4) |
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.
Hmm I think this needs to be reversed to not affect oath work?
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.
Woah!! Don't know where it came from!! I'll remove gemfile.lock related changes.
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.
For triggering, can we give a button or something which would be visible only to admins and moderators?
adding tests!! |
@jywarren written the tests and added a button to profile page for testing out. |
Wow awesome! Ready to merge then?
…On Sat, Jun 2, 2018, 1:13 PM Vidit ***@***.***> wrote:
@jywarren <https://github.com/jywarren> written the tests and added a
button to profile page for testing out.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2711 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ-AGYOVsWEFGC8S7ZsjwqMgp8efVks5t4uO6gaJpZM4T6X2X>
.
|
Yes |
Oh weird. Can you check the tests and see if you can correct them? |
Dangerfile
Outdated
@@ -61,5 +61,4 @@ begin | |||
|
|||
rescue => ex | |||
fail "There was an error with Danger bot's Junit parsing: #{ex.message}" | |||
puts ex.inspect # view the entire error output in the log | |||
end |
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.
It didn't like that line? I had that in there so we can read anything that goes wrong ... Is there another way to be able to read the output?
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.
yeah, it says that puts statement should not be included in dangerfile.
Even, that doesn't solve the problem. Now it says:-
Your Dangerfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.
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.
Should we ignore this error for now and let's put the puts line back??
Ah is that actually an error though? I thought it was only a warning. It's
complaining about using separate open and close quotes instead of basic
symmetric quotes.
…On Sat, Jun 2, 2018, 3:07 PM Vidit ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Dangerfile
<#2711 (comment)>:
> @@ -61,5 +61,4 @@ begin
rescue => ex
fail "There was an error with Danger bot's Junit parsing: #{ex.message}"
- puts ex.inspect # view the entire error output in the log
end
yeah, it says that puts statement should not be included in dangerfile.
Even, that doesn't solve the problem. Now it says:-
Your Dangerfile has had smart quotes sanitised. To avoid issues in the
future, you should not use TextEdit for editing it. If you are not using
TextEdit, you should turn off smart quotes in your editor of choice.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2711 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABfJxn3hzq21Y4_4EIuLq4ZqlZBg3FOks5t4v5UgaJpZM4T6X2X>
.
|
4792ebc
to
b44bec3
Compare
yep!! Let's see how to fix this!! |
It seems its due to the Plotsbot trying to print the message. see this https://api.github.com/repos/publiclab/plots2/issues/comments/388153818 . |
OH, hm. That's weird, it's the same old
|
OK - i made |
er, @PublicLabBot |
Also, if there are any changes you want to incorporate from CodeClimate suggestions, go for it, otherwise we can just "approve" that. Thanks! |
Followed code-climate suggestions and cool travis works again!! |
Great work @ViditChitkara !!!!! Thanks everyone for pitching in 🤝 🙌 |
Thanks a lot, everyone for helping out on this!! 😄 👍 |
Testing this now! Hm, I got a 500 error --
I wonder what happened? We can check the logs. |
I also added my own profile tag of digest:weekly |
OK -- error is:
If you'd like to open an issue to track and solve this, please do! |
Yeah, my reading of this is that according to plots2/config/initializers/sidekiq.rb Line 1 in 539229b
redis . So the URL should be in the JOB_WORKER_URL environment variable and it should be something like redis://redis
|
I'm thinking now that we are configuring the application with environment variables we should have a good practice of naming these env variables because we could have some confusion. So the appropriate name for this environment variable would be REDIS_URL, I think. Thanks for working on this! 😃 |
* digest email initial functionality * minor changes * changes in digest email design * added job for digest mailer * codeclimate fixes * minor change * minor change * minor change * minor change * minor change * removed gemfile.lock related changes * written tests * removed puts from dangerfile * minor changes * code-climate fixes * more code-climate fixes * minor changes
closes #2694
part of #2104
A test digest button will be given in the user profile, only the user's with tag 'digest-weekly' would be getting the mails. (All the digest-weekly users will get the mails at once).