build(python): upgrade to Flask 3.x#678
Conversation
Upgrade Flask from `<2.3.0` to `>=3.0.0` and Werkzeug from `<2.3.0` to `>=3.0.0`, in line with the Invenio package upgrade in reana-server. Bump marshmallow from `<3.0.0` to `>=3.5.0,<4.0.0` and webargs to `>=8.0`, since the new Invenio stack requires marshmallow 3 and the corresponding webargs 8. Adapt the REST endpoints to the new marshmallow 3 and webargs 8 APIs. Replace the deprecated `missing=` keyword on schema fields with `load_default=`. Add `unknown=marshmallow.EXCLUDE` to all `@use_kwargs` and `@use_args` decorators that parse query parameters, so that REANA-specific extras such as `access_token` are silently ignored, matching the pre-upgrade webargs 5 behaviour. Replace all remaining `Model.query` call sites in the REST handlers, the workflow run manager, and the test suite with explicit `Session.query(Model)` queries, since SQLAlchemy 2.x no longer supports the `Base.query` shortcut. Replace the deprecated `FLASK_ENV` setting with `FLASK_DEBUG`, both in the runtime checks of the workflow run manager and in the `DEBUG_ENV_VARS` injected into spawned workflow engine containers. Update the test configuration to use `DEBUG` instead of `FLASK_ENV`. Remove pinned `reana-commons`, `reana-db`, and `kubernetes` entries from `requirements.txt` so that `pip install .` resolves them freshly from `setup.py` against the locally-mounted `modules/reana-db` and `modules/reana-commons` shared sources during development, avoiding version conflicts with PyPI versions that still carry the old pins. Closes reanahub/reana-server#770
6200452 to
decc0b8
Compare
AI ReviewWorkspace-limit tests still mock the pre-migration query API_mock_workspace_access() still monkeypatches workflows_workspace.User.query, but the migrated handlers now look users up via Session.query(User). On this branch that means the helper no longer intercepts anything, and the PR's python-tests job fails with five tests/test_workspace_limits.py cases returning 500 instead of their expected 200/400 responses. Please update the helper to stub Session.query(...) or use a real session-backed user fixture. reana-workflow-controller/tests/test_workspace_limits.py:45-55 |
Upgrade Flask from `<2.3.0` to `>=3.0.0` and Werkzeug from `<2.3.0` to `>=3.0.0`, in line with the Invenio package upgrade in reana-server. Bump marshmallow from `<3.0.0` to `>=3.5.0,<4.0.0` and webargs to `>=8.0`, since the new Invenio stack requires marshmallow 3 and the corresponding webargs 8. Adapt the REST endpoints to the new marshmallow 3 and webargs 8 APIs. Replace the deprecated `missing=` keyword on schema fields with `load_default=`. Add `unknown=marshmallow.EXCLUDE` to all `@use_kwargs` and `@use_args` decorators that parse query parameters, so that REANA-specific extras such as `access_token` are silently ignored, matching the pre-upgrade webargs 5 behaviour. Replace all remaining `Model.query` call sites in the REST handlers, the workflow run manager, and the test suite with explicit `Session.query(Model)` queries, since SQLAlchemy 2.x no longer supports the `Base.query` shortcut. Replace the deprecated `FLASK_ENV` setting with `FLASK_DEBUG`, both in the runtime checks of the workflow run manager and in the `DEBUG_ENV_VARS` injected into spawned workflow engine containers. Update the test configuration to use `DEBUG` instead of `FLASK_ENV`. Remove pinned `reana-commons`, `reana-db`, and `kubernetes` entries from `requirements.txt` so that `pip install .` resolves them freshly from `setup.py` against the locally-mounted `modules/reana-db` and `modules/reana-commons` shared sources during development, avoiding version conflicts with PyPI versions that still carry the old pins. Closes reanahub/reana-server#770
decc0b8 to
c51cc61
Compare
Upgrade Flask from `<2.3.0` to `>=3.0.0` and Werkzeug from `<2.3.0` to `>=3.0.0`, in line with the Invenio package upgrade in reana-server. Bump marshmallow from `<3.0.0` to `>=3.5.0,<4.0.0` and webargs to `>=8.0`, since the new Invenio stack requires marshmallow 3 and the corresponding webargs 8. Adapt the REST endpoints to the new marshmallow 3 and webargs 8 APIs. Replace the deprecated `missing=` keyword on schema fields with `load_default=`. Add `unknown=marshmallow.EXCLUDE` to all `@use_kwargs` and `@use_args` decorators that parse query parameters, so that REANA-specific extras such as `access_token` are silently ignored, matching the pre-upgrade webargs 5 behaviour. Replace all remaining `Model.query` call sites in the REST handlers, the workflow run manager, and the test suite with explicit `Session.query(Model)` queries, since SQLAlchemy 2.x no longer supports the `Base.query` shortcut. Replace the deprecated `FLASK_ENV` setting with `FLASK_DEBUG`, both in the runtime checks of the workflow run manager and in the `DEBUG_ENV_VARS` injected into spawned workflow engine containers. Update the test configuration to use `DEBUG` instead of `FLASK_ENV`. Remove pinned `reana-commons`, `reana-db`, and `kubernetes` entries from `requirements.txt` so that `pip install .` resolves them freshly from `setup.py` against the locally-mounted `modules/reana-db` and `modules/reana-commons` shared sources during development, avoiding version conflicts with PyPI versions that still carry the old pins. Closes reanahub/reana-server#770
c51cc61 to
9895576
Compare
Upgrade Flask from `<2.3.0` to `>=3.0.0` and Werkzeug from `<2.3.0` to `>=3.0.0`, in line with the Invenio package upgrade in reana-server. Bump marshmallow from `<3.0.0` to `>=3.5.0,<4.0.0` and webargs to `>=8.0`, since the new Invenio stack requires marshmallow 3 and the corresponding webargs 8. Adapt the REST endpoints to the new marshmallow 3 and webargs 8 APIs. Replace the deprecated `missing=` keyword on schema fields with `load_default=`. Add `unknown=marshmallow.EXCLUDE` to all `@use_kwargs` and `@use_args` decorators that parse query parameters, so that REANA-specific extras such as `access_token` are silently ignored, matching the pre-upgrade webargs 5 behaviour. Replace all remaining `Model.query` call sites in the REST handlers, the workflow run manager, and the test suite with explicit `Session.query(Model)` queries, since SQLAlchemy 2.x no longer supports the `Base.query` shortcut. Replace the deprecated `FLASK_ENV` setting with `FLASK_DEBUG`, both in the runtime checks of the workflow run manager and in the `DEBUG_ENV_VARS` injected into spawned workflow engine containers. Update the test configuration to use `DEBUG` instead of `FLASK_ENV`. Remove pinned `reana-commons`, `reana-db`, and `kubernetes` entries from `requirements.txt` so that `pip install .` resolves them freshly from `setup.py` against the locally-mounted `modules/reana-db` and `modules/reana-commons` shared sources during development, avoiding version conflicts with PyPI versions that still carry the old pins. Closes reanahub/reana-server#770
9895576 to
271ec36
Compare
Upgrade Flask from `<2.3.0` to `>=3.0.0` and Werkzeug from `<2.3.0` to `>=3.0.0`, in line with the Invenio package upgrade in reana-server. Bump marshmallow from `<3.0.0` to `>=3.5.0,<4.0.0` and webargs to `>=8.0`, since the new Invenio stack requires marshmallow 3 and the corresponding webargs 8. Adapt the REST endpoints to the new marshmallow 3 and webargs 8 APIs. Replace the deprecated `missing=` keyword on schema fields with `load_default=`. Add `unknown=marshmallow.EXCLUDE` to all `@use_kwargs` and `@use_args` decorators that parse query parameters, so that REANA-specific extras such as `access_token` are silently ignored, matching the pre-upgrade webargs 5 behaviour. Replace all remaining `Model.query` call sites in the REST handlers, the workflow run manager, and the test suite with explicit `Session.query(Model)` queries, since SQLAlchemy 2.x no longer supports the `Base.query` shortcut. Replace the deprecated `FLASK_ENV` setting with `FLASK_DEBUG`, both in the runtime checks of the workflow run manager and in the `DEBUG_ENV_VARS` injected into spawned workflow engine containers. Update the test configuration to use `DEBUG` instead of `FLASK_ENV`. Remove pinned `reana-commons`, `reana-db`, and `kubernetes` entries from `requirements.txt` so that `pip install .` resolves them freshly from `setup.py` against the locally-mounted `modules/reana-db` and `modules/reana-commons` shared sources during development, avoiding version conflicts with PyPI versions that still carry the old pins. Closes reanahub/reana-server#770
271ec36 to
341efb2
Compare
Upgrade Flask from `<2.3.0` to `>=3.0.0` and Werkzeug from `<2.3.0` to `>=3.0.0`, in line with the Invenio package upgrade in reana-server. Bump marshmallow from `<3.0.0` to `>=3.5.0,<4.0.0` and webargs to `>=8.0`, since the new Invenio stack requires marshmallow 3 and the corresponding webargs 8. Adapt the REST endpoints to the new marshmallow 3 and webargs 8 APIs. Replace the deprecated `missing=` keyword on schema fields with `load_default=`. Add `unknown=marshmallow.EXCLUDE` to all `@use_kwargs` and `@use_args` decorators that parse query parameters, so that REANA-specific extras such as `access_token` are silently ignored, matching the pre-upgrade webargs 5 behaviour. Replace all remaining `Model.query` call sites in the REST handlers, the workflow run manager, and the test suite with explicit `Session.query(Model)` queries, since SQLAlchemy 2.x no longer supports the `Base.query` shortcut. Replace the deprecated `FLASK_ENV` setting with `FLASK_DEBUG`, both in the runtime checks of the workflow run manager and in the `DEBUG_ENV_VARS` injected into spawned workflow engine containers. Update the test configuration to use `DEBUG` instead of `FLASK_ENV`. Remove pinned `reana-commons`, `reana-db`, and `kubernetes` entries from `requirements.txt` so that `pip install .` resolves them freshly from `setup.py` against the locally-mounted `modules/reana-db` and `modules/reana-commons` shared sources during development, avoiding version conflicts with PyPI versions that still carry the old pins. Closes reanahub/reana-server#770
Replace `docker stop` with `docker rm -f` when cleaning the old Postgres test container. Stopping a `--rm` container triggers asynchronous removal, so on faster machines the next `docker run --rm` could fire before the old container was gone, leading to a name conflict. `docker rm -f` stops and removes synchronously, so the subsequent `docker run` always succeeds.
341efb2 to
53a9806
Compare
Replace `docker stop` with `docker rm -f` when cleaning the old Postgres test container. Stopping a `--rm` container triggers asynchronous removal, so on faster machines the next `docker run --rm` could fire before the old container was gone, leading to a name conflict. `docker rm -f` stops and removes synchronously, so the subsequent `docker run` always succeeds.
Upgrade Flask from `<2.3.0` to `>=3.0.0` and Werkzeug from `<2.3.0` to `>=3.0.0`, in line with the Invenio package upgrade in reana-server. Bump marshmallow from `<3.0.0` to `>=3.5.0,<4.0.0` and webargs to `>=8.0`, since the new Invenio stack requires marshmallow 3 and the corresponding webargs 8. Adapt the REST endpoints to the new marshmallow 3 and webargs 8 APIs. Replace the deprecated `missing=` keyword on schema fields with `load_default=`. Add `unknown=marshmallow.EXCLUDE` to all `@use_kwargs` and `@use_args` decorators that parse query parameters, so that REANA-specific extras such as `access_token` are silently ignored, matching the pre-upgrade webargs 5 behaviour. Replace all remaining `Model.query` call sites in the REST handlers, the workflow run manager, and the test suite with explicit `Session.query(Model)` queries, since SQLAlchemy 2.x no longer supports the `Base.query` shortcut. Replace the deprecated `FLASK_ENV` setting with `FLASK_DEBUG`, both in the runtime checks of the workflow run manager and in the `DEBUG_ENV_VARS` injected into spawned workflow engine containers. Update the test configuration to use `DEBUG` instead of `FLASK_ENV`. Remove pinned `reana-commons`, `reana-db`, and `kubernetes` entries from `requirements.txt` so that `pip install .` resolves them freshly from `setup.py` against the locally-mounted `modules/reana-db` and `modules/reana-commons` shared sources during development, avoiding version conflicts with PyPI versions that still carry the old pins. Closes reanahub/reana-server#770
53a9806 to
324f4ad
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #678 +/- ##
==========================================
+ Coverage 74.46% 74.51% +0.04%
==========================================
Files 17 17
Lines 2044 2048 +4
==========================================
+ Hits 1522 1526 +4
Misses 522 522
🚀 New features to boost your workflow:
|
Upgrade Flask from `<2.3.0` to `>=3.0.0` and Werkzeug from `<2.3.0` to `>=3.0.0`, in line with the Invenio package upgrade in reana-server. Bump marshmallow from `<3.0.0` to `>=3.5.0,<4.0.0` and webargs to `>=8.0`, since the new Invenio stack requires marshmallow 3 and the corresponding webargs 8. Adapt the REST endpoints to the new marshmallow 3 and webargs 8 APIs. Replace the deprecated `missing=` keyword on schema fields with `load_default=`. Add `unknown=marshmallow.EXCLUDE` to all `@use_kwargs` and `@use_args` decorators that parse query parameters, so that REANA-specific extras such as `access_token` are silently ignored, matching the pre-upgrade webargs 5 behaviour. Replace all remaining `Model.query` call sites in the REST handlers, the workflow run manager, and the test suite with explicit `Session.query(Model)` queries, since SQLAlchemy 2.x no longer supports the `Base.query` shortcut. Replace the deprecated `FLASK_ENV` setting with `FLASK_DEBUG`, both in the runtime checks of the workflow run manager and in the `DEBUG_ENV_VARS` injected into spawned workflow engine containers. Update the test configuration to use `DEBUG` instead of `FLASK_ENV`. Remove pinned `reana-commons`, `reana-db`, and `kubernetes` entries from `requirements.txt` so that `pip install .` resolves them freshly from `setup.py` against the locally-mounted `modules/reana-db` and `modules/reana-commons` shared sources during development, avoiding version conflicts with PyPI versions that still carry the old pins. Closes reanahub/reana-server#770
324f4ad to
332aa83
Compare
Thanks — fixed in this branch. |
Upgrade Flask from
<2.3.0to>=3.0.0and Werkzeug from<2.3.0to>=3.0.0, in line with the Invenio package upgrade in reana-server. Bump marshmallow from<3.0.0to>=3.5.0,<4.0.0and webargs to>=8.0, since the new Invenio stack requires marshmallow 3 and the corresponding webargs 8.Adapt the REST endpoints to the new marshmallow 3 and webargs 8 APIs. Replace the deprecated
missing=keyword on schema fields withload_default=. Addunknown=marshmallow.EXCLUDEto all@use_kwargsand@use_argsdecorators that parse query parameters, so that REANA-specific extras such asaccess_tokenare silently ignored, matching the pre-upgrade webargs 5 behaviour.Replace all remaining
Model.querycall sites in the REST handlers, the workflow run manager, and the test suite with explicitSession.query(Model)queries, since SQLAlchemy 2.x no longer supports theBase.queryshortcut.Replace the deprecated
FLASK_ENVsetting withFLASK_DEBUG, both in the runtime checks of the workflow run manager and in theDEBUG_ENV_VARSinjected into spawned workflow engine containers. Update the test configuration to useDEBUGinstead ofFLASK_ENV.Remove pinned
reana-commons,reana-db, andkubernetesentries fromrequirements.txtso thatpip install .resolves them freshly fromsetup.pyagainst the locally-mountedmodules/reana-dbandmodules/reana-commonsshared sources during development, avoiding version conflicts with PyPI versions that still carry the old pins.Closes reanahub/reana-server#770.