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

Use API link to download datasets #13681

Merged

Conversation

davelopez
Copy link
Contributor

Fixes #13679

Since the history_id in /api/histories/{history_id}/contents/{history_content_id}/display is only really used in the path for consistency with other history contents endpoint, I made it optional, removed the parameter from the service and added a route alias for /api/datasets/{history_content_id}/display.

Now the download links in both legacy and new history use the API link.

How to test the changes?

  • 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

Since the `history_id` is really only used for consistency with other history contents routes, we can make it optional and create a route alias for the datasets API
@bgruening
Copy link
Member

Do we have a download test?

Comment on lines +197 to +201
@router.get(
"/api/datasets/{history_content_id}/display",
summary="Displays (preview) or downloads dataset content.",
response_class=StreamingResponse,
)
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should work, but then this route will appear under histories or the other one under datasets because I can not set a different tag for the alias right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the tag is not important, I'm happy to use the new alias parameter :)

@davelopez
Copy link
Contributor Author

Do we have a download test?

We do have some tests for the /api/histories/{history_id}/contents/{history_content_id}/display endpoint, this should be just an alias.

@jmchilton jmchilton merged commit 308db49 into galaxyproject:dev Apr 7, 2022
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.

Inaccessible datasets return 200 OK, rather than 403.
4 participants