Skip to content

feat(doc-maker): upgrade SDK to 2.0.0, add pytest unit tests#281

Merged
NinosMan merged 7 commits intomasterfrom
worktree-agent-aca8b92fef9fa342f
Apr 30, 2026
Merged

feat(doc-maker): upgrade SDK to 2.0.0, add pytest unit tests#281
NinosMan merged 7 commits intomasterfrom
worktree-agent-aca8b92fef9fa342f

Conversation

@Shubhank-Jonnada
Copy link
Copy Markdown
Contributor

Summary

  • Upgrades autohive-integrations-sdk from ~=1.0.2 to ~=2.0.0 in doc-maker/requirements.txt
  • Wraps all action returns in ActionResult(data=..., cost_usd=0.0) — no more bare dict returns
  • Converts all error paths to ActionError(message=...) — missing document IDs, invalid inputs, image-not-found
  • Extracts _save_document_to_dict() internal helper to avoid calling execute() from save_and_return_document
  • Removes "error" fields from all output schemas in config.json
  • Bumps config.json version to 2.0.0
  • Adds doc-maker/tests/conftest.py with standard sys.path insert
  • Adds doc-maker/tests/test_doc_maker_unit.py with 51 pytest unit tests covering all 8 actions plus 4 pure helper function test classes

Test plan

  • python -m pytest doc-maker/ -v — 51 passed
  • validate_integration.py doc-maker — all checks passed
  • check_code.py doc-maker — CODE CHECK PASSED
  • ruff check --fix and ruff format — no issues

- Pin autohive-integrations-sdk to ~=2.0.0 in requirements.txt
- Wrap all action returns in ActionResult(data=..., cost_usd=0.0)
- Return ActionError(message=...) for all error paths (missing docs, invalid input)
- Extract _save_document_to_dict() internal helper; refactor save_and_return_document to return ActionResult
- Add try/except ValueError around load_document_from_files() in all action handlers
- Remove 'error' fields from all output schemas in config.json
- Bump config.json version to 2.0.0
- Add doc-maker/tests/conftest.py with sys.path insert
- Add doc-maker/tests/test_doc_maker_unit.py with 51 pytest unit tests covering all 8 actions plus pure helper functions
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

🔍 Integration Validation Results

Commit: 593f200b1dbec99d04ff4d63324b988c36b5907a · test(doc-maker): verify docx opens with python-docx not just magic bytes
Updated: 2026-04-30T01:20:24Z

Changed directories: doc-maker

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

============================================================
Integration: doc-maker
============================================================
✅ 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: doc-maker
----------------------------------------

📦 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_document': parameter 'title' accessed in code but not defined in input_schema
   ⚠️  Action 'add_image': parameter 'files' is required in schema but accessed with inputs.get() (safe for missing)
   ✅ Config-code sync OK

🔄 Checking fetch patterns...
   ✅ Fetch patterns OK

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

Integration   Tests  Coverage        Status
-------------------------------------------
doc-maker     51/51       52%      ✅ Passed
-------------------------------------------
Total         51/51            ✅ All passed

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

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

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 51 unit tests cover the 8 actions plus the helper functions well. Local CI verified: validate_integration ✅, check_code ✅, ruff ✅, pytest ✅.

Blocking on one thing: no tests/test_doc_maker_integration.py. doc-maker has no auth (pure compute) so e2e coverage is the easiest of the entire batch — no env vars at all, just real document generation through the actions. Please add at least a happy-path test that creates a document, adds content, and verifies the binary output. See the writing-integration-tests skill for structure.

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

@NinosMan NinosMan dismissed TheRealAgentK’s stale review April 30, 2026 02:35

The review comments have largely been addressed - going forward I'll be more critical about branch names. However, we need to get this update out ASAP so I won't block on that for now. The tests have been updated and pass CI. Dismissing this review

@NinosMan NinosMan merged commit bcd23af into master Apr 30, 2026
3 checks passed
@NinosMan NinosMan deleted the worktree-agent-aca8b92fef9fa342f branch April 30, 2026 02:35
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.

3 participants