-
Notifications
You must be signed in to change notification settings - Fork 66
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(api/registry, api/search, api/version): add api endpoints to get closer to command line functionality #475
Conversation
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 u promise to write tests for this stuff in the near future I think this is good to merge 😸.
if err != nil { | ||
return err | ||
} | ||
if err = act.permission(ref); err != nil { |
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.
the "permission" check should be dropped. "permission" checks to see if this peer owns the dataset in question, but peers should be able to check the status of datasets they don't own.
repo/actions/registry.go
Outdated
@@ -42,6 +42,21 @@ func (act Registry) Unpublish(ref repo.DatasetRef) (err error) { | |||
return cli.DeleteDataset(ref.Peername, ref.Name, ds.Encode(), pub) | |||
} | |||
|
|||
// Status checks to see if a dataset is published to a repo's specific registry | |||
func (act Registry) Status(ref repo.DatasetRef) (err error) { |
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.
I like it. In the near future registries are going to get an upgrade where they can also pin, and we'll have to modify this func to return the status of two things:
- if a given ref is published to the registry (what it's currently doing)
- if that given ref is pinned to the registry (commng soon)
For now this is a great starting point.
We need an api endpoint that will allow users to publish, unpublish, and check the status of their datasets with reference to the registry. The format will be consistant with the other endpoints: `/registry/peername/datasetname@id/network/hash` You check the registry by making a `GET` request You publish to the registry by making a `PUT` or `POST` request You unpublish from the registry by making a `DELETE` request
…npublish endpoints also, this commit also plumbs the `Status` function from repo/registry, to lib/registry, to api/registry currently, the response is coming back with errors, using the `GET` method on the `/registry/` endpoint is disabled for now. need to dive into the registryServer, but want to tackle search before flipping back to registry
260affa
to
c62af8a
Compare
So there was a point when the search response actually responsed with the correct search value. Now it's returning with an empty data field. Definitely need to figure out why, but I've been spending too much time on this and I want to progress, so for now keeping the weirdness.
…ta/structure/etc info on add also adding back checking responses for mime/multipart file tests
now that you can init from a dataset file (as well as a body file) from the api, like you can on the command line, I've added a test that ensure just that. This has cascading effects on later tests, this commit adjusts those tests.
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.
☝️ ☝️ 👇 👇 👈 👈 👉 👉
close #474