Skip to content

#16379 Tidy up predefined icon_type support in Addon / devhub - #16972

Merged
eviljeff merged 6 commits into
mozilla:masterfrom
Mitrajit:#16379-Tidy-up-predefined-icon_type-support-in-Addon-devhub
Apr 22, 2021
Merged

eviljeff merged 6 commits into
mozilla:masterfrom
Mitrajit:#16379-Tidy-up-predefined-icon_type-support-in-Addon-devhub

Conversation

@Mitrajit

@Mitrajit Mitrajit commented Apr 19, 2021 •

Copy link
Copy Markdown
Contributor

Fixes mozilla/addons#8158

@eviljeff
Changed the files in src/olympia/addons and src/olympia/devhub that checks whether icon_type starts with icon/.
Removed create_custom_icon_from_predefined function from src/olympia/addons/tasks.py
Due to removal of create_custom_icon_from_predefined function import errors are found in

  • src/olympia/addons/management/commands/process_addons.py
  • src/olympia/addons/tests/test_commands.py
  • src/olympia/lib/settings_base.py
    Let me know how shall I solve these.

@eviljeff

Copy link
Copy Markdown
Member

you have a number of test fails to look at

@Mitrajit

Copy link
Copy Markdown
Contributor Author

@eviljeff

Due to removal of create_custom_icon_from_predefined function import errors are found in

Most problems are from these three files how/what shall I modify in these files?

The rest of the errors are from code quality due to some unused variables, imports and ...

def test_image_status_default(self):
def test_edit_media_preuploadedicon(self):
assert task_name in settings.CELERY_TASK_ROUTES.keys()
Here task_name = 'olympia.addons.tasks.create_custom_icon_from_predefined' is causing problem

@eviljeff

Copy link
Copy Markdown
Member

Due to removal of create_custom_icon_from_predefined function import errors are found in

Most problems are from these three files how/what shall I modify in these files?

These are all because the underlying create_custom_icon_from_predefined task was removed. So you can remove the dict entries in process_addons.py and settings_base.py for create_custom_icon_from_predefined, and the TestCreateCustomIconFromPredefined class.

The rest of the errors are from code quality due to some unused variables, imports and ...

def test_image_status_default(self):

you can delete this

def test_edit_media_preuploadedicon(self):

and this too

assert task_name in settings.CELERY_TASK_ROUTES.keys()

Here task_name = 'olympia.addons.tasks.create_custom_icon_from_predefined' is causing problem

this will go away when the entry is deleted from settings_base.py

@Mitrajit

Copy link
Copy Markdown
Contributor Author

@eviljeff All pytest tests works now but cannot understand why I am getting codestyle error

black --check src/ services/ tests/
would reformat /home/circleci/project/src/olympia/devhub/tests/test_views_edit.py
Oh no! 💥 💔 💥
1 file would be reformatted, 648 files would be left unchanged.
make: *** [Makefile-docker:190: lint] Error 1

@eviljeff

Copy link
Copy Markdown
Member

@Mitrajit you can run make format to fix formatting.

Comment thread src/olympia/devhub/forms.py Resolved
@eviljeff

Copy link
Copy Markdown
Member

I missed something, you can delete all the files in https://github.com/mozilla/addons-server/tree/master/static/img/addon-icons - except the default- files - because they're no longer used by the code you removed.

@Mitrajit

Copy link
Copy Markdown
Contributor Author

@eviljeff I have deleted those unused images.

@eviljeff eviljeff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, thanks r+

@eviljeff
eviljeff merged commit 0abe68e into mozilla:master Apr 22, 2021
@Mitrajit

Copy link
Copy Markdown
Contributor Author

@eviljeff you're most welcome. Which issue shall I checkout next?

@eviljeff

Copy link
Copy Markdown
Member

@eviljeff you're most welcome. Which issue shall I checkout next?

you can look though the other contrib:welcome issues

@caitmuenster

Copy link
Copy Markdown

@Mitrajit We'd love to have you take a look at the contrib:welcome issues! Take a look at this list and let us know if anything looks interesting. :)

@Mitrajit

Copy link
Copy Markdown
Contributor Author

@caitmuenster Sure, I will check them out and let you know.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tidy up predefined icon_type support in Addon / devhub

3 participants