Skip to content

♻️ Updates public API openapi specs (under dev) and cleanup #4437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 60 commits into from
Jul 3, 2023

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Jun 29, 2023

What do these changes do?

This PR updates the openapi specs (OAS) with changes planned for the api-server. In addition, I increased the code-coverage by improving the fixtures and dropping unused code modules/scripts.

  • Changed entrypoints (backwards-compabible)
  1. GET /v0/files/page
  2. GET /v0/solvers/page
  3. GET /v0/solversreleases/page
  4. GET /v0/solvers/{solver_key}/releases/page
  5. GET /v0/solvers/{solver_key}/releases/{version}/ports
  6. GET /v0/solvers/{solver_key}/releases/{version}/jobs/page
  7. GET /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/metadata
  8. POST /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/metadata
  9. GET /v0/studies/
  10. GET /v0/studies/{study_id}
  11. GET /v0/studies/{study_id}/ports
  12. GET /v0/studies/{study_id}/jobs
  13. POST /v0/studies/{study_id}/jobs
  14. GET /v0/studies/{study_id}/jobs/{job_id}
  15. DELETE /v0/studies/{study_id}/jobs/{job_id}
  16. POST /v0/studies/{study_id}/jobs/{job_id}:start
  17. POST /v0/studies/{study_id}/jobs/{job_id}:stop
  18. POST /v0/studies/{study_id}/jobs/{job_id}:inspect
  19. POST /v0/studies/{study_id}/jobs/{job_id}/outputs
  20. POST /v0/studies/{study_id}/jobs/{job_id}/outputs/logfile
  21. GET /v0/studies/{study_id}/jobs/{job_id}/metadata
  22. POST /v0/studies/{study_id}/jobs/{job_id}/metadata
  23. DELETE /v0/files/{file_id}
  24. DELETE /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}
  • Listings and pagination
    - existing listings are complemented with /page
    - new listings incorporate pagination from the start
    - listings with small number of elements, incorporate OnePage. Makes sense? Perhaps we should include pagination to everything by default?
  • Validate all model examples in a single test
  • ⬆️ upgrades fastapi-pagination
# name before after upgrade count packages
1 fastapi-pagination 0.12.4 0.12.5 1 api-server⬆️
2 pytest 7.3.2 7.4.0 minor 1 api-server🧪
  • Validate deep backend captures against OAS of each service : services/api-server/tests/unit/test__mocks_captures.py
  • refactor/create mocks for stack services
    • mocked_webserver_service_api_base
    • mocked_catalog_service_api_base
    • mocked_directorv2_service_api_base
    • mocked_storage_service_api_base
  • api schema models for services exposed as model_library.api_schema_*
  • increase test coverage: cover all API routes
  • General cleanup
    • New Annotated
    • Delete unused modules and scripts
    • Ruff-ed it all

Related issue/s

How to test

cd services/api-server
make install-dev
make test-dev

DevOps

None

@pcrespov pcrespov self-assigned this Jun 29, 2023
@pcrespov pcrespov added this to the Watermelon milestone Jun 29, 2023
@pcrespov pcrespov added the a:apiserver api-server service label Jun 29, 2023
@pcrespov pcrespov force-pushed the is3626/api-server-openapi branch from 0d48e79 to a0b1e82 Compare June 29, 2023 21:26
@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Merging #4437 (5af8004) into master (5aa73d3) will decrease coverage by 2.8%.
The diff coverage is 65.4%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #4437     +/-   ##
========================================
- Coverage    83.8%   81.0%   -2.8%     
========================================
  Files         999     861    -138     
  Lines       42792   37331   -5461     
  Branches     1016     634    -382     
========================================
- Hits        35871   30259   -5612     
- Misses       6700    6923    +223     
+ Partials      221     149     -72     
Flag Coverage Δ
integrationtests 67.8% <100.0%> (?)
unittests 79.1% <64.9%> (-4.7%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...s/settings-library/src/settings_library/storage.py 0.0% <0.0%> (ø)
..._service_api_server/api/errors/validation_error.py 100.0% <ø> (ø)
...-server/src/simcore_service_api_server/api/root.py 100.0% <ø> (ø)
...src/simcore_service_api_server/core/application.py 97.0% <ø> (-0.2%) ⬇️
...server/src/simcore_service_api_server/db/errors.py 0.0% <0.0%> (ø)
.../simcore_service_api_server/models/schemas/meta.py 100.0% <ø> (ø)
...imcore_service_api_server/services/remote_debug.py 26.6% <0.0%> (-2.0%) ⬇️
...simcore_service_api_server/services/director_v2.py 69.7% <25.0%> (+2.2%) ⬆️
...core_service_api_server/api/routes/studies_jobs.py 59.2% <31.2%> (-18.3%) ⬇️
...vice_api_server/api/dependencies/authentication.py 76.0% <33.3%> (-5.0%) ⬇️
... and 31 more

... and 295 files with indirect coverage changes

@pcrespov pcrespov force-pushed the is3626/api-server-openapi branch 2 times, most recently from d212008 to 4d5b2a9 Compare July 3, 2023 13:44
@pcrespov pcrespov marked this pull request as ready for review July 3, 2023 13:44
@pcrespov pcrespov requested a review from bisgaard-itis July 3, 2023 13:44
@pcrespov pcrespov changed the title WIP: ♻️ Is3626/api server openapi ♻️ Updates public API openapi specs (under dev) and cleanup Jul 3, 2023
@pcrespov pcrespov added the a:api framework api, data schemas, label Jul 3, 2023
Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

👍 Please check out my comments.

@pcrespov pcrespov force-pushed the is3626/api-server-openapi branch from 67de386 to 6b862b2 Compare July 3, 2023 14:59
@pcrespov pcrespov enabled auto-merge (squash) July 3, 2023 14:59
@pcrespov pcrespov requested a review from mguidon July 3, 2023 16:23
Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

Please check the storage settings.
Also feel free to change the ruff settings, see https://github.com/ITISFoundation/osparc-simcore/pull/4429/files#diff-b3236d4cb260ca6acce083493fcdc42816f732fc3d5aefb263a3c3fe9db4f81f
otherwise all good!

Copy link
Collaborator

@matusdrobuliak66 matusdrobuliak66 left a comment

Choose a reason for hiding this comment

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

👍

@codeclimate
Copy link

codeclimate bot commented Jul 3, 2023

Code Climate has analyzed commit 5af8004 and detected 0 issues on this pull request.

View more on Code Climate.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@pcrespov pcrespov merged commit 6e43b9f into ITISFoundation:master Jul 3, 2023
@pcrespov pcrespov deleted the is3626/api-server-openapi branch July 3, 2023 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:api framework api, data schemas, a:apiserver api-server service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

♻️ apiserver: review and increase test coverage before extending
4 participants