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

Fix incorrect fields in info endpoint #1046

Merged
merged 4 commits into from
Apr 20, 2022
Merged

Fix incorrect fields in info endpoint #1046

merged 4 commits into from
Apr 20, 2022

Conversation

jjnesbitt
Copy link
Member

@jjnesbitt jjnesbitt commented Apr 20, 2022

Closes #1044

The test is pretty barebones but will ensure tests fail if the endpoint structure is modified.

This also fixes a typo in the DJANGO_DANDI_JUPYTERHUB_URL env var in dev/.env.docker-compose and dev/.env.docker-compose-native.

@jjnesbitt jjnesbitt added patch Increment the patch version when merged release Create a release when this pr is merged labels Apr 20, 2022
Copy link
Member

@mvandenburgh mvandenburgh left a comment

Choose a reason for hiding this comment

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

LGTM - just had one small suggestion

dandiapi/api/views/info.py Show resolved Hide resolved
Comment on lines +7 to +21
def test_rest_info(api_client):
resp = api_client.get('/api/info/')
assert resp.status_code == 200
assert resp.json() == {
'schema_version': settings.DANDI_SCHEMA_VERSION,
'schema_url': schema_url,
'version': versioneer.get_version(),
'cli-minimal-version': '0.14.2',
'cli-bad-versions': [],
'services': {
'api': {'url': settings.DANDI_API_URL},
'webui': {'url': settings.DANDI_WEB_APP_URL},
'jupyterhub': {'url': settings.DANDI_JUPYTERHUB_URL},
},
}
Copy link
Member

Choose a reason for hiding this comment

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

Since this endpoint is something that the CLI depends on, I think having a similar test as part of the CLI integration tests would be valuable (thoughts @jwodder @yarikoptic?)

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
Member Author

Choose a reason for hiding this comment

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

That's a really good point. I think adding a CLI Integration test is important, since that's what would break if we were to change this. We probably want to merge this as soon as possible, but that test could be added after the fact.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jwodder I see a couple of problems with that test

  1. We're not specifying the DANDI_REDIRECTOR_BASE environment variable currently, so this test is either skipped or tested against the currently deployed prod (not totally sure of the behavior from looking at that file). In either case, the current change isn't tested.
  2. Even if we did specify that env variable, this redirection doesn't happen locally, it only happens in Netlify, so the test would fail in that way.

We should probably at least add an almost identical test aimed at the locally spun up API instance, instead of prod.

@jjnesbitt
Copy link
Member Author

CLI Integration tests are failing, but they seem to be due to a prior change, not this one (evidenced by this same failure occurring prior to this PR here). It seems the integration tests need some additional work on top of this, per our conversation on this PR.

I'm going to merge this, since this is currently causing issue in prod, and these changes can be applied after the fact.

@jjnesbitt jjnesbitt merged commit 1075858 into master Apr 20, 2022
@jjnesbitt jjnesbitt deleted the 1044-server-info branch April 20, 2022 17:47
@dandibot
Copy link
Member

🚀 PR was released in v0.2.14 🚀

@dandibot dandibot added the released This issue/pull request has been released. label Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged release Create a release when this pr is merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Key names in /server-info response changed
4 participants