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

Symmetry of RPC and HTTP APIs #1472

Closed
orpheuslummis opened this issue May 9, 2023 · 0 comments · Fixed by #1839
Closed

Symmetry of RPC and HTTP APIs #1472

orpheuslummis opened this issue May 9, 2023 · 0 comments · Fixed by #1839
Assignees
Labels
area/api Related to the external API component
Milestone

Comments

@orpheuslummis
Copy link
Contributor

orpheuslummis commented May 9, 2023

DefraDB offers HTTP and RPC APIs to do the non-GraphQL DB operations. The HTTP one is necessary to provide a conventional GraphQL endpoint.

There should be symmetry between RPC and HTTP APIs. It would allow more clarity and flexibility of API consumption. Additionally, DefraDB's language clients would be simplified to mostly a thin layer over autogenerated gRPC code.

Note 1: It may be additionally possible to offer the GraphQL endpoint via RPC as well. This can be another issue after this one.
Note 2: Offering documentation for the RPC API on the documentation website can be tracked in another issue. The issue to track HTTP documentation is #510
Note 3: This excludes p2p RPC surface area.

@orpheuslummis orpheuslummis added the area/api Related to the external API component label May 9, 2023
@orpheuslummis orpheuslummis added this to the DefraDB v0.6 milestone May 9, 2023
@fredcarle fredcarle modified the milestones: DefraDB v0.6, DefraDB v0.7 Jul 4, 2023
@jsimnz jsimnz modified the milestones: DefraDB v0.7, DefraDB v0.8 Sep 18, 2023
nasdf added a commit that referenced this issue Oct 2, 2023
## Relevant issue(s)

Closes #1472
Closes #1507
Closes #1860 

## Description

This is a follow up to #1776

This PR adds a CLI implementation that implements the client.DB
interface and runs through the existing integration test suite.

- [x] Merge existing server config code
- [x] Refactor CLI to use new HTTP client
- [x] Remove `net/api` package
- [x] Remove `api/http` package
- [x] Lens tests are timing out in CI: fixed #1862
- [x] Code coverage is incorrectly reporting: fixed #1861
- [x] Flaky test causing failures: fixed #1912

Renamed Commands:
- `peerid` to `client peer info`
- `client p2pcollection` to `client p2p collection`
- `client replicator` to `client p2p replicator`
- `client schema list` to `client collection describe`

Removed Commands:
- `block get`
- `ping`
- `rpc`

Added Commands:
- `client collection create`
- `client collection delete`
- `client collection get`
- `client collection keys`
- `client collection update`
- `client tx create`
- `client tx discard`
- `client tx commit`
- `client schema migration up`
- `client schema migration down`
- `client schema migration reload`

**Notes for reviewers**:
- `.github` changes are merged from #1871
- `Makefile` most of these changes are also from #1871
- `docs/cli` ignore these changes, it will be updated next release
- sorry for all of the merge commits, I am working on learning rebase
flow

## Tasks

- [x] I made sure the code is well commented, particularly
hard-to-understand areas.
- [x] I made sure the repository-held documentation is changed
accordingly.
- [x] I made sure the pull request title adheres to the conventional
commit style (the subset used in the project can be found in
[tools/configs/chglog/config.yml](tools/configs/chglog/config.yml)).
- [x] I made sure to discuss its limitations such as threats to
validity, vulnerability to mistake and misuse, robustness to
invalidation of assumptions, resource requirements, ...

## How has this been tested?

`make test`

Specify the platform(s) on which this was tested:
- MacOS
shahzadlone pushed a commit to shahzadlone/defradb that referenced this issue Feb 23, 2024
## Relevant issue(s)

Closes sourcenetwork#1472
Closes sourcenetwork#1507
Closes sourcenetwork#1860 

## Description

This is a follow up to sourcenetwork#1776

This PR adds a CLI implementation that implements the client.DB
interface and runs through the existing integration test suite.

- [x] Merge existing server config code
- [x] Refactor CLI to use new HTTP client
- [x] Remove `net/api` package
- [x] Remove `api/http` package
- [x] Lens tests are timing out in CI: fixed sourcenetwork#1862
- [x] Code coverage is incorrectly reporting: fixed sourcenetwork#1861
- [x] Flaky test causing failures: fixed sourcenetwork#1912

Renamed Commands:
- `peerid` to `client peer info`
- `client p2pcollection` to `client p2p collection`
- `client replicator` to `client p2p replicator`
- `client schema list` to `client collection describe`

Removed Commands:
- `block get`
- `ping`
- `rpc`

Added Commands:
- `client collection create`
- `client collection delete`
- `client collection get`
- `client collection keys`
- `client collection update`
- `client tx create`
- `client tx discard`
- `client tx commit`
- `client schema migration up`
- `client schema migration down`
- `client schema migration reload`

**Notes for reviewers**:
- `.github` changes are merged from sourcenetwork#1871
- `Makefile` most of these changes are also from sourcenetwork#1871
- `docs/cli` ignore these changes, it will be updated next release
- sorry for all of the merge commits, I am working on learning rebase
flow

## Tasks

- [x] I made sure the code is well commented, particularly
hard-to-understand areas.
- [x] I made sure the repository-held documentation is changed
accordingly.
- [x] I made sure the pull request title adheres to the conventional
commit style (the subset used in the project can be found in
[tools/configs/chglog/config.yml](tools/configs/chglog/config.yml)).
- [x] I made sure to discuss its limitations such as threats to
validity, vulnerability to mistake and misuse, robustness to
invalidation of assumptions, resource requirements, ...

## How has this been tested?

`make test`

Specify the platform(s) on which this was tested:
- MacOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Related to the external API component
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants