Repository navigation
Revise proxy configuration, add integration testing - #325
Conversation
This reverts commit 9f5f036.
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 10042887 | Triggered | RSA Private Key | b9517f2 | tests/integration/proxy_config/.mitm/proxy1/mitmproxy-ca.pem | View secret |
| 10042888 | Triggered | RSA Private Key | b9517f2 | tests/integration/proxy_config/.mitm/proxy2/mitmproxy-ca.pem | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
| PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}' | ||
| urllib3_version: '${{ matrix.urllib3_version }}' | ||
|
|
||
| deps-cleanup: |
There was a problem hiding this comment.
This is not really related to the config changes, but keeps us from getting failures due to 20 index per-project limit.
| workflow_call: {} | ||
|
|
||
| jobs: | ||
| # setup-index: |
There was a problem hiding this comment.
Leaving this commented code in as I have plans to bring back CI integration tests in a future PR.
| @@ -0,0 +1,20 @@ | |||
| -----BEGIN CERTIFICATE----- | |||
There was a problem hiding this comment.
All of these cert / key things are generated by mitmproxy.
austin-denoble
left a comment
There was a problem hiding this comment.
Thanks for putting so much effort into this, I think what you've learned working on the implementation here will help us across the board. Overall this all looks good to me, thanks for adding test coverage generally. 🚢
| ### Proxy configuration | ||
|
|
||
| If your network setup requires you to interact with Pinecone via a proxy, you will need | ||
| to pass additional configuration using optional keyword parameters. These optional parameters are forwarded to `urllib3`, which is the underlying library currently used by the Pinecone client to make HTTP requests. You may find it helpful to refer to the [urllib3 documentation on working with proxies](https://urllib3.readthedocs.io/en/stable/advanced-usage.html#http-and-https-proxies) while troubleshooting these settings. |
There was a problem hiding this comment.
Nice docs-touch referring folks out to urllib3 👍
| # an openapi_config object and a kwarg for the same setting, | ||
| # the kwarg will take precedence. |
There was a problem hiding this comment.
I may be reading this incorrectly, but it doesn't look like we're doing anything with kwargs here or in build?
Is the comment meant to be referencing overriding openapi_config with config?
There was a problem hiding this comment.
The config object is built using kwarg values (specifically PineconeConfig.build called from the Pinecone constructor). Sorry it's not more clear. Things get confusing when trying to manage and merge these different sources of configuration, which is a big reason I want to deprecate passing openapi_config.
| } | ||
| } | ||
|
|
||
| def docker_command(proxy): |
There was a problem hiding this comment.
Nice work getting all of this set up, thank you.
* 'main' of github.com:pinecone-io/pinecone-python-client: [skip ci] Bump version to v4.1.0 Bump tqdm from 4.66.1 to 4.66.3 (pinecone-io#344) Bump idna from 3.4 to 3.7 (pinecone-io#345) Bump jinja2 from 3.1.3 to 3.1.4 (pinecone-io#343) Add better error messages for mistaken `from_texts` and `from_documents` (pinecone-io#342) Support proxy_url and ssl_ca_certs options for gRPC (pinecone-io#341) Remove serverless public preview warnings (pinecone-io#340) [skip ci] Bump version to v4.0.0 Improve upsert throughput by 3x (pinecone-io#334) Remove `merge` workflow and update `build-and-publish-docs` workflow to be manually runnable (pinecone-io#335) [skip ci] Bump version to v3.2.2 [Fix] openapi_config deprecation warning incorrectly shown (pinecone-io#327) Add grpc unit test run, expand testing of VectorFactory (pinecone-io#326) [skip ci] Bump version to v3.2.1 Allow clients to tag requests with a source_tag (pinecone-io#324) [skip ci] Bump version to v3.2.0 Revise proxy configuration, add integration testing (pinecone-io#325) [Fix] Configuring SSL proxy via openapi_config object (pinecone-io#321) Update README.md (pinecone-io#323)
… sites to 2026-07 (pinecone-io#292) (pinecone-io#328) Split from pinecone-io#174. Migrates the remaining integration modules whose index creation can be moved off the removed 2025-10 shape AND still execute under the 2026-07 document-schema gate (pinecone-io#322): - test_search.py, test_search_async.py: create(spec=IntegratedSpec(...)) -> create_for_model(). test_search_async.py also drops its raw-httpx workaround for IT-0003 (the SDK POSTing IntegratedSpec to /indexes), which create_for_model resolves; that helper had pinned X-Pinecone-Api-Version to 2025-10 against api.pinecone.io, bypassing the SDK entirely. - test_admin.py, test_imports.py, test_imports_async.py: dimension=/metric=/spec= -> schema=/deployment=. - New tests/integration/index_shapes.py holds the shared shapes instead of repeating the nested dicts per module. The other eleven modules named in pinecone-io#292 are migrated but held back: any index they create with schema= + deployment= and a user-named vector field is a documents-API index, so their whole data plane is refused server-side. Filed as pinecone-io#325 with the evidence chain; the choice of house pattern is a DECISION. Closes pinecone-io#292
…acy-index pattern (pinecone-io#325) (pinecone-io#424) 2026-07 has no way to create an index the vectors API will serve, so these four modules could not reach a single test — their fixtures raised PineconeTypeError on the legacy create kwargs. Per the pinecone-io#322 ruling, vector operations are intended to keep serving indexes created under earlier API versions, so the fixtures now come from legacy_index_factory (pinecone-io#363) instead of migrating to schema= + deployment=. Each index fixture calls assert_serves_vectors_api, and every test that reads live data now writes first and asserts upserted_count: on a document-schema index writes are refused but query/fetch/describe_index_stats succeed and return empty, so a read-only assertion is green and proves nothing. Query assertions are keyed by id, never by position (pinecone-io#368). The removed IndexModel .dimension/.metric/.vector_type assertions are replaced with schema assertions on the reserved _values / _sparse_values fields. Seven of the eleven modules pinecone-io#325 listed remain, filed as pinecone-io#419.
Problem
We want to expose proxy configuration fields as top-level config params and move away from users passing an
OpenApiConfigurationinstance withopenapi_config(as was done in 2.x versions of the sdk). Passing these objects is not something we documented or had shown as a named configuration param, but is something people assumed would work as a hangover from the way things were done in the old client.Currently OpenApi generated code is part of our implementation, but we may want to swap out something else in the future so it doesn't make sense to use this
OpenApiConfigurationobject as part of our public interface. And since the openapi config object also needs to be configured with api key and host, it competes with these other config params in a way that is pretty confusing.Solution
proxy_url,proxy_headers,ssl_ca_certs, andssl_verify.openapi_configencouraging them to use the new properties.Usage
This will work, but should emit a deprecation warning:
Future work
We will need to figure out how to deploy the mitmproxy elsewhere (cloud run?) before running tests in CI because Github Actions seems to have a lot of issues with running these docker containers and debugging the errors has proven quite difficult. While GHA can run docker containers, mounting a volume with the required certs causes the container to crash. I'm guessing this is some kind of file permissions issue, but don't have much visibility for debugging.
Type of Change
Test Plan
Run new tests locally with
PINECONE_API_KEY='foo' PINECONE_INDEX_NAME='bar' poetry run pytest tests/integration/proxy_config/ -s -v