Skip to content

Port over to fastapi #519#524

Draft
joshdimanteto wants to merge 48 commits intodevelopfrom
port-over-to-fastapi-#519
Draft

Port over to fastapi #519#524
joshdimanteto wants to merge 48 commits intodevelopfrom
port-over-to-fastapi-#519

Conversation

@joshdimanteto
Copy link
Copy Markdown
Contributor

@joshdimanteto joshdimanteto commented Jan 14, 2026

This PR will close #519

Description

Port datagateway-api from flask-restful to fast-api and upgrade the python version to 3.11 (matches scigateway-auth)

Testing Instructions

Add a set up instructions describing how the reviewer should test the code

  • Review code
  • Check GitHub Actions build
  • If icatdb Generator Script Consistency Test CI job fails, is this because of a deliberate change made to the script to change generated data (which isn't actually a problem) or is here an underlying issue with the changes made?
  • Review changes to test coverage
  • Does this change mean a new patch, minor or major version should be made? If so, does one of the commit messages feature fix:, feat: or BREAKING CHANGE: so a release is automatically made via GitHub Actions upon merge?
  • {more steps here}

Agile Board Tracking

Connect to #519

Notes

  • In the models all the relationships fields so ONE to ONE , ONE to MANY and MANY to MANY are optional. This was done because the model are deeply nested and can cascade. When they cascade they use the id generated by the parent for the given field e.g. so if you can create jobs in Applications, the job object would have the application id. This is a complex when it comes to Investigation when there is 4 levels deep so investigation - dataset - data file etc. for this to work you have to create many custom models of existing entities. So it is more efficient to make them optional. The ATTRIBUTES can be optional or mandatory depending on the SQL schema.

- implement session bearer to add session id in header
- add TODO for issue found with post and patch requesr #525
@joshdimanteto joshdimanteto mentioned this pull request Feb 9, 2026
6 tasks
@joshdimanteto joshdimanteto force-pushed the port-over-to-fastapi-#519 branch from 2e204de to 5750aa9 Compare February 10, 2026 15:13
@joshdimanteto joshdimanteto force-pushed the port-over-to-fastapi-#519 branch from 0f4320e to 8ab0d9a Compare February 10, 2026 16:44
@joshdimanteto joshdimanteto force-pushed the port-over-to-fastapi-#519 branch from 36f8766 to 74c1979 Compare February 25, 2026 17:24
@joshdimanteto joshdimanteto force-pushed the port-over-to-fastapi-#519 branch from a8b597b to 151bc7c Compare February 26, 2026 10:49
Copy link
Copy Markdown

@patrick-austin patrick-austin left a comment

Choose a reason for hiding this comment

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

17/85 files down, will keep going on Monday

Comment thread .github/workflows/ci-build.yml Outdated
Comment thread .github/workflows/ci-build.yml Outdated
Comment thread .github/workflows/ci-build.yml Outdated
Comment thread .github/workflows/ci-build.yml Outdated
Comment thread datagateway_api/src/common/config.py Outdated
Comment thread datagateway_api/src/datagateway_api/icat/helpers.py Outdated
Comment thread datagateway_api/src/datagateway_api/icat/helpers.py Outdated
Comment thread datagateway_api/src/datagateway_api/icat/helpers.py Outdated
Comment thread datagateway_api/src/common/helpers.py
Comment thread datagateway_api/src/common/helpers.py
Base automatically changed from refactor-dg-api-model-to-pydantic-522 to develop March 16, 2026 09:58
Comment thread datagateway_api/src/datagateway_api/icat/query.py Outdated
Comment thread datagateway_api/src/datagateway_api/routers/ping.py
Comment thread pyproject.toml
show_missing = true

[tool.black]
line-length = 120
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There's a reference to 88 characters per line in the README.md that will need updating because of this.

Comment thread datagateway_api/src/datagateway_api/routers/sessions.py
Comment thread datagateway_api/src/datagateway_api/routers/sessions.py
Comment thread test/integration/datagateway_api/icat/endpoints/test_ping_icat.py Outdated
Comment thread test/integration/datagateway_api/icat/endpoints/test_update_by_id_icat.py Outdated
Comment thread test/integration/datagateway_api/icat/endpoints/test_update_by_id_icat.py Outdated
Comment thread test/integration/datagateway_api/icat/endpoints/test_update_by_id_icat.py Outdated
Comment thread test/integration/datagateway_api/icat/endpoints/test_update_multiple_icat.py Outdated
Copy link
Copy Markdown

@patrick-austin patrick-austin left a comment

Choose a reason for hiding this comment

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

Mostly sting formatting and inconsistent approaches to typehints/docstrings.

- only changes in src directory
- improve formatting in test files
@joshdimanteto joshdimanteto force-pushed the port-over-to-fastapi-#519 branch from 28c9080 to c4f80a4 Compare March 18, 2026 14:09
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.

2 participants