Repository navigation
Conversation
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
There was a problem hiding this comment.
👀 2 findings need your review
Devin reviewed all 2 findings on 521f302 and left them for you. Click a finding below to jump to its comment.
For your review (2)
| def test_client_methods_match_section_4_2( | ||
| clients: tuple[Zep, AsyncZep], | ||
| client_type: type[Zep] | type[AsyncZep], | ||
| operation: str, | ||
| method: str, | ||
| path: str, | ||
| paginated: bool, | ||
| post_read: bool, | ||
| ) -> None: | ||
| sync, async_client = clients | ||
| client = sync if client_type is Zep else async_client | ||
| assert callable(_resolve_method(client, operation)) |
There was a problem hiding this comment.
There was a problem hiding this comment.
I did not change the test. Spec 3 section 18.5 requires that the generated namespaces and method names match section 4.2, and this test checks that requirement. The routes come from the v4 OpenAPI document, and Fern copies them to the generated code. The zep-proprietary test sdk-compat/tests/test_coverage.py::test_v4_chi_and_openapi_paths_match (section 14.3) checks that the OpenAPI paths match the server routes. A route check for each of the 167 operations in this file would duplicate that check. The HTTP method and path columns stay in the table as reference data for the mock-server tests.
| for client in (sync, async_client): | ||
| hints = typing.get_type_hints(client.thread.get_context) | ||
| if "recency_bias" in hints: |
There was a problem hiding this comment.
There was a problem hiding this comment.
I did not change the test. Spec 3 section 7.4 makes recency_bias on thread context conditional: the operation accepts the preset only when recency-aware auto-search ships in v3. The current v4 OpenAPI document gives GET /threads/{thread_uuid}/context only the template_uuid query parameter. Thus an absent parameter is correct for the current contract. When the parameter is present, the test requires the off, mild, strong string enum, which is the requirement of section 18.5.
Spec 3 section 4.2 no longer marks agent.learning.get as P, because the endpoint returns one AgentLearningState and has no cursor. This commit removes the D5 expected failure.
Spec 3 section 4.2 will classify agent.split.plan as a POST read. The test now expects no idempotency option for it. The operation is absent from 4.0.0-alpha.5, so the test stays a strict expected failure on that version.
…otency xfails at ZEPAI-3750 The generated SDKs use only the project API-key scheme, and the bearer-only ABAC operations are outside the SDK audience (spec 3 section 14.1). Thus the bearer test checked a boundary that the SDK does not promise. Automatic Idempotency-Key generation is a post-GA follow-up in ZEPAI-3750.
Summary
This PR adds hand-written contract tests for the generated v4 Python SDK. The tests check spec 3 section 18.5 and the generated-code requirements of sections 14.2 and 14.6 (ZEPAI-3706).
.fernignoreliststests/contract/, so Fern does not overwrite the tests.tests/contract/test_generated_contract.pyholds a table of the spec 3 section 4.2 endpoint map (SDK method, HTTP method, path,P, POST read). The tests check these items onZepandAsyncZep:/abacand docs-audience operations are absent.Pmethod returnsSyncPagerorAsyncPager. Withhttpx.MockTransport,batch.list(GET) anduser.list(POST read) iterate two pages, sendcursor=c1on the second request, stop on the page withoutnext_cursor, and return each item one time.idempotency_keyparameter. A caller key is sent unchanged and is sent again on a retry after a 503.project.getanduser.listsend noIdempotency-Key.Authorization: Api-Key <key>.graph.get_contextrecency_biasis the string enumoff,mild,strong.thread.get_contextdoes not type it as an object.zep_cloud.coreand the ontology DSL containslastn,uuid_cursor,group_id, orscope.The table does not mark
agent.learning.getasP. https://github.com/getzep/zep-proprietary/pull/6715 removes that mark from spec 3 section 4.2, because the endpoint returns oneAgentLearningStateand has no cursor.The existing
tests/ontology/tests run against the v4 client without a change.Local result:
pytest tests/contract tests/ontology: 431 passed, 353 expected failures.mypypassed.ruff checkandruff format --checkpassed on the new file.Expected failures
Each expected failure is strict. When a later generation fixes the gap, the test fails and tells the developer to remove the entry. The
v4branch holds the 4.0.0-alpha.5 code, which is older than the current spec 3 contract on zep-proprietarymain. These are the open gaps:agent.split.planas a POST read, because spec 3 section 4.2 will classify it as a read (https://github.com/getzep/zep-proprietary/pull/6715). The operation is absent from alpha.5, so its test is a strict expected failure on that version.4.0.0-alpha.5.Idempotency-Key. The generator configuration does not enable automatic key generation, and the pinned Fern toolchain cannot enable it. https://github.com/getzep/zep-proprietary/pull/6716 gives the documentation sources. This gap is a post-GA follow-up and does not block GA: the server accepts a write without a key, and the fix does not change a method signature.CI and release gate
The
ci.ymlworkflow of this repository runs the full test command on every pull request, so it runs the new tests. The zep-proprietarySDK Releaseworkflow runsgh pr checkson each generated SDK pull request and stops the release on a failed or pending check. Thus a regeneration that breaks these tests stops the release.https://github.com/getzep/zep-proprietary/pull/6716 maps these tests in
docs/specs/api/test-coverage.yamlunder sections 14.2, 14.6, and 18.5.Changes after the adversarial review
Invariants
None
Required configs
None