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

feat: spec-compliant suffixes, with legacy support #46

Merged
merged 1 commit into from
Feb 28, 2023

Conversation

uniqueg
Copy link
Collaborator

@uniqueg uniqueg commented Feb 10, 2023

  • Multiple suffixes for the host URL are tried to support TES APIs hosted at standard and non-standard/legacy locations
  • The following suffixes are attempted, in order: /ga4gh/tes/v1 (TES >=0.4), /v1 (TES <0.4), / (i.e., no suffix; for non-standard locations)
  • In addition, for the service info endpoint, both the /service-info (TES >=0.5) and /tasks/service-info (TES <0.5) routes are attempted, in that order, with all suffixes, and in that order; i.e., /ga4gh/tes/v1/service-info, /v1/service-info, /service-info, /ga4gh/tes/v1/tasks/service-info, /v1/tasks/service-info, and finally /tasks/service-info
  • In case of a 404 response or any requests.exceptions.RequestException, the next path is tried; as soon as a non-404 response is received, no more paths are tried
  • If all attempts fail with a request exception, a requests.exceptions.HTTPError is raised, listing the error traces for each path
  • If at least one request succeeded, the response is evaluated as before (response.raise_for_status()) and - if no error is raised - returned; no request exceptions are logged in this case
  • A new section in the documentation explains the logic and rationale
  • Unit tests for new logic was added and existing tests updated, where necessary

Resolves #39
Resolves #40

@uniqueg uniqueg changed the base branch from master to release-0.5.0 February 10, 2023 23:50
@uniqueg uniqueg changed the title feat: spec-compliant routes, with legacy support feat: spec-compliant suffixes, with legacy support Feb 10, 2023
@kellrott
Copy link
Contributor

Tested against funnel. Looks good.

@kellrott kellrott merged commit 5379b2a into release-1.0.0 Feb 28, 2023
@uniqueg uniqueg deleted the api-location branch February 28, 2023 20:41
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.

Client uses non-standard server URL Service info access method assumes off-spec route
2 participants