feat(harvest): upgrade SDK to 2.0.0, add pytest unit tests#276
feat(harvest): upgrade SDK to 2.0.0, add pytest unit tests#276Shubhank-Jonnada wants to merge 2 commits intomasterfrom
Conversation
- Bump autohive-integrations-sdk pin to ~=2.0.0
- Update all context.fetch() return values to access .data
- Convert all error returns from bare dicts to ActionError(message=...)
- Convert all success returns to ActionResult(data={...}, cost_usd=0.0)
- Import ActionResult, ActionError from SDK
- Remove 'error' and 'success' fields from output schemas in config.json
- Bump config.json version to 2.0.0
- Add harvest/tests/conftest.py, __init__.py, test_harvest_unit.py
- 42 unit tests covering all 10 actions (happy path, request verification, error paths, edge cases)
🔍 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. 42 unit tests across all 10 actions.
Local CI verified: validate_integration ✅, check_code ✅, ruff ✅, pytest ✅.
Follow-up tracked in #294 — please add a test_harvest_integration.py in a follow-up PR. Not blocking this merge because the SDK upgrade is shippable as-is.
Process nit: branch worktree-agent-* doesn't follow <type>/<issue#>/<desc> per AGENTS.md. Please follow the convention next time.
…tegration tests
- Replace all optional inputs["param"] bracket access with inputs.get("param")
to prevent KeyError when optional params are not provided (fixes 43 warnings)
- Add harvest/tests/test_harvest_integration.py with real HTTP tests for
list_time_entries, list_projects, list_clients, list_tasks, list_users
- Delete old manual-run test_harvest.py (replaced by unit + integration tests)
- Update conftest.py to insert parent dir into sys.path
- Add HARVEST_ACCESS_TOKEN and HARVEST_ACCOUNT_ID to .env.example
Summary
autohive-integrations-sdkpin from~=1.0.2to~=2.0.0context.fetch()call sites to access.dataon the returnedFetchResponseActionError(message=...)ActionResult(data={...}, cost_usd=0.0)"error"and"success"fields from all output schemas inconfig.jsonconfig.jsonversion to2.0.0Actions covered
create_time_entry,stop_time_entry,list_time_entries,update_time_entry,delete_time_entry,list_projects,get_project,list_clients,list_tasks,list_usersTest plan
validate_integration.py harvest— 0 errors, 0 warningscheck_code.py harvest— CODE CHECK PASSEDpytest harvest/ -v— 42 passedruff checkandruff format— all clean