feat(gong): upgrade SDK to 2.0.0, add pytest unit tests#282
feat(gong): upgrade SDK to 2.0.0, add pytest unit tests#282Shubhank-Jonnada wants to merge 1 commit intomasterfrom
Conversation
- Bump autohive-integrations-sdk to ~=2.0.0 - Update _make_request to return response.data (FetchResponse breaking change) - Convert all error returns to ActionError(message=...) - Move GongAPIClient instantiation inside try blocks for consistent error handling - Normalize None field values to empty strings/defaults to satisfy output schema - Bump config.json version to 2.0.0 - Add gong/tests/conftest.py and test_gong_unit.py with 32 unit tests covering all 5 actions: happy path, request verification, error paths, and edge cases
🔍 Integration Validation ResultsCommit: Changed directories:
✅ Structure Check output
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd7140535e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| else: | ||
| raise ValueError(f"Unsupported HTTP method: {method}") | ||
|
|
||
| return response.data |
There was a problem hiding this comment.
Support dict fetch responses in _make_request
Treating every fetch result as a FetchResponse breaks existing Gong execution contexts that still return plain dictionaries (for example MockExecutionContext.fetch in gong/tests/test_gong_integration.py). In those cases response.data raises AttributeError, and all actions degrade into ActionError instead of returning valid payloads, which can fail the existing integration tests and any legacy runtime still using dict-style fetch responses.
Useful? React with 👍 / 👎.
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. Nice catch on moving GongAPIClient(context) inside the try so missing api_base_url returns a typed error instead of crashing. 32 unit tests pass.
Local CI verified: validate_integration ✅, check_code ✅, ruff ✅, pytest ✅.
tests/test_gong_integration.py already exists in master — please confirm in your test plan that you've re-run it against a real Gong account on this branch to verify the v2 changes don't regress live behaviour.
Process nit: branch worktree-agent-* doesn't follow <type>/<issue#>/<desc> per AGENTS.md and no linked issue. Please follow the convention next time.
|
Correction to my earlier review: I misread the existing Approval still stands (the SDK 2.0.0 migration in this PR is shippable as-is and is now superseded for unit coverage by Tracked in #299 — please address in a follow-up PR. |
Summary
autohive-integrations-sdkfrom~=1.0.2to~=2.0.0ingong/requirements.txtGongAPIClient._make_requestto returnresponse.data(SDK 2.0.0FetchResponsebreaking change)ActionResult(data={"error": ...})toActionError(message=...)GongAPIClient(context)instantiation insidetryblocks so missingapi_base_urlis caught and returned asActionErrorNonefield values to empty strings/ints to satisfy output schema validationconfig.jsonversion to2.0.0gong/tests/conftest.pyandgong/tests/test_gong_unit.pywith 32 unit tests covering all 5 actionsTest plan
pip install -r gong/requirements.txtinstalls SDK 2.0.0python -m pytest gong/ -v— all 32 unit tests passpython autohive-integrations-tooling/scripts/validate_integration.py gong— passespython autohive-integrations-tooling/scripts/check_code.py gong— passesruff checkandruff format— no issues