-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Problem Lacking detail in README and did not have a CONTRIBUTING file ## Solution This PR updates the README and adds a CONTRIBUTING file. Also updates some metadata in Cargo.toml ## Type of Change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update - [ ] Infrastructure change (CI configs, etc) - [x] Non-code change (docs, etc) - [ ] None of the above: (explain here) ## Test Plan Does not change functional code, all existing test cases pass. --------- Co-authored-by: Erica Wang <erica.py.wang@gmail.com>
- Loading branch information
1 parent
e511603
commit 7169a9f
Showing
8 changed files
with
593 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Contributing guide | ||
|
||
## Local development | ||
|
||
### Prerequisites | ||
|
||
- Install [homebrew](https://brew.sh/) if you haven't already | ||
- Install `brew install just`. just is a command line tool used to run commands defined inside the project `justfile`. You run commands by passing the command name, for example `just build-openapi`. | ||
|
||
### Clone the repository | ||
|
||
This repository relies on a git submodule to get access to our openapi spec. To clone the repository, use the command: | ||
|
||
``` | ||
git clone --recurse-submodules git@github.com:pinecone-io/pinecone-rust-client.git | ||
``` | ||
|
||
Or, if you have already cloned the repository, you can update the submodules with | ||
|
||
``` | ||
git submodule update --init --recursive | ||
``` | ||
|
||
### Generating code from OpenAPI and Proto specs | ||
|
||
The generated code is already checked into the repository and normally should not need to be modified. | ||
|
||
To regenerate OpenAPI or Protobuf code, you will require access to the private `apis` repository. | ||
- Follow setup instructions for the `apis` repository: [apis setup](https://github.com/pinecone-io/apis) | ||
|
||
OpenAPI | ||
|
||
- You need [Docker Desktop](https://www.docker.com/products/docker-desktop/) in order to generate code using openapi. Look at `codegen/build-oas.sh` to see how this is used. | ||
- Make sure Docker is running. | ||
- `just build-openapi` | ||
- References the spec files from the `codegen/apis` submodule | ||
- Outputs the generated code to `src/openapi` | ||
|
||
Protobuf | ||
- `brew install protobuf` | ||
- `cargo install protobuf-codegen` and add it to path: `PATH="$HOME/.cargo/bin:$PATH"` | ||
- `just build-proto` | ||
- References the spec files from the `codegen/apis` submodule | ||
- Outputs the generated code to `src/protos` | ||
|
||
Alternatively, you can run `just build-client` to regenerate both OpenAPI and Protobuf code. | ||
|
||
What the build process looks like in all cases: | ||
- Build the `apis` submodule to produce consolidated .yaml files in `codegen/apis/_build` | ||
- Create a `version.rs` file containing API version info based on the defined value in the justfile | ||
- Run build scripts for OpenAPI and/or Protobuf, propagating the API version | ||
|
||
### Build and run | ||
|
||
Build and run the project: | ||
- `cargo build` builds the project | ||
- `cargo test` builds the project and runs tests |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.