feat(box): upgrade SDK to 2.0.0, add pytest unit tests#277
feat(box): upgrade SDK to 2.0.0, add pytest unit tests#277Shubhank-Jonnada wants to merge 6 commits into
Conversation
- Bump autohive-integrations-sdk pin to ~=2.0.0 - Update all context.fetch() return values to access .data - Convert all error returns to ActionError(message=...) - Convert all success returns to ActionResult(data=..., cost_usd=0.0) - Remove "error" and "result" boolean fields from output schemas - Bump config.json version to 2.0.0 - Add box/tests/conftest.py and box/tests/test_box_unit.py (32 unit tests)
🔍 Integration Validation ResultsCommit: Changed directories:
✅ Structure Check output❌ Code Check output❌ Tests Check output✅ README Check output✅ Version Check output |
TheRealAgentK
left a comment
There was a problem hiding this comment.
LGTM. SDK 2.0.0 migration is clean — context.fetch().data, ActionError(message=...) everywhere, schema envelope fields removed, version bumped from 0.0.1 → 2.0.0. 32 unit tests across all 5 actions.
Local CI verified: validate_integration ✅, check_code ✅, ruff ✅, pytest ✅.
Follow-up tracked in #295 — please add a test_box_integration.py in a follow-up PR. Not blocking this merge.
Process nit: branch worktree-agent-* doesn't follow <type>/<issue#>/<desc> per AGENTS.md. Please follow the convention next time.
…ytest integration tests - Add pageToken support to list_files and list_folder_contents to silence config-code sync warnings - Replace manual asyncio test_box.py with pytest-style test_box_integration.py - Add BOX_ACCESS_TOKEN to .env.example
TheRealAgentK
left a comment
There was a problem hiding this comment.
Self-approved to remove the block, needs 3rd party review and then e-2-e test runs.
|
@Shubhank-Jonnada One finding when I ran an agentic review against the final PR was:
It was introduced in your second original commit. Could you please double-check the correctness of the integration code before finalising this? |
TheRealAgentK
left a comment
There was a problem hiding this comment.
See last comment, there might be a pagination issue here.
✅ Live Integration Tests — Box (5/5 actions)All 5 actions verified against the live Box API:
5 passed, 0 failed — full end-to-end coverage across all actions. Also fixed: import path |
Summary
autohive-integrations-sdkpin from~=1.0.2to~=2.0.0inbox/requirements.txtcontext.fetch()call sites to access.dataon the returnedFetchResponseobjectActionError(message=...)ActionResult(data=..., cost_usd=0.0)"error"and"result"boolean fields from output schemas inconfig.jsonconfig.jsonversion from0.0.1to2.0.0box/tests/conftest.pyandbox/tests/test_box_unit.pywith unit coverage for all 5 actionsbox/tests/test_box_integration.pyto useenv_credentials,make_context,FetchResponse, and platform OAuth-styleBOX_ACCESS_TOKENAuth/test alignment
Box is configured as platform OAuth in
config.json:{"type": "platform", "provider": "box"}The live tests now match that shape:
BOX_ACCESS_TOKENAuthorization: Bearer <token>{"auth_type": "PlatformOauth2", "credentials": {"access_token": token}}Integration test coverage
Safe read-only live coverage currently includes:
list_shared_folderslist_fileslist_folder_contentsget_filevia a file discovered fromlist_fileswhen one existsIssue #295 remains open for broader/destructive live coverage because this PR does not add a safe upload lifecycle/cleanup flow.
Safe read-only command:
pytest box/tests/test_box_integration.py -m "integration and not destructive"Test plan
.venv/bin/python -m pytest box/tests -m unit -q— 32 passed.venv/bin/python -m pytest box/tests/test_box_integration.py -m "integration and not destructive" -q— 4 skipped without live Box creds.venv/bin/python -m pytest box/ -q— 32 passed; integration file not collected by default.venv/bin/python ../autohive-integrations-tooling/scripts/validate_integration.py box— passed.venv/bin/python ../autohive-integrations-tooling/scripts/check_code.py box— passed