Skip to content

feat(app-business-reviews): upgrade SDK to 2.0.0, add pytest unit tests#285

Open
Shubhank-Jonnada wants to merge 4 commits intomasterfrom
fix/app-business-reviews-sdk-v2
Open

feat(app-business-reviews): upgrade SDK to 2.0.0, add pytest unit tests#285
Shubhank-Jonnada wants to merge 4 commits intomasterfrom
fix/app-business-reviews-sdk-v2

Conversation

@Shubhank-Jonnada
Copy link
Copy Markdown
Contributor

Summary

  • Upgrade SDK to 2.0.0: use ActionResult/ActionError return types
  • Access FetchResponse.data on all context.fetch() calls
  • Remove legacy result/error fields from output schemas
  • Add pytest unit tests (test_app_business_reviews_unit.py) — 40 tests covering all 6 actions

Test plan

  • All unit tests pass
  • validate_integration.py passes
  • check_code.py passes
  • ruff check/format clean

- Pin autohive-integrations-sdk~=2.0.0 in requirements.txt
- Add .data to all context.fetch() return accesses
- Convert raise ValueError to return ActionError(message=...)
- Return ActionResult(data=..., cost_usd=0.0) from all action handlers
- Bump config.json version to 2.0.0
- Add tests/conftest.py and 40-test unit suite covering all 6 actions
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

🔍 Integration Validation Results

Commit: a29aa0b0ebafb06d33b5b120ea83d3abd4e3bec2 · fix(app-business-reviews): fix auth, optional params, add proper unit and integration tests
Updated: 2026-05-01T02:45:51Z

Changed directories: app-business-reviews freshdesk

Check Result
Structure ✅ Passed
Code ⚠️ Passed with warnings
Tests ✅ Passed
README ✅ Passed
Version ✅ Passed
✅ Structure Check output
Validating 2 integration(s)...

============================================================
Integration: app-business-reviews
============================================================
✅ All checks passed!

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

============================================================
SUMMARY
============================================================
Integrations validated: 2
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

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

📦 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

----------------------------------------
Checking: freshdesk
----------------------------------------

📦 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...
   ⚠️  Action 'create_company': parameter 'description' is optional in schema but accessed with inputs["description"] (will raise KeyError if not provided)
   ⚠️  Action 'create_company': parameter 'note' is optional in schema but accessed with inputs["note"] (will raise KeyError if not provided)
   ⚠️  Action 'create_company': parameter 'custom_fields' is optional in schema but accessed with inputs["custom_fields"] (will raise KeyError if not provided)
   ⚠️  Action 'create_company': parameter 'domains' is optional in schema but accessed with inputs["domains"] (will raise KeyError if not provided)
   ⚠️  Action 'update_company': parameter 'note' is optional in schema but accessed with inputs["note"] (will raise KeyError if not provided)
   ⚠️  Action 'update_company': parameter 'custom_fields' is optional in schema but accessed with inputs["custom_fields"] (will raise KeyError if not provided)
   ⚠️  Action 'update_company': parameter 'domains' is optional in schema but accessed with inputs["domains"] (will raise KeyError if not provided)
   ⚠️  Action 'update_company': parameter 'name' is optional in schema but accessed with inputs["name"] (will raise KeyError if not provided)
   ⚠️  Action 'update_company': parameter 'description' is optional in schema but accessed with inputs["description"] (will raise KeyError if not provided)
   ⚠️  Action 'create_ticket': parameter 'company_id' is optional in schema but accessed with inputs["company_id"] (will raise KeyError if not provided)
   ⚠️  Action 'create_ticket': parameter 'priority' is optional in schema but accessed with inputs["priority"] (will raise KeyError if not provided)
   ⚠️  Action 'create_ticket': parameter 'status' is optional in schema but accessed with inputs["status"] (will raise KeyError if not provided)
   ⚠️  Action 'create_ticket': parameter 'name' is optional in schema but accessed with inputs["name"] (will raise KeyError if not provided)
   ⚠️  Action 'create_ticket': parameter 'source' is optional in schema but accessed with inputs["source"] (will raise KeyError if not provided)
   ⚠️  Action 'create_ticket': parameter 'description' is optional in schema but accessed with inputs["description"] (will raise KeyError if not provided)
   ⚠️  Action 'create_ticket': parameter 'tags' is optional in schema but accessed with inputs["tags"] (will raise KeyError if not provided)
   ⚠️  Action 'update_ticket': parameter 'priority' is optional in schema but accessed with inputs["priority"] (will raise KeyError if not provided)
   ⚠️  Action 'update_ticket': parameter 'status' is optional in schema but accessed with inputs["status"] (will raise KeyError if not provided)
   ⚠️  Action 'update_ticket': parameter 'tags' is optional in schema but accessed with inputs["tags"] (will raise KeyError if not provided)
   ⚠️  Action 'update_ticket': parameter 'description' is optional in schema but accessed with inputs["description"] (will raise KeyError if not provided)
   ⚠️  Action 'update_ticket': parameter 'subject' is optional in schema but accessed with inputs["subject"] (will raise KeyError if not provided)
   ⚠️  Action 'create_contact': parameter 'job_title' is optional in schema but accessed with inputs["job_title"] (will raise KeyError if not provided)
   ⚠️  Action 'create_contact': parameter 'mobile' is optional in schema but accessed with inputs["mobile"] (will raise KeyError if not provided)
   ⚠️  Action 'create_contact': parameter 'phone' is optional in schema but accessed with inputs["phone"] (will raise KeyError if not provided)
   ⚠️  Action 'create_contact': parameter 'tags' is optional in schema but accessed with inputs["tags"] (will raise KeyError if not provided)
   ⚠️  Action 'create_contact': parameter 'description' is optional in schema but accessed with inputs["description"] (will raise KeyError if not provided)
   ⚠️  Action 'create_contact': parameter 'company_id' is optional in schema but accessed with inputs["company_id"] (will raise KeyError if not provided)
   ⚠️  Action 'update_contact': parameter 'email' is optional in schema but accessed with inputs["email"] (will raise KeyError if not provided)
   ⚠️  Action 'update_contact': parameter 'mobile' is optional in schema but accessed with inputs["mobile"] (will raise KeyError if not provided)
   ⚠️  Action 'update_contact': parameter 'job_title' is optional in schema but accessed with inputs["job_title"] (will raise KeyError if not provided)
   ⚠️  Action 'update_contact': parameter 'phone' is optional in schema but accessed with inputs["phone"] (will raise KeyError if not provided)
   ⚠️  Action 'update_contact': parameter 'name' is optional in schema but accessed with inputs["name"] (will raise KeyError if not provided)
   ⚠️  Action 'update_contact': parameter 'description' is optional in schema but accessed with inputs["description"] (will raise KeyError if not provided)
   ⚠️  Action 'create_note': parameter 'notify_emails' is optional in schema but accessed with inputs["notify_emails"] (will raise KeyError if not provided)
   ⚠️  Action 'create_reply': parameter 'from_email' is optional in schema but accessed with inputs["from_email"] (will raise KeyError if not provided)
   ✅ Config-code sync OK

🔄 Checking fetch patterns...
   ✅ Fetch patterns OK

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

Integration              Tests  Coverage        Status
------------------------------------------------------
app-business-reviews     40/40       95%      ✅ Passed
freshdesk                88/88       94%      ✅ Passed
------------------------------------------------------
Total                  128/128            ✅ All passed

✅ Tests passed: app-business-reviews, freshdesk
✅ README Check output
========================================
✅ README CHECK PASSED
========================================
✅ Version Check output
✅ app-business-reviews: 1.0.0 → 2.0.0 (major bump)
✅ freshdesk: 1.0.0 → 2.0.0 (major bump)

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

- Update SDK to 2.0.0: all context.fetch() calls access .data
- Import and use ActionResult/ActionError return types
- Fix auth: use flat context.auth dict (custom auth type)
- Remove legacy result/error fields from all output schemas
- Bump config.json version to 2.0.0
- Add 88 pytest unit tests covering all 17 actions
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 and the 40 unit tests cover the 6 actions across App Store, Google Play, and Google Maps. Local CI verified: validate_integration ✅, check_code ✅, ruff ✅, pytest ✅.

Blocking on one thing: no tests/test_app_business_reviews_integration.py. This integration uses custom API-key auth across three providers, so adding e2e coverage is straightforward — env vars per provider key and the live_context fixture per the writing-integration-tests skill. Please add at minimum a read-only happy-path test per provider before merge.

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

… and integration tests

- Fix api_key default from {} to "" in all action handlers
- Delete old manual asyncio test file
- Add test_app_business_reviews_integration.py with pytest.mark.integration, APP_BUSINESS_REVIEWS_API_KEY env var
- Add APP_BUSINESS_REVIEWS_API_KEY to .env.example
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