Merge lp://staging/~mbp/launchpad/798412-plusone into lp://staging/launchpad

Proposed by Martin Pool
Status: Rejected
Rejected by: Robert Collins
Proposed branch: lp://staging/~mbp/launchpad/798412-plusone
Merge into: lp://staging/launchpad
Diff against target: 584 lines (+203/-35)
22 files modified
lib/canonical/launchpad/webapp/publisher.py (+11/-0)
lib/lp/answers/stories/question-workflow.txt (+8/-3)
lib/lp/answers/templates/question-index.pt (+7/-1)
lib/lp/answers/templates/questionmessage-display.pt (+22/-4)
lib/lp/app/templates/base-layout-macros.pt (+26/-0)
lib/lp/app/templates/base-layout.pt (+15/-0)
lib/lp/blueprints/browser/specification.py (+4/-0)
lib/lp/blueprints/templates/specification-index.pt (+2/-0)
lib/lp/bugs/browser/bugcomment.py (+4/-0)
lib/lp/bugs/templates/bugcomment-box.pt (+18/-7)
lib/lp/bugs/templates/bugcomment-index.pt (+1/-1)
lib/lp/bugs/templates/bugtask-index.pt (+7/-2)
lib/lp/code/browser/branchmergeproposal.py (+6/-1)
lib/lp/code/stories/branches/xx-code-review-comments.txt (+3/-3)
lib/lp/code/templates/branchmergeproposal-index.pt (+6/-0)
lib/lp/code/templates/codereviewcomment-body.pt (+6/-4)
lib/lp/code/templates/codereviewcomment-header.pt (+25/-2)
lib/lp/registry/templates/distribution-index.pt (+6/-2)
lib/lp/registry/templates/product-index.pt (+4/-2)
lib/lp/services/comments/templates/comment.pt (+5/-1)
lib/lp/services/features/flags.py (+6/-0)
lib/lp/soyuz/templates/archive-index.pt (+11/-2)
To merge this branch: bzr merge lp://staging/~mbp/launchpad/798412-plusone
Reviewer Review Type Date Requested Status
Robert Collins (community) Disapprove
Review via email: mp+83449@code.staging.launchpad.net

Description of the change

This adds some Google Plus +1 buttons on various interesting objects in Launchpad: archive, product, distro, mp, bug, bug comment, answer, specs.

This could be very usefully extended to comments on bmps and answers, but the object needs to have a URL of its own and those don't yet.

We shouldn't add them to every single page, but mostly to things people are likely to express approval of or interest in. I added them on things I already see people sharing, and on things I feel like sharing myself.

There is a feature flag to turn this off. It defaults to on. We might eventually want a per-user opt-out, but people who feel strongly about not having this probably have a browser configuration to get that already.

There are no specific tests for it (yet). I think the most interesting test is really whether it works with the external systems.

I would like to also add this on bmp comments and answer comments, but the object has to have its own url and I think those don't yet.

I don't show the button on private objects, to prevent people accidentally sharing them, and (questionable) to prevent Google seeing the URL exists. This would be cleaner if there was a consistent .private on eg LaunchpadView. I might add one.

Possibly the button should be moved to a TAL macro.

To post a comment you must log in.
Revision history for this message
Aaron Bentley (abentley) wrote :
Revision history for this message
Curtis Hovey (sinzui) wrote :

Questions comments do have a URL, but we have not registered a view to format them for the browser.
The URL is /<project>/+question/<question-id>/messages/<question-number> such as /launchpad/+question/168463/messages/1.

Revision history for this message
Martin Pool (mbp) wrote :

thanks guys, I will see about adding that.

Revision history for this message
Martin Pool (mbp) wrote :

https://answers.launchpad.net/launchpad/+question/168463/messages/1 is 404 even though there is a first message on that question.

I can see zcml that tries to set it up...

Revision history for this message
Martin Pool (mbp) wrote :

> Questions comments do have a URL, but we have not registered a view to format
> them for the browser.
> The URL is /<project>/+question/<question-id>/messages/<question-number> such
> as /launchpad/+question/168463/messages/1.

I had a go at trying to enable them, but I can't work it out :-(

Revision history for this message
Martin Pool (mbp) wrote :

Ok, the updates here add buttons on merge proposals, though not yet on answers, and factor some of it out into macros used across various pages.

This doesn't yet add or update tests. It probably needs some, probably written looking at the resulting html.

The biggest bug I know of is that it does not stay up to date well when the page is updated by ajax, either for privacy or for adding new comments.

Revision history for this message
Robert Collins (lifeless) wrote :

So, this has rather significant private-object implications.

See for instance the discussions we had on-list about trust of third
party js API's that get access to our objects, and also consider that
publicy stating a private object exists is an issue itself.

I think that we can probably tolerate the external js without a
contract / DPA analysis IF and only IF it is not loaded where
personally identifying information and / or private data is accessible
on the page.

I'm not sure how deep that rabbit hole will go; I suggest consulting
with curtis or deryck about this.

Revision history for this message
Robert Collins (lifeless) wrote :

(I realise my reply may look like I hadn't read the MP. I had :)).

You cover directly some private objects but not e.g. branch merge
proposals or their comments as being private (or even hidden). So
there is a risk that folk adding this won't cater for privacy in some
contexts, in the current implementation. I'd like to see *something*
done to reduce or mitigate that.

And there is no (apparent) consideration for personally identifying
data (which is a vague concept at best, but consider for instance that
a script running in our context can access an email address that a
script running from a different site cannot.

We also have the trust issue, which really isn't about the code, but
about whether we can trust the google plus API code with private data
(and this applies to non-private pages because a script can make API
calls and access anything you can access).

Revision history for this message
Martin Pool (mbp) wrote :

Hi,

I agree we need to get privacy (both data and people) right.

The benefit from all of this, hopefully, is
- more positive feedback for good work people do on Launchpad-hosted projects
- more visibility for Launchpad and projects in Launchpad on the web and on g+
- better search results about Launchpad

The biggest concern I have is not that Google will deploy malicious Javascript, but rather that people will accidentally click to share something that is meant to be private. So I want to hide the buttons on private pages -- and in fact I do, but it is not kept up to date after an ajax privacy change, but that can be done. We actually have belt-and-braces protection against that in that Google pings the page after you +1 it and it will refuse the plusone if the page is not accessible, which our private objects will be.

Showing the buttons in the page where we have control over them arguably makes it less likely people will accidentally click an external share button for a private object. It is more under our control.

My intention here is to provide, through the view.is_private check, a one-stop protection to make sure that these buttons are not rendered and the script is not loaded on views of private objects, without counting on people getting it right on each individual page. I think that means the current code will work ok even on bmps ... and I just tested, and in fact it does.

I ought to add tests that this is and stays correctly hooked up.

Personal data is hairy, arguably even including people's names, in which case every page of Launchpad is affected. What I'm trying to do here is to make it no worse than the current case combination of robots walking Launchpad public/anonymous pages, plus people sharing links through other means. The most relevant thing here is probably non-public email addresses. In a separate prior landing I add a meta description with the email addresses stripped out, so people shouldn't be accidentally sharing this. I'm also not putting this on any pages that are primarily about people, so the biggest risk is when personal information occurs within eg a public bug or mp description or comment.

To sum up the privacy requirements I am aiming for are:
 * do not share any private objects
 * do not encourage people to accidentally share things they shouldn't
 * the framework should be safe by default for new development
 * don't put email addresses into the shared content
 * don't run 3rd party javascript on pages containing private content (any more than we currently do)

Revision history for this message
Martin Pool (mbp) wrote :

There's some more discussion of this versus a builtin 'thanks' button in bug 798412.

I'm not sure about it.

It is smaller than a built in thanks mechanism would probably be.

On the other hand there is at least the perception of a privacy problem, perhaps an actual privacy problem, and perhaps ideally a builtin one would be better (though, we could always add this and switch later.)

Revision history for this message
Robert Collins (lifeless) wrote :

Hi, sorry to need to reject this, but I've clarified some policy constraints IS have around externally hosted JS. I'll be working up proper policy docs etc soon, but the tl;dr is - we cannot run js that is hosted on a third party site in the LP webapp browser context.

review: Disapprove
Revision history for this message
Robert Collins (lifeless) wrote :

One way to move this forward would be to investigate self hosted js that talks to the g+ servers - so a wire protocol rather than JS APIs.

Revision history for this message
Martin Pool (mbp) wrote :

> Hi, sorry to need to reject this, but I've clarified some policy constraints IS have around externally hosted JS. I'll be working up proper policy docs etc soon, but the tl;dr is - we cannot run js that is hosted on a third party site in the LP webapp browser context.

That's fine. It was interesting and educational to do this, but there
are enough tradeoffs here that I'm not sure I even want to land it. I
can see now how we could fairly easily hook a similar design in to the
notification system, once that exists. The metadata/microformat
changes make it easier for people to share pages using their own tools
if they want to.

There are some incidental cleanups in this branch that I will pick out
from the plusone bits.

I'm not being snarky by asking: does that policy mean that the
existing externally hosted scripts constitute bugs? Do we perhaps
want to at least squash them on private pages, using a similar check
to in this branch?

--
Martin

Revision history for this message
Robert Collins (lifeless) wrote :

On Tue, Nov 29, 2011 at 11:39 AM, Martin Pool <email address hidden> wrote:
> I'm not being snarky by asking: does that policy mean that the
> existing externally hosted scripts constitute bugs?  Do we perhaps
> want to at least squash them on private pages, using a similar check
> to in this branch?

They will have to go from all pages, because of the access they get.
Yes, they will constitute bugs.

-Rob

Revision history for this message
Martin Pool (mbp) wrote :

On 29 November 2011 09:24, Robert Collins <email address hidden> wrote:
> One way to move this forward would be to investigate self hosted js that talks to the g+ servers - so a wire protocol rather than JS APIs.

I suspect that would be breaching their TOS, eg "You agree not to
access (or attempt to access) any of the Services by any means other
than through the interface that is provided by Google", and also that
it may be technically fragile.

It wouldn't deal with user concerns about tracking.

Perhaps we can just implement our own "thanks" concept more directly.

--
Martin

Revision history for this message
Martin Pool (mbp) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.