-
Notifications
You must be signed in to change notification settings - Fork 101
Description
Describe the bug
When merging a parent element, trestle merge successfully writes merged content back into catalog.json, but nested split files/directories are not fully cleaned up.
I verified this locally after full dev setup. After splitting catalog.metadata and then splitting nested metadata.roles.*, running trestle merge -e 'catalog.metadata' leaves stale files under catalog/metadata/ (including deeper roles children), even though catalog.json already contains merged metadata.
This creates an inconsistent workspace state and can confuse follow-up split/merge operations.
To Reproduce
Steps to reproduce the behavior:
- Create a fresh workspace and import a model:
trestle inittrestle import -f tests/data/json/minimal_catalog_with_groups.json -o mycatalog
- Go to
catalogs/mycatalogand split top-level catalog parts:trestle split -f ./catalog.json -e 'catalog.metadata,catalog.groups,catalog.back-matter'
- Go to
catalogs/mycatalog/catalogand split metadata:trestle split -f ./metadata.json -e 'metadata.roles,metadata.responsible-parties'
- Go to
catalogs/mycatalog/catalog/metadataand split roles deeper:trestle split -f ./roles.json -e 'roles.*'
- Return to
catalogs/mycatalogand merge metadata:trestle merge -e 'catalog.metadata'
- Inspect remaining files with
ls -R catalogand see stale artifacts still present undercatalog/metadata/....
Expected behavior
After trestle merge -e 'catalog.metadata', obsolete nested split artifacts for that subtree should be cleaned up (or at least consistently handled), so the workspace does not retain stale catalog/metadata/... split content after parent merge.
Screenshots / Logs.
Repro output after merge (ls -R catalog):
catalog:
back-matter.json
groups.json
metadata
catalog/metadata:
responsible-parties.json
roles
catalog/metadata/roles:
00000__role.json
Also confirmed catalog.json already contains merged metadata.
Environment
- OS: Linux 6.8.0-101-generic
- Python version: 3.10.12 (hatch test environment)
- Installed packages: local editable install (
pip install -e ".[dev]"),make develop,make testpassed (1255 passed, 3 skipped)
Are you going to solve this issue?
Yes
Metadata
Metadata
Assignees
Labels
Type
Projects
Status