Addons-server: Remove public source code setting from DevHub

Created on 23 Sep 2019  路  7Comments  路  Source: mozilla/addons-server

We decided to drop the View Source link in add-on product pages some time ago because of security concerns, and because it's easy to have your sources published in external sites like GitHub.

The setting is still present in the DevHub, though, which is confusing developers. It's at the very bottom, under Technical Details. Let's remove it.

devhub good first bug p4

All 7 comments

Hello @diox I'd like to take this up. Let me know how to take this up!

Thanks

Hi,

You're a bit early, this issue hasn't been confirmed as a good first bug yet. Nevertheless, if you want to take it on, assuming you followed the instructions to install addons-server locally:
As @jvillalobos described, it's about removing the setting for "View Source". You'll find the template in src/olympia/devhub/templates/devhub/addons/edit/technical.html, but you also need to remove all code in addons-server that uses the view_source field, including tests (and test data : it's present in a number of fixtures files).

The functionality is also exposed in the API under a different name, is_source_public. This needs special care as the API must keep this field for backwards-compatibility purposes. You'll need to modify the declaration of the field in src/olympia/addons/serializers.py to always return False. I suggest making it a serializerMethodField() instead of the BooleanField it is now and implementing a get_is_source_public(self, obj) in the serializer class, simply having it return False. Tests will have to be updated here as well.

I'm not sure the API part is a good-first-bug - we ideally want it gone from v4+ so only returned for v3 - so needs feature gates.

Recommend we split that part out into a separate issue.

okay! @eviljeff @diox could you direct me to some good-first-bugs in this project?
thanks :)

We've determined the devhub part of this to be a good first bug. I've moved the API part to another issue because it's a bit more involved.

@ruchikabgosain you can start on this if you want to. If you're feeling adventurous you can look at #12514 afterwards too.

mentor @diox

right, thanks @eviljeff 馃幁

just a lil question, how can I find all the code that uses view_source attribute? let me know, thanks 馃樃

Cc: @diox

@ruchikabgosain - Look into using grep, information here :) https://www.computerhope.com/unix/ugrep.htm

Was this page helpful?
0 / 5 - 0 ratings