Skip to content
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

Migrate Library Contents API to FastAPI #18838

Open
wants to merge 27 commits into
base: dev
Choose a base branch
from

Conversation

arash77
Copy link
Collaborator

@arash77 arash77 commented Sep 17, 2024

What did you do?

  • Include an API test under lib/galaxy_test/api/
  • Refactor the legacy library_contents API logic so all the logic is contained in the LibraryContentsService class
  • Create pydantic models for the responses and payloads
  • Create the FastAPI routes that will replace the old ones

related to #10889

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@arash77 arash77 marked this pull request as ready for review September 26, 2024 12:46
@github-actions github-actions bot added this to the 24.2 milestone Sep 26, 2024
Copy link
Contributor

@davelopez davelopez left a comment

Choose a reason for hiding this comment

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

At least some of the test failures are due to wrong Library Folder ID decoding.

Looks like LibraryFolderDatabaseIdField is not stripping the initial "F" before decoding here:

BeforeValidator(lambda database_id: Security.security.decode_id(database_id)),

@arash77
Copy link
Collaborator Author

arash77 commented Sep 27, 2024

At least some of the test failures are due to wrong Library Folder ID decoding.

Looks like LibraryFolderDatabaseIdField is not stripping the initial "F" before decoding here:

BeforeValidator(lambda database_id: Security.security.decode_id(database_id)),

I think the test failures are because I forgot to add the model for the folder ids on library_id! I have added them to the new commit.

@arash77
Copy link
Collaborator Author

arash77 commented Sep 27, 2024

I noticed test failures that I believe are caused by files being sent to the create endpoint (here and here). This results in the payload being sent as data instead of JSON, which leads to issues. Do you have any suggestions for handling file uploads in this case?

…nt caused in test_materialize_library_dataset
@davelopez
Copy link
Contributor

I noticed test failures that I believe are caused by files being sent to the create endpoint (here and here). This results in the payload being sent as data instead of JSON, which leads to issues. Do you have any suggestions for handling file uploads in this case?

Have a look at other endpoints that upload files, for example this one:

payload: FetchDataFormPayload = Depends(FetchDataForm.as_form),

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

Successfully merging this pull request may close these issues.

2 participants