Skip to content

Skip unchanged admin passwords in post-deploy maintenance - #134

Merged
shiny-code-app[bot] merged 3 commits into
mainfrom
work/idempotent-post-deploy-admin
Sep 29, 2026
Merged

shiny-code-app[bot] merged 3 commits into
mainfrom
work/idempotent-post-deploy-admin

Conversation

@shiny-code-app

Copy link
Copy Markdown
Contributor

Why

CM website testing still sends an Odoo "Security Update: Password Changed" email on every deploy. The email goes to admin@localhost and bounces back to the support mailbox. #113 made the container startup path check the password first. Post-deploy maintenance has its own copy of that logic in ensure_admin_user, and that copy still wrote the password every time. The 2026-09-29 15:40 UTC notice came from the testing post-deploy run.

What changed

  • ensure_admin_user now checks the configured password with Odoo's _check_credentials first. It writes only on AccessDenied. A real rotation still goes through Odoo's normal write and still sends a notification. Any other credential-check failure raises instead of writing.
  • The shell payload is embedded with repr(json.dumps(...)), as in Avoid password-change notices on unchanged startup #113, so quotes and backslashes in the password survive.
  • The README runtime note now covers post-deploy maintenance.

Verification

  • New EnsureAdminUserTests cover these cases: the same password twice results in one write; a rotation writes once and then stops; an unexpected check failure does not write. The tests fail against the old code.
  • Full suite: 314 tests OK. Ruff check and format are clean.
  • JetBrains inspection: not run to a verdict. It returned UNKNOWN (language_sdk_missing) twice in the fresh worktree, including after uv sync --locked. This is the known preparation debt tracked in Make linked-worktree Python inspection preparation reproducible #111.

Owner test notes

Nothing for the owner to test. After this lands and the CM website pin moves to it, testing deploys should stop sending the password-change email.

Refs #112

Post-deploy maintenance rewrote the configured administrator password on
every deploy, so Odoo emailed a password-change security notice each time.
#113 fixed the container startup path; apply the same credential check to
ensure_admin_user and keep quotes and backslashes intact in the payload.

Refs #112
@shiny-code-app
shiny-code-app Bot merged commit 74f4cf7 into main Sep 29, 2026
5 checks passed
@shiny-code-app
shiny-code-app Bot deleted the work/idempotent-post-deploy-admin branch September 29, 2026 16:31
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