mbox series

[layerindex-web,0/3] Fix the Update Layer button

Message ID 20261114003041.15197-1-tim.orling@konsulko.com
Headers show
Series Fix the Update Layer button | expand

Message

Tim Orling Nov. 14, 2026, 12:30 a.m. UTC
These fix the problems in bug 15395 with the Update Layer button.

1: The button created two update records: the view's, with the task
   and its log, and an empty one from update.py, which holds the
   per-layer updates.
2: The task page showed the live log as a Python bytes literal (since
   Django 3.0), and only saw the task finish when the poll reached the
   process that started it (rpc:// result backend).
3: The task logs volume belonged to root, so the worker could not write
   the log. An existing volume keeps its owner and needs a one-time
   "chown layers" of the task logs directory.

Tested on a test instance loaded with a copy of the layers.openembedded.org
database, with RabbitMQ and a Celery worker, by pressing the button for
meta-maker and for meta-security (a full parse): before, two records
and a b'...' log; after, one record with the layer update attached, the
log shown as it runs, and success detected. The worker also needs
"layerindex/tasks.py: fix loading the settings in the Celery worker",
sent separately. The test suite passes in the Docker image (80 passed,
1 skipped).

Queuing an update behind one that is already running, also asked for
in the bug, is not part of this series.

Tim Orling (3):
  layerindex: record Update Layer runs in a single update record
  layerindex/views: fix the live log on the task status page
  Dockerfile: create the task logs directory

 Dockerfile                  |  6 ++-
 layerindex/tasks.py         |  6 ++-
 layerindex/update.py        | 30 +++++++++----
 layerindex/views.py         | 26 ++++--------
 tests/test_update_button.py | 84 +++++++++++++++++++++++++++++++++++++
 5 files changed, 124 insertions(+), 28 deletions(-)
 create mode 100644 tests/test_update_button.py


base-commit: 08e58cdece30019a6f9e5d14af16ebe20afa6177