Skip to content

[20.0][OU-ADD] gate the constraints the upgrade could not apply - #121

Draft
dnplkndll wants to merge 1 commit into
20.0from
20.0-fix-unapplied-constraints
Draft

dnplkndll wants to merge 1 commit into
20.0from
20.0-fix-unapplied-constraints

Conversation

@dnplkndll

@dnplkndll dnplkndll commented Sep 22, 2026 •

Copy link
Copy Markdown

Odoo logs one INFO line per constraint it cannot establish on migrated data and
carries on, so the upgrade exits 0 with the invariant missing. checklog-odoo
only reacts to WARNING and above. The run that first exited 0 left twelve
constraints unapplied
, one of them payment_method.provider_id, behind which
every company but one had lost its payment methods.

The log cannot be the verdict on its own, in either direction:

  • it is written while the table is reshaped, before post- and end-migration
    run, so a script that repairs the data cannot stop it being emitted;
  • a module owning a stricter rule replaces the one being attempted moments
    later — account cannot build its broad account_move_unique_name while
    LATAM vendor bills exist, then l10n_latam_invoice_document installs the
    narrower index that is the real rule.

So the log says which constraints to look at and the schema says how each
ended: nulls counted, named check constraints and unique indexes looked up. All
three shapes Odoo reports are answerable, so the allowlist is empty.

Fails closed four ways, each verified by running it: a log with no upgrade in
it, an unreachable database, a column that no longer exists, an unrecognised
message. Against the campaign branch's run it resolves 11 and reports 0.

The upgrade is piped through tee to produce the log, so the step sets
pipefail — without it the step reports tee's status and a failed upgrade
passes.

Draft until fork CI is green on this branch alone.

AI-assisted (Claude Code); every change reviewed, tested, and owned by the author.


CI: red by construction until #118 lands

The test job fails on duplicate key value violates unique constraint "res_country_state_name_code_uniq" (Ladakh / Odisha). That is not this branch:
base's pre-migration, which renames base.state_in_or → base.state_in_od
and l10n_in.state_in_la → base.state_in_la, lives in #118 and is not on
20.0 yet. Every branch cut from 20.0 alone hits it, which is why #117 is red
for the same reason.

Per the fork's model the per-PR test check is the lean one; the real migration
gate is the integration branch (#120), where this module's scripts run green as
part of the full 585-module seed.

When migrated data does not satisfy a constraint the new version declares, Odoo
logs one INFO line and carries on. The upgrade still exits 0, and checklog-odoo
only reacts to WARNING and above, so nothing noticed that the run which first
exited 0 left TWELVE constraints unapplied -- one of them payment_method's
provider_id, behind which every company but one had lost its payment methods.

The log cannot be the verdict on its own. The line is emitted while the table is
reshaped, before post- and end-migration run, so a script that repairs the data
cannot stop it being written; and a module that owns a stricter rule replaces
the one being attempted a moment later. account cannot build its broad
account_move_unique_name while LATAM vendor bills are present, and then
l10n_latam_invoice_document installs the narrower index that is the real rule.

So the log says which constraints to look at and the schema says how each one
ended: nulls are counted, and a named check constraint or unique index is looked
up. All three shapes Odoo reports are answerable, so the allowlist is empty.

It fails closed four ways, each verified: a log with no upgrade in it, a database
it cannot reach, a column that no longer exists, and a message it does not
recognise all report rather than pass.

The upgrade is piped through tee to produce the log, so the step sets pipefail;
without it the step would report tee's status and a failed upgrade would pass.

Assisted-by: Claude Opus 5
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.

1 participant