Skip to content

docs(connectors): update_resource_acl Python samples use keyword fields, not request= (OSS-118) - #407

Open
adityamishra-hydradb wants to merge 4 commits into
mainfrom
adityamishra/oss-118-update-resource-acl-python
Open

adityamishra-hydradb wants to merge 4 commits into
mainfrom
adityamishra/oss-118-update-resource-acl-python

Conversation

@adityamishra-hydradb

@adityamishra-hydradb adityamishra-hydradb commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

For humans

The Python samples for client.connectors.update_resource_acl passed request={...}. hydradb-sdk 2.1.8 (the latest) has no request argument, so every sample raised:

TypeError: ConnectorsClient.update_resource_acl() got an unexpected keyword argument 'request'

This PR changes the samples to the keyword fields that 2.1.8 takes: acl=[...] and custom_instructions="...".

  • essentials/v2/connectors.mdx: 3 calls (set an instruction, clear it, restrict a channel).
  • api-reference/v2/endpoint/update-connector-resource.mdx: the request example, plus one note: 2.1.7 and earlier take one request dict.
  • api-reference/v2/sdks.mdx: remove the stale "a connector resource update's request" note. The Python install line now asks for >=2.1.8.
  • snippets/cookbook-setup.mdx: same install floor.
  • scripts/requirements-test.txt: the examples test now runs against 2.1.8, the SDK users get today. With 2.1.7 the test passed the broken samples.
  • scripts/test_docs_examples.py: the fake API returns a typed body for PATCH /connectors/{id}/resources/{resource_id}. 2.1.8 parses that response into a model, and an empty {} fails the parse.

A grep over every non-archive page finds no other request=.

Overlap: none with open PRs. PR 400 (spec sync) and PR 372 touch other lines of the same files.

For agents

  • SDK signature, 2.1.7: update_resource_acl(self, id, resource_id, *, request: Dict[str, Any], request_options=None). 2.1.8: update_resource_acl(self, id, resource_id, *, acl=OMIT, custom_instructions=OMIT, request_options=None).
  • The validate job on main is red before this PR (app_knowledge examples, stale openapi.json). PR 400 fixes that. The pin bump makes the 2.1.8 drift visible in the same job: 4 cookbooks that send app_knowledge now fail too, because 2.1.8 removed that argument (see Proof, section 3).
  • Linear: OSS-118.

Proof

A = base main @ 484c1ce / B = this PR @ 2567536

Audit re-run on 2026-12-04 (03:00 to 03:20 UTC) on the current head. Node 24.11.0 (the .node-version pin), Python 3.12, clean venvs with the scripts/requirements-test.txt packages. Raw outputs: ~/hydradb/dogfood/proof/mintlify-docs-407/.

1. A/B on the real repro: the changed samples on prod

Command: python -I scripts/run_samples.py <A|B> (each sample as written on the page; connector_id is a UUID that does not exist, because the test org has no connector). File: samples-prod.txt. The script also records the request body that went on the wire.

Sample, hydradb-sdk 2.1.8 (latest on PyPI) A (base @484c1ce) B (PR @2567536)
connectors.mdx L421, set an instruction TypeError: … unexpected keyword argument 'request', no request sent reaches the API: 404 connector not found (rid d8cbf0d5-e7e2-4c0d-9783-dcad144650ad)
connectors.mdx L428, clear the instruction TypeError (same) 404 (rid b7cf808d-e3ff-44f5-a553-a519c1a3dce7)
connectors.mdx L580, restrict a channel TypeError (same) 404 (rid d8fde980-f3ac-4487-9b60-d2601eabd1c8)
update-connector-resource.mdx L12 TypeError (same) 404 (rid 5146ac02-f633-4ef7-b3d9-42edb2b675da)

The 200 path is not run on prod (no connector in the test org). The body that B sends is byte-for-byte the body that the A text sends with SDK 2.1.7, for example {"acl":["[email protected]"]} and {"custom_instructions":""}. The docs test fake also checks the body against the spec (section 2).

2. Regression: the CI validate steps

Command: docs-ci.sh <venv> runs the CI steps in order: verify_v2_public_contract.py, test_v2_schema_types, test_docs_consistency.py, unittest discover -s scripts -p 'test_*.py', verify_agents_endpoints.py, generate_llms_index.py --check, pnpm mintlify validate, pnpm mintlify broken-links. Files ci-A-484c1ce-sdk2.1.7.txt, ci-A-484c1ce-sdk2.1.8.txt, ci-B-2567536-sdk2.1.8.txt.

Step A (base @484c1ce), SDK 2.1.7 (CI pin today) A (base @484c1ce), SDK 2.1.8 B (PR @2567536), SDK 2.1.8 (new pin)
Contract + schema + consistency tests pass (4 + 11) pass pass
unittest discover -s scripts (43 tests) 12 failing subtests 28 failing (8 failures, 20 errors) 15 failing (7 failures, 8 errors)
The 3 request= blocks + the endpoint example pass on 2.1.7 fail (TypeError) pass
verify_agents_endpoints.py, generate_llms_index.py --check pass pass pass

validate is red on main too (CI run on 484c1ce, job validate: failure). The 12 failures on A are app_knowledge samples and the stale openapi.json (PR 400). B keeps those 12 (11 subtests plus the summary subtest) and adds 4 cookbooks (chief-of-staff, competitive-intelligence, glean, personal-assistant): TypeError: unexpected keyword argument 'app_knowledge'. That is the 2.1.8 pin making a real break visible. Those cookbooks also fail for users on the latest SDK today. This PR does not change them.

3. Smoke: build and links

Check A (base @484c1ce) B (PR @2567536)
pnpm mintlify validate build validation passed build validation passed
pnpm mintlify broken-links no broken links found no broken links found
request= in non-archive .mdx 4 0
CI hygiene, Mintlify link-rot, deployment - pass on 2567536

4. Stress

N/A: a docs change. Nothing touches load, limits or batching.

5. Edge cases

Case A (base @484c1ce) B (PR @2567536)
Clear an instruction with an empty string TypeError on 2.1.8 sends {"custom_instructions":""} (404 as expected)
A user on SDK 2.1.7 runs the samples the A text works (404 as expected) the B text raises TypeError (… custom_instructions/acl). The page now says 2.1.8 or later, and the install lines say >=2.1.8

🤖 Generated with Claude Code

…ate_resource_acl (OSS-118)

hydradb-sdk 2.1.8 removed the request dict from
ConnectorsClient.update_resource_acl, so the Python samples raised
TypeError. Use the keyword fields, drop the stale request note in
sdks.mdx, raise the Python install floor and the test pin to 2.1.8, and
give the test fake a typed response for the resource PATCH.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: adityamishra-hydradb <[email protected]>
@adityamishra-hydradb

Copy link
Copy Markdown
Contributor Author

@hydra-mira-review review

@mintlify

mintlify Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
cortex-ai 🟢 Ready View Preview Dec 4, 2026, 2:10 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@adityamishra-hydradb

Copy link
Copy Markdown
Contributor Author

/devin review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Starting Devin Review.

Devin Review

@hydra-mira-review

hydra-mira-review Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Mira score 5/5 · 🟢 Good to merge

  • No findings, nothing missing outside this PR, and no high-risk change.

Python users get connector update examples aligned with SDK version 2.1.8. The PR replaces request dictionaries with keyword fields, raises the SDK version floor, and updates example tests.

How this PR works · 3 changes, 3 low risk

Python connector examples fail before sending a request with the current SDK. They pass a request argument that hydradb-sdk 2.1.8 no longer accepts. This PR uses keyword fields, raises the documented SDK minimum, and updates test responses for the newer SDK models.

1. Require Python SDK 2.1.8 for the documented examples · 🟢 low risk · scripts/requirements-test.txt +2

Readers are directed to a release that supports the revised examples. Installation guidance raises the minimum from 2.1.7 to 2.1.8; shared tests change their exact pin.

Risk: An incompatible SDK release makes copied examples or shared documentation checks fail with argument or response-model errors.

Check:

  • Check cookbook signature compatibility across all six cookbooks, since the shared pin changes their SDK too.

In requirements-test.txt:1, sdks.mdx:11-17, cookbook-setup.mdx:4.

2. Pass resource instructions and ACLs as Python keyword fields · 🟢 low risk · api-reference/v2/endpoint/update-connector-resource.mdx +2

Readers can set instructions, clear them, and restrict a channel using the current Python SDK. Four update_resource_acl examples replace request dictionaries with custom_instructions or acl keyword arguments.

Risk: Readers using an incompatible call signature receive a TypeError before their resource instructions or access rules change.

Check:

  • Check that clearing instructions sends custom_instructions="" rather than omitting the field.
  • Check that the ACL example sends only acl=["[email protected]"].

Why: The endpoint note explains the older calling convention, and the SDK guide removes its stale reference to the Python request map.

In update-connector-resource.mdx:9-18, connectors.mdx:421-430, connectors.mdx:580-582 and 1 more.

  1. Supporting changes · 🟢 low risk · tests in test_docs_examples.py:232-247, test_cookbooks.py:131-152.
Requirement check · 6 met · from the PR description
  • ✅ Replace the three connector-guide calls with keyword fields for setting instructions, clearing instructions, and restricting a channel (met). essentials/v2/connectors.mdx uses custom_instructions, an empty string, and acl in the three calls.
  • ✅ Update the endpoint example and document the older SDK calling convention (met). api-reference/v2/endpoint/update-connector-resource.mdx uses a keyword argument and distinguishes SDK 2.1.8 from 2.1.7 and earlier.
  • ✅ Remove the stale Python request-map guidance and raise both Python installation minimums (met). api-reference/v2/sdks.mdx removes the map reference; it and snippets/cookbook-setup.mdx require hydradb-sdk>=2.1.8,<3.
  • ✅ Use SDK 2.1.8 for executable-example tests (met). scripts/requirements-test.txt pins 2.1.8, and the CI validate job installs that requirements file.
  • ✅ Return a model-compatible resource-update response from the fake API (met). FakeHydraDB.respond returns connector_id and resource_id for the resource-update route.
  • ✅ Leave no request= calls on non-archive documentation pages (met). The repository's .mdx pages contain no request= assignments.
⚠️ Other open PRs change the same code · 1

Merge them in order, or check that they agree.

  • #409 (merge-conflict risk). Both update the SDK test requirements and documentation sample validators, creating a likely collision in the testing changes. Shared: scripts/requirements-test.txt, scripts/test_cookbooks.py, scripts/test_docs_examples.py

Comment @hydra-mira-review help for commands.

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

✅ Mintlify Hygiene

No issues found.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

2.1.8 parses every response into a model with required fields, so the
empty canned bodies for discover, configure, connector update, provider
list, metadata schema and database status failed to parse. Fill in the
required fields (all declared in the checked-in spec).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: adityamishra-hydradb <[email protected]>
@adityamishra-hydradb

Copy link
Copy Markdown
Contributor Author

@hydra-mira-review review

@adityamishra-hydradb

Copy link
Copy Markdown
Contributor Author

/devin review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Starting Devin Review.

Devin Review

hydra-mira-review[bot]

This comment was marked as resolved.

…-sdk 2.1.8 requires

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: adityamishra-hydradb <[email protected]>
@adityamishra-hydradb

Copy link
Copy Markdown
Contributor Author

@hydra-mira-review review

@adityamishra-hydradb

Copy link
Copy Markdown
Contributor Author

/devin review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Starting Devin Review.

Devin Review

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: adityamishra-hydradb <[email protected]>
@adityamishra-hydradb

Copy link
Copy Markdown
Contributor Author

@hydra-mira-review review

@adityamishra-hydradb

Copy link
Copy Markdown
Contributor Author

/devin review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Starting Devin Review.

Devin Review

This branch was successfully deployed

1 active deployment
staging — b0c5672a Deployed Dec 4, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant