-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add support for LINC staging and production APIs #1519
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1519 +/- ##
===========================================
- Coverage 88.58% 68.01% -20.57%
===========================================
Files 78 78
Lines 10589 10562 -27
===========================================
- Hits 9380 7184 -2196
- Misses 1209 3378 +2169
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
), | ||
"linc-staging": DandiInstance( | ||
"linc-staging", | ||
"https://staging.lincbrain.org", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @aaronkanzer, it looks like https://staging.lincbrain.org isn't able to resolve again. Not sure if we changed anything. See screenshot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kabilar -- it seems that SSL support isn't provided out-of-the-box for the branch deploys URLs in Netlify
Firefox and Chrome require the SSL enforcement, but if you use Safari, you can proceed without the SSL -- didn't want to disturb the peace here with changing the SSL cert, so didn't update anything for now
# try: | ||
# minversion = Version(server_info.cli_minimal_version) | ||
# bad_versions = [Version(v) for v in server_info.cli_bad_versions] | ||
# except ValueError as e: | ||
# raise ValueError( | ||
# f"{url} returned an incorrectly formatted version;" | ||
# f" please contact that server's administrators: {e}" |
Check notice
Code scanning / CodeQL
Commented-out code Note
# if our_version < minversion: | ||
# raise CliVersionTooOldError(our_version, minversion, bad_versions) | ||
# if our_version in bad_versions: | ||
# raise BadCliVersionError(our_version, minversion, bad_versions) |
Check notice
Code scanning / CodeQL
Commented-out code Note
# if not server_schema_version: | ||
# raise RuntimeError( | ||
# "Server did not provide schema_version in /info/;" | ||
# f" returned {server_info!r}" |
Check notice
Code scanning / CodeQL
Commented-out code Note
# if server_schema_version != schema_version: | ||
# raise SchemaVersionError( | ||
# f"Server requires schema version {server_schema_version};" | ||
# f" client only supports {schema_version}. You may need to" | ||
# " upgrade dandi and/or dandischema." |
Check notice
Code scanning / CodeQL
Commented-out code Note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment for reference in another issue
@kabilar @yarikoptic @satra @waxlamp -- just did a full end-to-end test....and it works! It seems we should be safe to sunset I had to comment out some version validation code in the PR since my test branch isn't semantic versioned yet (e.g. if you look at the code, you'll see that those are commented out -- thus keeping in PR draft status for now). I figure once I get a review here on the relevant code, I can uncomment out the version validation. Here is how I confirmed that the branch was succcessful:
Prior to running any steps, I ran One other note: It seems that the authentication works as intended fortunately, so the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to hear that this might be all what is needed to support LINC!
From the quick review I do not see where is_private
even used, thus questioning on the need for it.
f" client only supports {schema_version}. You may need to" | ||
" upgrade dandi and/or dandischema." | ||
) | ||
# if not server_schema_version: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this block is commented out -- doesn't LINC provide /info/
with schema_version
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I was testing, my forked branch is technically tagged as a version of 0+untagged<some-sha-here>
thus I commented this out for testing purposes.
As noted in #1519 (comment) -- this will be commented back in once you et. al are happy with the core changes here
dandi/tests/test_dandiarchive.py
Outdated
@@ -441,7 +441,7 @@ def test_parse_dandi_url_unknown_instance() -> None: | |||
parse_dandi_url("dandi://not-an-instance/000001") | |||
assert str(excinfo.value) == ( | |||
"Unknown instance 'not-an-instance'. Valid instances: dandi," | |||
" dandi-api-local-docker-tests, dandi-staging" | |||
" dandi-api-local-docker-tests, dandi-staging, linc, linc-staging" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be worth right away to compose this from known_instances
to avoid hardcoding. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just the unit test case -- in the prod. code it isn't hard-coding
Did you have in-mind the hard-coding being removed in the unit test here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeap. I see no reason to hardcode them in the test here. The purpose is to test to see that all are listed in the particular order. Code could be used to provide that and avoid future edits happen we need to add one more instance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on this note, chime in to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeap. I see no reason to hardcode them in the test here. The purpose is to test to see that all are listed in the particular order. Code could be used to provide that and avoid future edits happen we need to add one more instance
Updated the test here
Awesome -- yeah, I kept the I've removed it in my most recent commit -- Cc @jwodder |
Just confirming, we are asking users to declare the API key for LINC using the |
# ) | ||
# if server_schema_version != schema_version: | ||
# raise SchemaVersionError( | ||
# f"Server requires schema version {server_schema_version};" | ||
# f" client only supports {schema_version}. You may need to" | ||
# " upgrade dandi and/or dandischema." | ||
# ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# ) | |
# if server_schema_version != schema_version: | |
# raise SchemaVersionError( | |
# f"Server requires schema version {server_schema_version};" | |
# f" client only supports {schema_version}. You may need to" | |
# " upgrade dandi and/or dandischema." | |
# ) | |
) | |
if server_schema_version != schema_version: | |
raise SchemaVersionError( | |
f"Server requires schema version {server_schema_version};" | |
f" client only supports {schema_version}. You may need to" | |
" upgrade dandi and/or dandischema." | |
) |
# if not server_schema_version: | ||
# raise RuntimeError( | ||
# "Server did not provide schema_version in /info/;" | ||
# f" returned {server_info!r}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# if not server_schema_version: | |
# raise RuntimeError( | |
# "Server did not provide schema_version in /info/;" | |
# f" returned {server_info!r}" | |
if not server_schema_version: | |
raise RuntimeError( | |
"Server did not provide schema_version in /info/;" | |
f" returned {server_info!r}" |
@yarikoptic @jwodder -- mind doing another re-review? Do you want me to uncomment out the version validation code first? (I made this Issue to observe this workaround for now -- #1526) Thanks in advance |
@yarikoptic @jwodder @kabilar -- closing this Issue because of the release tagging missing in this fork -- #1527 should be the code merged -- thanks again @jwodder |
Relates to #1517 -- please reference #1527
Cc @kabilar -- still very much in draft mode as I need to evaluate the scope of failing tests across the DANDI ecosystem