Skip to content

fix: finish Odoo previews whose data schedule ran and failed - #5829

Merged
3 commits merged into
mainfrom
work/lp5828-preview-schedule-failure
Nov 9, 2026
Merged

3 commits merged into
mainfrom
work/lp5828-preview-schedule-failure

Conversation

@shiny-code-app

@shiny-code-app shiny-code-app Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Why

Odoo previews on open pull requests were stuck in reconcile_required and re-deployed an unchanged head about every 30 minutes. Any driver fail after a provider effect was treated as an unknown outcome, including a data schedule the provider had already reported as failed. That left CM previews with no finished state and no reason a Client could read.

What changed

  • A data schedule the provider reports as failed or error is now a completed failed preview (502), through OdooPostDeployScheduleFailed and the adapter in odoo_preview_apply_execution.py. The same build and binding replays the failure instead of applying again; a new build or changed binding tries again, using the existing preview_build_failed wording.
  • The Client-facing summary names only the exception type (The data schedule failed with RuntimeError.). The bounded redacted log line stays on the operation record and in the worker log.
  • Template-inherited Website intent no longer sends LAUNCHPLANE_WEBSITE_BOOTSTRAP_REQUIRED on a preview, including through the import-source composition. Exact preview intent and every stable lane stay strict.
  • Genuinely unknown outcomes (no terminal failed status, unreadable provider, lost lease, interrupted executor, preservation retries, schedules before the data workflow) keep the existing guarded recovery.

Depends on cbusillo/odoo-devkit#415 for images that skip inherited Website intent. This PR is safe without it: an older image raises as it does today, and now ends as a finished failed preview instead of looping.

Refs #5828. Merging does not by itself prove the finish line on the current CM previews. The issue stays open until they either serve or show their failure on deployed Launchplane.

Verification

  • Classification: bug fix in preview reconcile and provider-operation recovery, a safety area. Failing first: the reconcile test failed before the fix (preview_operation_status was reconcile_required).
  • Whole modules passing: tests.test_product_reconcile, tests.test_preview_reservation_recovery, tests.test_odoo_preview_apply_execution, tests.test_odoo_preview_runtime, tests.test_odoo_preview_import_source, tests.test_odoo_instance_overrides, tests.test_copy_readback_diagnostics, tests.test_odoo_post_deploy, tests.test_http_app_driver_odoo, tests.test_dokploy_schedule_trigger, tests.test_dokploy.
  • ruff check, ruff format --check, mypy control_plane tests pass.
  • JetBrains inspection: UNKNOWN, native_python_support_plugin_unavailable, native PyCharm, 10 files, no findings reported; tracked on Headless inspection workers: confirm project interpreter and Pydantic plugin so type findings stop being noise codex-skills#3363. Not a clean result.
  • Not verified: no live provider, preview or record was touched. The real Dokploy status strings come from code and existing fixtures, not a live read.

Review

OpenAI reviewed the change, then the fix, and returned one P1 and one P2.

  • P1 acted on: arbitrary exception text could reach Clients. Client-facing text now carries only the exception type.
  • P2 partly acted on: the dotted-name pattern accepted non-exception names (customer.AliceSmith). It now needs an Error or Exception suffix or psycopg2.errors.*.
  • P2 remainder declined: a fixed registry of exception names. A class name in the Director's own product code is not private data, and a registry is a second list to keep.
  • Answered none: no unknown outcome becomes a finished failure, no stable-lane or binding weakening, and completed 502 records fit PR-close cleanup, retained-restore decisions and the retained plan chain.

Removed: the unconditional unknown-outcome raise for a schedule the provider reports as failed, and the required flag on template-inherited preview Website intent.
Net lines: +437 (105 code and docs, 332 tests). Growth is the new failure path and its tests.

A schedule the provider reports as failed is a known outcome. Record it as a completed failed preview with its reason so an unchanged build stops redeploying; unknown outcomes keep the guarded recovery. Template-inherited Website intent is no longer required on a preview.
Client-facing failure summaries now name only the exception type. The redacted line stays in the operation record and the worker log.
@shiny-code-app

shiny-code-app Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Review result: weighed
Head: 6718b6c

Review by another model, weighed for head 6718b6c.

Reviewer: OpenAI through the model-review helper (model not reported by the CLI), full change plus a focused re-review of the fix.

  • P1, acted on: arbitrary schedule exception text could reach Clients. Client text now names only the exception type; the bounded redacted line stays on the operation record and in the worker log.
  • P2, acted on in part: the dotted-name pattern accepted non-exception names. It now needs an Error or Exception suffix or psycopg2.errors.*.
  • P2 remainder, declined: a fixed registry of exception names adds a second list to keep, and a class name in the Director's own product code is not private data.
  • Specific questions answered none: no unknown outcome becomes a finished failure, no stable-lane or preview-binding weakening from the flag change, completed 502 records fit PR-close cleanup, retained-restore decisions and the retained plan chain.

@shiny-code-app

shiny-code-app Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Ready for the merge train

Head: 6718b6c

@shiny-code-app

shiny-code-app Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Launchplane completed the merge-train step for this pull request.

Launchplane landed this pull request through protected batch PR #5832.

Launchplane manages this comment and will update it as the train moves.

shiny-code-app Bot added a commit that referenced this pull request Nov 9, 2026
@shiny-code-app shiny-code-app Bot closed this pull request by merging all changes into main in cd6f36a Nov 9, 2026
@shiny-code-app
shiny-code-app Bot deleted the work/lp5828-preview-schedule-failure branch November 9, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants