Plots2: rss feeds empty for banned users

Created on 17 Oct 2014  Â·  30Comments  Â·  Source: publiclab/plots2

Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.

If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!

If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!

The problem

The code for RSS exposes banned users, but blocks their research notes from the RSS feed. See these lines:
https://github.com/publiclab/plots2/blob/master/app/controllers/users_controller.rb#L154-L163

It'd be better if the banned user was treated as non-existent, as is done with the profile.

Solution

Modify @author = DrupalUsers.find_by_name params[:author] to include status. This can be done using this query

@author = DrupalUsers.find_by_name_and_status( params[:author], 1 )

Steps to Fix

  • [ ] claim this issue with a comment here, below, and ask any clarifying questions you need
  • [ ] set up a repository locally following the README instructions, and make sure that all tests pass
  • [ ] try to fix the issue following the steps above, but even before you're done, you can:
  • [ ] commit your changes and start a pull request (see contributing to Public Lab software) but mark it as "in progress" if you have questions or if you haven't finished
  • [ ] alert someone via the developers list (see below) to have your pull request merged. This may take a few extra steps depending on when you do it, but we'll help you out!

Please email the developers list (see https://publiclab.org/wiki/developers) if you have questions, and take a look at our first-timers landing page for more information!

Ruby first-timers-only help wanted

All 30 comments

I think it'd be using a User.where(status: 1, username: params[:author]) call!

I'd like to try to work on this!

That'd be great -- thank you and we're happy to help.

On Sun, Dec 18, 2016 at 11:40 AM, Flame Fractal notifications@github.com
wrote:

I'd like to work on this!

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/171#issuecomment-267831384,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ2DrTkadlmXxQzZe6vB-d-4JMtJbks5rJWHvgaJpZM4CwHX0
.

@FlameFractal If you don't mind can look at other first-timer issues not labelled with the gcin label. This will be made as an Google Code-in Task.

Sorry, didn't know that. It's just that all of the 9 issues currently in first-timers-only appeared to be claimed, albeit many of 'em not updated in a while, I didn't wanna barge in their progress!

Not a problem! Perhaps there's a first timers issue someone's been stuck on
to a while and could use another set of eyes on it?

On Dec 18, 2016 12:23 PM, "Flame Fractal" notifications@github.com wrote:

Sorry, didn't know that. It's just that all of the 9 issues currently in
first-timers-only
https://github.com/publiclab/plots2/labels/first-timers-only appeared
to be claimed, albeit not updated in a while, I didn't wanna barge in their
progress!

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/171#issuecomment-267833922,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ8CtyJbfZ3t7sCAcBIG-xe5C05geks5rJWwCgaJpZM4CwHX0
.

Uh there are some fto-candidate issues that you can see in the mean time. They are close to becoming first-timer issues. In fact they will be made first-timer issues soon.

Hi, @FlameFractal -- GCI has wrapped up and this one is still up for grabs -- we'd love to have your contribution here if you're still interested!

@jywarren Does this issue still need someone to look at it? I'd be happy to work on this over the next several days. Thanks!

It seems to still be open, please take a try!

On Feb 25, 2017 12:46 PM, "Jon Kimble" notifications@github.com wrote:

@jywarren https://github.com/jywarren Does this issue still need
someone to look at it? I'd be happy to work on this over the next several
days. Thanks!

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/171#issuecomment-282499834,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ8eJFsvprzs9PKcjdgvBkBqDzo8eks5rgGj3gaJpZM4CwHX0
.

@jywarren Awesome, I'm on it!

@jywarren Hi there, would be interested in taking this on. If it isn't otherwise claimed as in progress. Didn't see a PR up that matched. Thought I'd ask.

Yes please! Thank you!

On Mar 27, 2017 12:38 PM, "Jesse Shipley" notifications@github.com wrote:

@jywarren https://github.com/jywarren Hi there, would be interested in
taking this on. If it isn't otherwise claimed as in progress. Didn't see a
PR up that matched. Thought I'd ask.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/171#issuecomment-289510257,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ08ni0x9gesEk0EheSWLnlZwNyD9ks5rp-XogaJpZM4CwHX0
.

@jywarren got it all installed locally and ran tests, got one failure:
screen shot 2017-03-29 at 11 19 26 am

Is this something I should just press on from (known issue) or something that is broken on my side?
seems from the error message that its a fail based on expected order? Not 100% sure as I haven't completely dove in to the code base around it yet.

hi sorry for being late i want to apply for gsoc and looking for first time bug is there any ? which i can take?

Hey, thank you for the email. I am excited to get started with Open Source. I am a student at the Turing School of Software & Design, and have been learning back end Rails apps for the last 6 months. I dove into the code base and see how the author .find_by_id and status is used in the users controller. I see that rss is a separate route, but a little foggy on implementing the rss to ignore a banned user, as the users controller already doesn’t parse their notes. Is this a change that should live in the users controller, users model, or somewhere in the rss service?

Haha, sorry for all of my questions out of the gate, pretty excited to get started on a preexisting app.

Thanks,

Jesse

On Mar 30, 2017, at 2:38 PM, ankit notifications@github.com wrote:

hi sorry for being late i want to apply for gsoc and looking for first time bug is there any ? which i can take?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/171#issuecomment-290537701, or mute the thread https://github.com/notifications/unsubscribe-auth/ALdxssiowExlrzD9U5Ove0JTfxlgkMnMks5rrBLLgaJpZM4CwHX0.

Hi, Jesse, it does look like an ordering issue. I wonder if it's related to
timestamps, perhaps? Does it happen every time you run tests?

We may be able to ignore it if it does not happen on tests on our TravisCI
testing service once you submit a commit, but we should probably pin down
the problem anyways.

As to where to screen for banned users, I believe RSS feeds are assembled
in the feeds controller. We can likely add a filter for user status to the
activerecord queries there. I'm happy to offer more help if you need!

Ankit, please check out our welcome page at
http://github.com/publiclab/plots2/projects/2, we're happy to have you help!

On Mar 30, 2017 10:18 PM, "Jesse Shipley" notifications@github.com wrote:

Hey, thank you for the email. I am excited to get started with Open
Source. I am a student at the Turing School of Software & Design, and have
been learning back end Rails apps for the last 6 months. I dove into the
code base and see how the author .find_by_id and status is used in the
users controller. I see that rss is a separate route, but a little foggy on
implementing the rss to ignore a banned user, as the users controller
already doesn’t parse their notes. Is this a change that should live in the
users controller, users model, or somewhere in the rss service?

Haha, sorry for all of my questions out of the gate, pretty excited to get
started on a preexisting app.

Thanks,

Jesse

On Mar 30, 2017, at 2:38 PM, ankit notifications@github.com wrote:

hi sorry for being late i want to apply for gsoc and looking for first
time bug is there any ? which i can take?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <
https://github.com/publiclab/plots2/issues/171#issuecomment-290537701>,
or mute the thread ALdxssiowExlrzD9U5Ove0JTfxlgkMnMks5rrBLLgaJpZM4CwHX0>.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/171#issuecomment-290605051,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJwfG-XIYUykzpkY9s9e9HK-ZGixZks5rrHCFgaJpZM4CwHX0
.

@jywarren Yeah same fail on each run. I will look past it and work on the RSS card, and like you said let Travis and his all seeing-ness catch it, if its actually an issue.

@jywarren Also one more question. Is there a possible banned user that I can try and send a request to /feed/:author to see what the current response is. And I am assuming that the desired response is just 404 if specified author has been banned? like it/they never existed?

thanks again.

Hi, thanks -- looks like Travis doesn't care, so maybe we should open a separate issue. It is odd though! The test is here: https://github.com/publiclab/plots2/blob/master/test/functional/tag_controller_test.rb#L117 and maybe there's something to do with sqlite ordering... sometimes these kinds of failures can be quite subtle.

Anyhow I see your changes at #1361 -- thanks! I think a 404 would be perfect. Do you think this behavior merits a test, perhaps in https://github.com/publiclab/plots2/blob/master/test/functional/users_controller_test.rb ? Note that we haven't been testing for user rss feeds, but it'd be pretty easy to write one for the basic feed and then one for a banned user (see the fixtures -- we have one, I'm sure). Would you mind giving that a try?

Thanks so much for your PR!

And if you haven't written tests before, i'm happy to help you out with that too!

Yeah, of course I'll write a couple tests. Better late than never!

On Sun, Apr 2, 2017, 6:31 PM Jeffrey Warren notifications@github.com
wrote:

And if you haven't written tests before, i'm happy to help you out with
that too!

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/171#issuecomment-291026320,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALdxsvVX4Gkf1PIGD8R2UaKmfsSnGHYYks5rsD3hgaJpZM4CwHX0
.

@jywarren Hey sorry for the lack of progress. Jumping into those tests now, had a chance to look into the fixtures files.. don't see any reason I can't write a few tests for this specific thing.

OK, no problem, i just left some comments on your pull request!

@jywarren, please may I know if this is still open or @Sh1pley has delivered on the test and implementation?

Hi, @Sh1pley - what do you think? good start over at https://github.com/publiclab/plots2/pull/1361 -- any chance to wrap it up, and can we help you out? Or could @DoReMiFaSoLaTiDo pick up where you left off?

Thanks!

@jywarren I can also jump in, if you need me! ta

Yes, thanks -- really, at this point anyone who wants may give it a try -- but please try to use #1361 as a starting-off point! Much appreciated!

Hi, folks - has anyone made some more progress on this one? I'd be happy to help out.

Also we just posted a new first-timers-only issue -- will start posting new ones regularly now: https://github.com/publiclab/plots2/projects/2

Was this page helpful?
0 / 5 - 0 ratings

Related issues

first-timers[bot] picture first-timers[bot]  Â·  3Comments

grvsachdeva picture grvsachdeva  Â·  3Comments

keshavsethi picture keshavsethi  Â·  3Comments

RuthNjeri picture RuthNjeri  Â·  3Comments

milaaraujo picture milaaraujo  Â·  3Comments