Closed Bug 1073348 Opened 10 years ago Closed 10 years ago

[PulseGuardian] "Fake account" mode for local development

Categories

(Webtools :: Pulse, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mcote, Assigned: mcc.ricardo, Mentored)

References

Details

User Story

This is a mentored Pulse bug.  For general information on Pulse, see https://wiki.mozilla.org/Auto-tools/Projects/Pulse, which includes a section on Contributing.

Attachments

(1 file)

84 bytes, text/plain
mcote
: review-
mcote
: review-
mcote
: review+
mcote
: review+
Details
Working on PulseGuardian right now is annoying; you have to have Persona working correctly, and that in turn requires https, which means you have to click through warnings every time you restart.

There should be a command-line argument to web.py, say, --fake-account=<email>, which automatically logs you in with the given email address.  If this option is provided, it should probably also start in regular http mode (ssl_context=None).  We just need to override the session 'email' variable with whatever is provided to the command-line option, probably via a global variable in web.py and some sort of preprocessing function like load_user().
Mentor: mcote
User Story: (updated)
Hi Mark,

I've successfully setup a local dev environment. I'll be picking up this ticket and start working on it.

Ricardo
Hi Mark,

You can keep an eye on the development here: https://github.com/mccricardo/pulseguardian/compare/fake-account

Ricardo
Hi Mark,

I've got a working branch for this ticket. You can find the changes here: https://github.com/mccricardo/pulseguardian/compare/fake-account

I haven't submitted a pull request but if you prefer I can submit it. It might be easier for you to review the changes that way.

Ricardo
Great! Yeah, pull requests are good.  Just paste the URL as an attachment and set the review flag to me.  I'll take a look now, but this'll make it more official. :) And feel free to assign the bug to yourself and switch it to the ASSIGNED state.
One quick comment though--argparse was introduced in Python 2.7, so it's not going to work, sadly.  We'll have to go with optparse (annoying, I know).
Hey Mark,

I'm not able to assign the bug to myself and change that status. Is there something I need to do to be able to? Or some permission you need to give me?

I'll send you the pull request and we can start the review process :)

Regarding argparse, I did setup a new virtual env with Python 2.6 (2.6.9 if I'm not mistaken - I'm at work and I don't have my laptop with me; I'll confirm that later today). I was able to install argparse. Actually on PyPi (https://pypi.python.org/pypi/argparse) you can read: "For users who still need to support Python < 2.7 or < 3.2, it is also provided as a separate package, which tries to stay compatible with the module in the standard library, but also supports older Python versions."

We can switch to optparse. I'll get on it later toda :)

Ricardo
Attached file Pull request
Attachment #8510890 - Flags: review?(mcote)
Assignee: nobody → mcc.ricardo
Status: NEW → ASSIGNED
Ah sorry, I didn't realize there was an external argparse package!  I'm cool with that then. :)

As for permissions, I assumed you had editbugs privilege, which allows you to do such things to any bug (without those permissions, you can only change bugs for which you are the reporter or assignee, aside from comments, which anyone can leave), since you've fixed so many bugs already.  If you like, check out https://bugzilla.mozilla.org/page.cgi?id=get_permissions.html and apply for editbugs.

One other thing, when posting a GitHub pull-request URL as an attachment, if the attachment contains only the URL and no extra text, the attachment link will automatically redirect to the pull request.  Very handy. :) Don't worry about this one; just a note for the future.

Gave your patch a cursory look and it seems great.  I'll review it in detail soon.  In the meantime, feel free to look at other Pulse bugs!

Also please let me know if anything was unclear or could be improved in the docs, since you are one of a very small number of people who have set up a local Pulse dev environment.
Hi Mark,

Thank very much for the input. I've already applied and received "editbugs" permissions.

Nice "trick", the one with the Github pull-requests. I'll be sure to use it :)

I've seen that you already started the review. I'll wait until you're finished in order to review the code accordingly. In the meantime, I'm just completing an online course (on MongoDB) and I'm almost finished with the final exam. As soon as that's done, I'll start picking up more bugs.

I didn't have any serious troubles setting up the environment but I'll the docs a look and check if they can enhanced.
(In reply to Ricardo Castro from comment #9)
> Hi Mark,
> 
> Thank very much for the input. I've already applied and received "editbugs"
> permissions.
> 
> Nice "trick", the one with the Github pull-requests. I'll be sure to use it
> :)
> 
> I've seen that you already started the review. I'll wait until you're
> finished in order to review the code accordingly. In the meantime, I'm just
> completing an online course (on MongoDB) and I'm almost finished with the
> final exam. As soon as that's done, I'll start picking up more bugs.
> 
> I didn't have any serious troubles setting up the environment but I'll the
> docs a look and check if they can enhanced.

Correction:I've already applied and I'm waiting for the "editbugs" permissions.
Comment on attachment 8510890 [details]
Pull request

This looks good; all the requisite code is there, just needs a little tweaking.

I'm not sure what the usual way of doing reviews with GitHub-pull-request-urls is; I think you can maybe set this back to ? since I believe the URL itself won't change once you update the pull request.
Attachment #8510890 - Flags: review?(mcote) → review-
(In reply to Mark Côté [:mcote] from comment #11)
> Comment on attachment 8510890 [details]
> Pull request
> 
> This looks good; all the requisite code is there, just needs a little
> tweaking.
> 
> I'm not sure what the usual way of doing reviews with
> GitHub-pull-request-urls is; I think you can maybe set this back to ? since
> I believe the URL itself won't change once you update the pull request.

Hey Mark,

I updated the code following your review. The url won't change after I push the changes.
Attachment #8510890 - Flags: review?(mcote)
Comment on attachment 8510890 [details]
Pull request

Almost there!  A couple tiny nits, but more importantly, I forgot to mention that the README should be updated as well.  I want to make sure our docs are up to date for new contributors. :)
Attachment #8510890 - Flags: review?(mcote) → review-
Comment on attachment 8510890 [details]
Pull request

Updated :)
Attachment #8510890 - Flags: review?(mcote)
Comment on attachment 8510890 [details]
Pull request

The only comment is about improving the doc slightly, but I don't mind doing that myself on commit, unless you beat me to it.  Sorry for the nitpicking, but I've found that projects with many authors (as I hope this one will be!) get messy quickly unless at least some style guidelines are enforced. :)

Thanks very much for this patch.  The lack of this feature was slowly driving me crazy.
Attachment #8510890 - Flags: review?(mcote) → review+
Hi Mark,

It makes perfect sense. I'll get right on it.
Comment on attachment 8510890 [details]
Pull request

Hey Mark,

I added a new paragraph to the README. What do you think? Do you think some more information might be useful?
Attachment #8510890 - Flags: review?(mcote)
Comment on attachment 8510890 [details]
Pull request

Looks good!  I noticed a bit of trailing whitespace here and there, which didn't show up in the pull request diff for some reason, but I fixed that with another commit after merging your changes.

Thanks very much!
Attachment #8510890 - Flags: review?(mcote) → review+
Also wondering if you saw bug 1089390 when you were working on this.  It just started happening to me, before I merged in your changes; I'm not sure what's going on.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
I haven't, but I'll take a look. From your description it seems strange.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: