-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
ENH: registry to find SIA v2 services #422
Conversation
e00456d
to
8ad9c5e
Compare
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.
As a minimal implementation, that's fine. However, with the SIA2 standard id, we'll have to be a bit more careful, as what we really need to test against is LIKE 'ivo://ivoa.net/std/sia#query-2.%', since we'll want to cover later minor versions, too. At this point, this doesn't matter, and it'll certainly be years until that becomes an issue (no real plans for SIA 2.1 at this point). I think I'll tackle the whole image question before the next release, and I'll be happy to implant the minor version resilience at that point.
I'll open an issue about the minor versioning. Also, I'm not sure we fully cover all cases, as e.g we use Another potential issue could be the case sensitivity in the code vs the standard id ( Anyway, I think we are not introducing any new bugs with this PR but fix some previous problems, so I would like to go ahead and merge and fix the remaining things in follow-ups. |
8ad9c5e
to
4f9dfce
Compare
On Tue, Feb 21, 2023 at 11:13:14AM -0800, Brigitta Sipőcz wrote:
I'll open an issue about the minor versioning. Also, I'm not sure
we fully cover all cases, as e.g we use `#` as a separator for a
few places in the code, therefore could potentially miss out the
distinction between sia and sia2. However, during testing I didn't
really trigger those parts of the code.
I'm pretty sure the hash is never used as a separator where these
standardIDs might turn up. Of course, there's always the possibility
of... let's say a form of myopia, but I'd be rather relaxed about
this part.
Another potential issue could be the case sensitivity in the code
vs the standard id (`ivo://ivoa.net/std/sia#query-2...` vs
`ivo://ivoa.net/std/SIA#query-2...`
This is covered by RegTAP, which guarantees that all these
identifiers are lowercased on ingestion into the database; hence, on
the registry side, we only see them lowercased.
Case-insensitivity is still evil, and *if* we ever fetch these
identifiers from, say, capability documents, we will have to do some
sort of case folding.
Anyway, I think we are not introducing any new bugs with this PR
but fix some previous problems, so I would like to go ahead and
merge and fix the remaining things in follow-ups.
Sure. Thanks!
|
Codecov Report
@@ Coverage Diff @@
## main #422 +/- ##
=======================================
Coverage 79.81% 79.81%
=======================================
Files 52 52
Lines 5989 5989
=======================================
Hits 4780 4780
Misses 1209 1209
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I suppose these were lines where I wondered whether it would do what we want for SIA2, where the hash is part of the standardid, rather than to indicate the version of the same service, but then the line was never really used during the tests, so I didn't dive into more details. https://github.com/astropy/pyvo/blob/main/pyvo/registry/regtap.py#L311 |
Tests are now all happy, so I go ahead and merge and open follow-up issues to track the potential problems we identified. |
On Tue, Feb 21, 2023 at 12:25:02PM -0800, Brigitta Sipőcz wrote:
I suppose these were lines where I wondered whether it would do
what we want for SIA2, where the hash is part of the standardid,
rather than to indicate the version of the same service, but then
the line was never really used during the tests, so I didn't dive
into more details.
https://github.com/astropy/pyvo/blob/main/pyvo/registry/regtap.py#L311
https://github.com/astropy/pyvo/blob/main/pyvo/registry/regtap.py#L338
Oh dear... I was overconfident again.
The code (which is there to support auxiliary capabilities as per
https://ivoa.net/documents/discovercollections/20190520/index.html)
assumes that incompatible standards have different StandardsRegExt
records and hence different ivoids, which they *really* should.
I clearly have not paid attention to that for SIAv2, and neither has
anyone else. So, SIAv1 and SIAv2 use the same (basic) standard id.
But the fragments aren't supposed to distinguish major versions.
Ouch.
Well, that milk is spilled; there's no way we can fix the identifiers
now. I'll try to come up with some workaround.
|
As long as the SIA cases are the only one, we can simply add a conditional for them in the code. Anyway, I opened #425 as getting more test coverage may likely smoke out edge cases like these. |
So, this does the bare minimum, e.g. making it possible to search for SIA v2 services (the tricky part was to figure out the case sensitivity for the spelling of the service type, anyway).
The missing part from this PR is to make
servicetype='image'
to return both SIA and SIA2 services. As currently there is a one-on-one mapping in SERVICE_TYPE_MAP, I'm waiting for input if you have suggestions on how to resolve this without going brute force and start looping through them if there are multiple values provided.Closes #397