inveniosoftware / invenio-app-rdm

Turn-key research data management platform.
https://inveniordm.docs.cern.ch
MIT License
96 stars 140 forks source link

Refactor code to be compatible with Flask >= 2.3 #2373

Open utnapischtim opened 11 months ago

utnapischtim commented 11 months ago

General

Flask 2.2 deprecated the decorators @before_first_request and @before_app_first_request (and a lot of other stuff). Flask 2.3 removed most of the things 2.2 deprecated. Those two decorators are used in a lot of invenio and flask packages. The main usage is to create the menu after the app has been initialized but before of the first request.

flask-menu provides the register_menu decorator which uses both deprecated decorators. register_menu is used in multiple view.py files to decorate endpoints to add menu entries.

Involved Packages for the decorators @before_first_request and @before_app_first_request

invenio-administration, invenio-records-rest, invenio-oauth2server, invenio-oauthclient, flask-menu, invenio-admin, invenio-communities, invenio-app-rdm, invenio-pages, invenio-accounts, invenio-deposit

Side Note: invenio-admin and invenio-deposit are deprecated.

Involved packages for the @register_menu decorator

invenio-accounts, invenio-oauthclient, invenio-userprofiles, invenio-oauth2server, invenio-github, invenio-theme, invenio-notifications

This list shows that register_menu is used a lot which makes the refactoring a little bit harder.

Involved packages for the @record_once decorator

invenio-communities, invenio-vocabularies, invenio-requests, invenio-users-resources, invenio-userprofiles, invenio-oauthclient, invenio-accounts, invenio-rdm-records

@record_once is not deprecated but follows the same idea as @before_first_request and @before_app_first_request and it could (will) be replaced with the same solution.

Problems

WIP

Solution

WIP

github-actions[bot] commented 9 months ago

This issue was automatically marked as stale.