You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tidy up predefined icon_type support in Addon / devhub #8158
Now #8096 has turned all predefined icons into custom icons, there are no add-ons remaining that have a predefined icons selected - only custom icons or the default puzzle piece.
So we can remove all code that relies on icon_type starting with icon/; the icons themselves in /static/; and the js/template support for selecting an icon from a list. (some of this could be spun out into separate issues)
hi @eviljeff Is this issue open for work? I would like to work on it.
It is available yes. Note: it's not a good first bug (good first bugs are suitable for new contributors who are starting in python/django where we'll help and explain exactly what code changes to make; for contrib:welcome issues you will work out what needs to be changed.). That said, let us know if you have questions on the scope of the issue.
the icons are in static/img/addon-icons/ (keep default though); the python changes will be in the Addon model in src/olympia/addons/models.py and possibly src/olympia/devhub/forms.py + whatever tests there are that fail and/or seem like they set icon_type to a icon/... string.
There is some javascript code in static/js/ too but that can be left to a follow-up issue (it's a bit fragile and we don't have any CI testing for it!)
@Mitrajit seems right, but I'll check when the pull request is ready. You'll see what (if any) other tests need changing when you run the tests and they cfail (locally running pytest src/olympia/devhub/tests/ will probably catch most problem areas, or just rely on circleci CI tests after you upload to github)
create_custom_icon_from_predefined can go entirely - I wrote it to convert the predefined icons.
if not addon.icon_type or addon.icon_type.split('/')[0] == 'icon': wouldn't be removed entirely - addon.icon_type can still be falsey.
Activity
rajpratyush commentedon Feb 1, 2021
hi @eviljeff Is this issue open for work? I would like to work on it.
eviljeff commentedon Feb 1, 2021
It is available yes. Note: it's not a good first bug (good first bugs are suitable for new contributors who are starting in python/django where we'll help and explain exactly what code changes to make; for contrib:welcome issues you will work out what needs to be changed.). That said, let us know if you have questions on the scope of the issue.
rajpratyush commentedon Feb 1, 2021
@eviljeff I just just like to know what are files associated with this change and their location.
eviljeff commentedon Feb 1, 2021
the icons are in static/img/addon-icons/ (keep default though); the python changes will be in the Addon model in src/olympia/addons/models.py and possibly src/olympia/devhub/forms.py + whatever tests there are that fail and/or seem like they set
icon_typeto aicon/...string.There is some javascript code in static/js/ too but that can be left to a follow-up issue (it's a bit fragile and we don't have any CI testing for it!)
eviljeff commentedon Feb 18, 2021
@rajpratyush are you still working on this?
rajpratyush commentedon Feb 18, 2021
Yes i am but actually i have been caught up in semester exams thaty unable to complete it
Mitrajit commentedon Apr 16, 2021
@eviljeff I would like to work on this issue. I have found 2 conditional blocks in src/olympia/addons/models.py and src/olympia/devhub/forms.py that checks if
icon_typestarts withicon/or not. https://github.com/mozilla/addons-server/blob/e746ef6517adca2c04162e516095932aff3908ad/src/olympia/addons/models.py#L1082-L1085 https://github.com/mozilla/addons-server/blob/e746ef6517adca2c04162e516095932aff3908ad/src/olympia/devhub/forms.py#L323-L327 Shall I remove these 2 conditional blocks?https://github.com/mozilla/addons-server/blob/06e7c2b021aed80097f673423824895cfc1f3e17/src/olympia/addons/tasks.py#L368 https://github.com/mozilla/addons-server/blob/15e9540b4c25744f1ece0ace853ee97ca8a7c7f8/src/olympia/devhub/views.py#L1000 Above lines have checked for the condition too, shall I remove them?
Also, I found /src/olympia/addons/tests/test_commands.py tests on
icon_typewithicon/..like https://github.com/mozilla/addons-server/blob/d9467f6030b3a3e4642950e415ed118fc823b74a/src/olympia/addons/tests/test_commands.py#L623 https://github.com/mozilla/addons-server/blob/15e9540b4c25744f1ece0ace853ee97ca8a7c7f8/src/olympia/devhub/views.py#L1000 Let me know if I have to make any changes to test files.eviljeff commentedon Apr 19, 2021
@Mitrajit seems right, but I'll check when the pull request is ready. You'll see what (if any) other tests need changing when you run the tests and they cfail (locally running
pytest src/olympia/devhub/tests/will probably catch most problem areas, or just rely on circleci CI tests after you upload to github)create_custom_icon_from_predefinedcan go entirely - I wrote it to convert the predefined icons.if not addon.icon_type or addon.icon_type.split('/')[0] == 'icon':wouldn't be removed entirely -addon.icon_typecan still be falsey.#16379 Tidy up predefined icon_type support
#16379 Tidy up predefined icon_type support
#16379 Tidy up predefined icon_type support in Addon / devhub (#16972)
AlexandraMoga commentedon Apr 27, 2021
I've verified that add-ons using the old predefined icons are still being rendered and checked that custom icons can be uploaded and changed.
This issue is verified fixed on -dev.