mbox series

[layerindex-web,0/2] Remove dependencies dropped from conf/layer.conf

Message ID 20261114013839.51312-1-tim.orling@konsulko.com
Headers show
Series Remove dependencies dropped from conf/layer.conf | expand

Message

Tim Orling Nov. 14, 2026, 1:38 a.m. UTC
1: Fixes bug 14348: when a layer drops a dependency from LAYERDEPENDS
   or LAYERRECOMMENDS, the update only warned about it. The existing
   REMOVE_LAYER_DEPENDENCIES setting would remove it, but also removes
   the dependencies added by hand in the edit form, since nothing
   recorded where a dependency came from. This records which
   dependencies came from conf/layer.conf (new field, migration 0056)
   and removes those when they are no longer there. Dependencies added
   by hand, and all existing ones until the next update finds them in
   conf/layer.conf, are kept and warned about as before.
2: A typo in an error message that raised AttributeError instead.

Tested on a test instance loaded with a copy of the layers.openembedded.org
database: the migration applied, and updating meta-security (whose
conf/layer.conf now lists only core and openembedded-layer) marked
those two as coming from conf/layer.conf, kept the older meta-perl
and meta-python with a warning, and removed meta-perl once it was
marked as having come from conf/layer.conf. The test suite passes in
the Docker image (80 passed, 1 skipped).

Dependencies that are already stale are not removed automatically;
they are still only warned about.

Tim Orling (2):
  layerindex: remove dependencies that are dropped from conf/layer.conf
  layerindex/utils.py: fix the error message for a bad dependency
    version

 .../0056_layerdependency_from_layer_conf.py   |  16 +++
 layerindex/models.py                          |   3 +
 layerindex/utils.py                           |  52 +++++----
 tests/test_add_dependency.py                  | 104 ++++++++++++++++++
 4 files changed, 153 insertions(+), 22 deletions(-)
 create mode 100644 layerindex/migrations/0056_layerdependency_from_layer_conf.py
 create mode 100644 tests/test_add_dependency.py


base-commit: 08e58cdece30019a6f9e5d14af16ebe20afa6177