PRODUCTION BUG: _create_blog_post never wrote the LLM body into the post.
Every auto-generated post was published empty. Add 'content': body_html
(content is the Odoo 17 blog.post body field; body_arch was removed).
BDD step/feature fixes (active features/ dir, not the dead tests/features/):
- body_arch → content in step + feature + given_published_blog_post
- then_non_empty_response: result.text → result.body_html (LLMResponse attr)
- llm_provider_selection feature: "provider not configured" → "not configured"
(matches LLMRouter.__init__ message; the generate() fallback never fires)
- then_tokens_used_recorded: assert on result.tokens_used (router returns a
response, it does not persist a log — that is the schedule's job)
- when_llm_router_called: configure the provider-under-test's own credential
(Background only sets the Anthropic key, so openai/gemini bailed early)
- fails-gracefully: invalid key now drives mock side_effect=UserError so
run_generation records an error log and creates no post
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add tests/conftest.py with odoo_env fixture so pytest-bdd can access
the pytest-odoo env fixture (fixes all 14 BDD scenario failures)
- Fix send_notification_email() to use force_send=False so mail.mail
records remain in queue for test assertions; pass res_id/model so
tests can look up records by (res_id, model) pair
- Fix test_generation_latency_under_30_seconds: replace raw SQL INSERT
into ir_logging.body (column removed in Odoo 17) with _logger.info()
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove duplicate BlogPost._inherit class from blog_schedule.py that
redefined itsulu_social_id with invalid 'limit' parameter, causing
'unknown parameter limit' warnings on every Odoo startup
- Use $CI_PROJECT_DIR instead of /builds/$CI_PROJECT_PATH for addons
path in unit_tests — CI_PROJECT_DIR is the correct GitLab predefined
variable that works across all runner types
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add comprehensive K8s test setup guide to CLAUDE.md (section 8)
- Document K8s architecture, Docker image requirements, and job execution
- Update ARCHITECTURE.md with CI/CD infrastructure details
- Fix Dockerfile to use python3 -m pip and proper non-root user handling
- Upgrade addon to Odoo 17.0 and update XML view syntax
Implement LLMRouter class and all LLM provider classes to make tests pass:
Core implementation:
- Create ProviderResponse dataclass for provider returns (text, tokens_used)
- Update LLMRouter to unpack ProviderResponse objects
- Implement all 4 providers to return ProviderResponse:
* AnthropicProvider - calls Anthropic API with structured JSON prompts
* OpenAIProvider - calls OpenAI /v1/chat/completions endpoint
* GeminiProvider - calls Google Gemini generateContent API
* OllamaProvider - calls Ollama native or OpenAI-compatible endpoints
Router features:
- Validates provider at init time, raises UserError for unknown providers
- Reads API keys from ir.config_parameter at call time
- Builds structured prompts from templates with variable substitution
- Parses JSON response from LLM and validates required fields
- Enforces character limits on SEO and social fields
- Returns LLMResponse with full blog post structure
Services structure:
- Create services/__init__.py with exports
- Create models/__init__.py with exports
- Create tests/__init__.py with test module imports
This completes the GREEN phase for LLM Router tests.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Restructure project files to follow the addon layout:
- Move models to addons/itsulu_blog_publisher/models/
- Move services (LLM providers, routers) to addons/itsulu_blog_publisher/services/
- Move wizards to addons/itsulu_blog_publisher/wizards/
- Move views (XML templates) to addons/itsulu_blog_publisher/views/
- Move data (cron, mail templates) to addons/itsulu_blog_publisher/data/
- Move security (ACL) to addons/itsulu_blog_publisher/security/
- Move tests and factories to addons/itsulu_blog_publisher/tests/
- Move BDD features to addons/itsulu_blog_publisher/features/
- Create __init__.py files for all Python packages
This enables proper Odoo module discovery and import structure.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>