Skip to content

Tidy up predefined icon_type support in Addon / devhub #8158

Closed
mozilla/addons-server
#16972

Description

@eviljeff

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)

Activity

  1. rajpratyush commented on Feb 1, 2021

    @rajpratyush

    hi @eviljeff Is this issue open for work? I would like to work on it.

  2. eviljeff commented on Feb 1, 2021

    @eviljeff
    MemberAuthor

    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.

  3. rajpratyush commented on Feb 1, 2021

    @rajpratyush

    @eviljeff I just just like to know what are files associated with this change and their location.

  4. eviljeff commented on Feb 1, 2021

    @eviljeff
    MemberAuthor

    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!)

  5. eviljeff commented on Feb 18, 2021

    @eviljeff
    MemberAuthor

    @rajpratyush are you still working on this?

  6. rajpratyush commented on Feb 18, 2021

    @rajpratyush

    Yes i am but actually i have been caught up in semester exams thaty unable to complete it

  7. Mitrajit commented on Apr 16, 2021

    @Mitrajit

    @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_type starts with icon/ 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_type with icon/.. 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.

  8. eviljeff commented on Apr 19, 2021

    @eviljeff
    MemberAuthor

    @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.

  9. added this to the 2021.04.29 milestone on Apr 22, 2021
  10. AlexandraMoga commented on Apr 27, 2021

    @AlexandraMoga

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions