Skip to content

fix(deploy): refresh env during image updates#395

Merged
ericmey merged 1 commit into
mainfrom
fix/update-playbook-env-history
Jun 29, 2026
Merged

fix(deploy): refresh env during image updates#395
ericmey merged 1 commit into
mainfrom
fix/update-playbook-env-history

Conversation

@ericmey

@ericmey ericmey commented Jun 29, 2026

Copy link
Copy Markdown
Owner

No tracking Issue: deploy exposed an update-playbook gap during the v1.11.4 rollout.

Summary

  • render .env.production during deploy/ansible/update.yml before service recreation, so MUSUBI_SERVICE_VERSION advances with the pinned image
  • notify upgrade-history handlers from the recreate task, so update runs append /var/log/musubi/upgrade-history.jsonl as the runbook promises
  • add structural tests for both behaviors

Validation

  • uv run pytest tests/ops/test_update_playbook.py tests/ops/test_ansible.py
  • uv run ruff format --check tests/ops/test_update_playbook.py
  • uv run ruff check tests/ops/test_update_playbook.py
  • ansible-playbook -i deploy/ansible/inventory.yml --syntax-check deploy/ansible/update.yml

Copilot AI review requested due to automatic review settings June 29, 2026 23:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR closes an operational gap in the Ansible in-place upgrade flow by ensuring deploy/ansible/update.yml refreshes the rendered production env file before recreating services, and by wiring the per-service recreate task to append an upgrade-history entry as described in the upgrade runbook. It adds structural unit tests to prevent future drift.

Changes:

  • Render {{ musubi_config_dir }}/.env.production during update.yml before the docker_compose_v2 recreate step (with no_log: true).
  • Add notify hooks on the per-service docker_compose_v2 task to trigger the upgrade-history handlers.
  • Add structural tests asserting env refresh ordering and that the recreate task notifies the upgrade-history handlers.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
deploy/ansible/update.yml Adds .env.production templating pre-recreate and ensures the recreate step notifies upgrade-history handlers.
tests/ops/test_update_playbook.py Adds structural tests enforcing env refresh ordering and upgrade-history notification wiring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ericmey ericmey merged commit cb09a51 into main Jun 29, 2026
2 checks passed
@ericmey ericmey deleted the fix/update-playbook-env-history branch June 29, 2026 23:23
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.

2 participants