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

Update README #38

Merged
merged 31 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
4aed185
Move contributor info to separate file and add outline for readme
emily-emily Jul 18, 2024
fb18865
added sample code for serverless index creation + headers
ericapywang Jul 23, 2024
b26b60d
change headers
ericapywang Jul 23, 2024
d86d3d8
add syntax highlighting
ericapywang Jul 23, 2024
e85cbec
add examples for rest of control plane
ericapywang Jul 23, 2024
ad97888
added some code for data plane
ericapywang Jul 23, 2024
5701196
fix build error
ericapywang Jul 23, 2024
c25532f
add rest of data plane
ericapywang Jul 23, 2024
85b0d12
added collections operations
ericapywang Jul 23, 2024
2ff98ba
added match statement to sample code
ericapywang Jul 23, 2024
35e97f7
Update docstrings to use ? instead of unwrap
emily-emily Jul 24, 2024
38a1931
Make response variable names consistent
emily-emily Jul 24, 2024
f6b843f
add some descriptions
ericapywang Jul 24, 2024
a2eec1a
Update commit reference for submodule
emily-emily Jul 24, 2024
45b49a6
add rest of data plane descriptions
ericapywang Jul 24, 2024
4540a02
pull changes
ericapywang Jul 24, 2024
1fc262e
fix compile issue
ericapywang Jul 24, 2024
7b24180
descriptions for collection operations
ericapywang Jul 24, 2024
9d70f53
reformatted some docstrings
ericapywang Jul 24, 2024
61f9769
split metadata builder into two lines
ericapywang Jul 24, 2024
d60fd20
add link to contribution guide
ericapywang Jul 24, 2024
629e293
add usage instructions
ericapywang Jul 24, 2024
88c3901
Add link to apis repo readme
emily-emily Jul 29, 2024
a0be65b
Merge branch 'main' into emily/update-readme
emily-emily Jul 29, 2024
7e1e58d
updated configure index docs
ericapywang Jul 29, 2024
aba3d08
Merge branch 'main' into emily/update-readme
ericapywang Jul 30, 2024
6c526db
Update CONTRIBUTING for updated justfile
emily-emily Jul 30, 2024
e347278
try to fix test case
ericapywang Jul 30, 2024
22aa9f3
Update version specificity and detail on apis submodule
emily-emily Jul 30, 2024
6ec0ab8
Merge branch 'main' into emily/update-readme
emily-emily Jul 31, 2024
7470286
try to fix failing data test
ericapywang Aug 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Contributing guide

## Local development

- [Internal Asana backlog](https://app.asana.com/0/1207449888227387/1207449824366220)
emily-emily marked this conversation as resolved.
Show resolved Hide resolved

### 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, but it can be regenerated by following these steps.

You will require access to the `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`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm developer experience if someone doesn't have access to our apis repo -- Are they still able to contribute fixes? They just couldn't run the build-protos step, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that's the case, yeah. We should make that explicit in the documentation (I'm working on the same thing in Go atm for the CONTRIBUTING.md).

My understanding is since we check in the generated code, and there's no dependency on the submodule for general development, this shouldn't hinder folks who are looking to submit changes publicly.


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
72 changes: 72 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
name = "pinecone-sdk"
version = "0.1.0"
edition = "2021"
description = "Pinecone Rust SDK"
repository = "https://github.com/pinecone-io/pinecone-rust-client"
rust-version = "1.78.0"
readme = "./README.md"
license = "Apache-2.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -24,6 +28,7 @@ serde = { version = "^1.0", features = ["derive"] }
url = "^2.5"
uuid = { version = "^1.8", features = ["serde", "v4"] }
reqwest = { version = "^0.12", features = ["json", "multipart"] }
serial_test = "3.1.1"
emily-emily marked this conversation as resolved.
Show resolved Hide resolved
emily-emily marked this conversation as resolved.
Show resolved Hide resolved

[dev-dependencies]
temp-env = "0.3.6"
Expand Down
Loading
Loading