Skip to content

feat(supadata): upgrade SDK to 2.0.0, add pytest unit tests#280

Open
Shubhank-Jonnada wants to merge 1 commit intomasterfrom
worktree-agent-aba6aa14a8cd9433d
Open

feat(supadata): upgrade SDK to 2.0.0, add pytest unit tests#280
Shubhank-Jonnada wants to merge 1 commit intomasterfrom
worktree-agent-aba6aa14a8cd9433d

Conversation

@Shubhank-Jonnada
Copy link
Copy Markdown
Contributor

Summary

  • Upgrades autohive-integrations-sdk pin from ~=1.0.2 to ~=2.0.0 in supadata/requirements.txt
  • Converts bare dict returns to ActionResult(data=..., cost_usd=0.0) and ActionError(message=...) for error paths
  • Fixes context.auth access — was incorrectly reading from a nested credentials envelope; now reads from the flat custom auth shape (context.auth.get("api_key"))
  • Bumps config.json version to 2.0.0
  • Adds 15 pytest unit tests in supadata/tests/test_supadata_unit.py covering: happy path, SDK call verification (URL + params + auth), SupadataError and generic exception error paths, edge cases (empty chunks, string content, invalid format), and _ms_to_timestamp helper tests

Test plan

  • python -m pytest supadata/ -v — all 15 unit tests pass
  • python validate_integration.py supadata — no errors
  • python check_code.py supadata — all checks pass (lint, format, bandit, pip-audit, config-code sync, fetch patterns)

- Bump autohive-integrations-sdk pin to ~=2.0.0 in requirements.txt
- Convert bare dict returns to ActionResult(data=..., cost_usd=0.0)
- Convert error raises to ActionError(message=...) for both SupadataError and generic exceptions
- Fix context.auth access from nested credentials envelope to flat custom auth shape
- Import ActionResult, ActionError from SDK
- Bump config.json version to 2.0.0
- Add supadata/tests/conftest.py and supadata/tests/test_supadata_unit.py with 15 unit tests covering happy path, request verification, error paths, edge cases, and helper function tests
@github-actions
Copy link
Copy Markdown

🔍 Integration Validation Results

Commit: 8976746daf8ce0079ac84ed90f254e25e385358a · feat(supadata): upgrade SDK to 2.0.0, add pytest unit tests
Updated: 2026-04-28T22:36:19Z

Changed directories: supadata

Check Result
Structure ✅ Passed
Code ✅ Passed
Tests ✅ Passed
README ✅ Passed
Version ✅ Passed
✅ Structure Check output
Validating 1 integration(s)...

============================================================
Integration: supadata
============================================================
✅ All checks passed!

============================================================
SUMMARY
============================================================
Integrations validated: 1
Total errors: 0
Total warnings: 0

✅ All validations passed!
✅ Code Check output

[notice] A new release of pip is available: 26.0.1 -> 26.1
[notice] To update, run: pip install --upgrade pip
----------------------------------------
Checking: supadata
----------------------------------------

📦 Installing dependencies...

🐍 Checking Python syntax...
   ✅ Syntax OK

📥 Checking imports...
   ✅ Imports OK

📄 Checking JSON files...
   ✅ JSON files OK

🔍 Linting with ruff...
   ✅ Lint OK

🎨 Checking formatting with ruff...
   ✅ Formatting OK

🔒 Scanning for security issues with bandit...
   ✅ Security OK

🛡️ Checking dependencies for vulnerabilities with pip-audit...
   ✅ Dependencies OK

🔗 Checking config-code sync...
   ✅ Config-code sync OK

🔄 Checking fetch patterns...
   ✅ Fetch patterns OK

========================================
✅ CODE CHECK PASSED
========================================
✅ Tests output

Integration   Tests  Coverage        Status
-------------------------------------------
supadata     15/15      100%      ✅ Passed
-------------------------------------------
Total        15/15            ✅ All passed

✅ Tests passed: supadata
✅ README Check output
========================================
✅ README CHECK PASSED
========================================
✅ Version Check output
✅ supadata: 1.0.0 → 2.0.0 (major bump)

========================================
✅ VERSION CHECK PASSED
========================================


_parent = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
_deps = os.path.abspath(os.path.join(os.path.dirname(__file__), "../dependencies"))
_repo_root = os.path.abspath(os.path.join(_parent, ".."))
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8976746daf

ℹ️ 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".

async def execute(self, inputs: Dict[str, Any], context: ExecutionContext):
video_url = inputs["video_url"]
api_key = context.auth.get("credentials", {}).get("api_key", {})
api_key = context.auth.get("api_key", "")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Read API key from credentials envelope

This change switches auth lookup to context.auth.get("api_key"), but the repo’s SDK v2 integrations and test conventions still pass custom auth under context.auth["credentials"]; in that common runtime shape, api_key becomes empty and every transcript request is sent unauthenticated, causing consistent API failures. To avoid breaking existing connections, read from the credentials envelope (or support both shapes) before constructing Supadata(api_key=...).

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator

@TheRealAgentK TheRealAgentK left a comment

Choose a reason for hiding this comment

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

SDK 2.0.0 migration looks clean (correctly fixes the context.auth envelope bug too) and the 15 unit tests cover the actions. Local CI verified: validate_integration ✅, check_code ✅, ruff ✅, pytest ✅.

Blocking on one thing: no tests/test_supadata_integration.py. Supadata uses a custom API-key auth, so adding e2e coverage is low-cost — just one env var (SUPADATA_API_KEY) and the live_context fixture per the writing-integration-tests skill. Please add at minimum a happy-path test against a real transcript before merge.

Also: branch name doesn't follow <type>/<issue#>/<desc> per AGENTS.md, and no linked issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants