Skip to content

Report-spec consumer folders phase 2: recursive sync, consumer index, zoned specs out of shared caches - #582

Merged
dwolfson merged 2 commits into
odpi:mainfrom
dwolfson:feat/report-spec-recursive-consumers
Nov 10, 2026
Merged

dwolfson merged 2 commits into
odpi:mainfrom
dwolfson:feat/report-spec-recursive-consumers

Conversation

@dwolfson

Copy link
Copy Markdown
Member

Report-spec consumer folders, phase 2 (pyegeria half)

Egeria-held report specs only. Two commits, both signed with DCO.

Recursive consumer-folder sync (970152d)

sync_report_specs(recursive=None, depth_cap=5, index_consumers=True):

  • Follows the CollectionFolder members of a named folder. On by default for consumer folders (ReportSpecFolder::Consumer::...) and off for any other folder; --recursive / --no-recursive on pyegeria report-specs sync override the default.
  • Each GUID is read once (cycle guard). The walk stops 5 levels below the named folder and never follows a RootCollection or a sibling consumer folder.
  • A spec found in a sub-folder is recorded against the named folder. The report names folders_read and depth_cap_reached.
  • A capped walk or a failed sub-folder read keeps the folder's cached specs, because a folder that wasn't read can't show that a spec stopped being a member.

Consumer index

build_consumer_index / refresh_consumer_index / read_consumer_index:

  • Reads the root (PYEGERIA_REPORT_SPEC_ROOT, default RootCollection::ReportSpecs) once, names and labels only, and returns {label: [consumer, ...]} plus the status of each consumer folder.
  • Cached as consumers.json beside the spec manifest.
  • An unreadable or missing root has status "not read", with the reason, never an empty result. An unreadable or capped consumer folder makes the status "partial".
  • A folder sync refreshes the index. If that refresh fails, the sync still succeeds.

Zoned specs stay out of shared caches; hidden sub-folders are gone (62ef9ed)

  • A shared sync (the manifest is shared, as with the Portal's cache) skips any ReportSpec that has a governance zone, until B6's public-only read is available. Zones are read from elementHeader.zoneMembership and from the legacy classifications list. A copy already in the cache is pruned. A private (per-user) cache still takes zoned specs.
  • The consumer index leaves zoned labels out and says so in a note.
  • A sub-folder whose member read is refused as not visible (OPEN-METADATA-SECURITY-403-020) or not found (404) is treated as gone, and its specs are pruned. A genuine error (timeout, 5xx) keeps the cache as it was.

Tests

  • tests/micro-tests/test_rs_consumer_folders.py, against an in-memory Egeria (no live server):
    • sub-folders followed, and flat reads elsewhere;
    • cycles, the depth cap, and never walking up or across;
    • sub-folder errors, zoned specs in shared and private caches, and hidden or deleted sub-folders;
    • the consumer index, plus the root env var and the CLI flags.
  • Full 3.13 micro-suite on the branch: 2793 tests, 0 failures.
  • Architect read-back: PASS.

To be released as 6.2.33 (release branch prepared separately). The owner merges.

🤖 Generated with Claude Code

…ndex

Report-spec consumer folders, phase 2 (design D5, sections 2 and 5): Egeria-held specs only.

sync_report_specs(recursive=None, depth_cap=5, index_consumers=True):
- Follows CollectionFolder members of a named folder. Default on for consumer
  folders (ReportSpecFolder::Consumer::...), off for any other folder;
  --recursive / --no-recursive on `pyegeria report-specs sync` override it.
- Cycle guard (each GUID read once) and a depth cap (5 levels below the named
  folder). Never follows a RootCollection or a sibling consumer folder.
- A spec found in a sub-folder is recorded against the named folder.
- The report names folders_read and depth_cap_reached ("Depth cap reached").
  A capped walk or a sub-folder read error keeps the folder's cached specs:
  not read is not "no longer a member".
- After a folder sync it refreshes the consumer index; report.consumers says
  whether the root was read. Its failure never fails the sync.

Consumer index: build_consumer_index / refresh_consumer_index /
read_consumer_index. Reads the root (PYEGERIA_REPORT_SPEC_ROOT, default
RootCollection::ReportSpecs) once, names and labels only, and returns
{label: [consumer, ...]} plus every consumer folder with its own status.
Cached as consumers.json beside the spec manifest (kept by the prune), memoised
on mtime. Absence is never "none": an unreadable or missing root is
status "not read" with the reason; an unreadable or capped consumer makes it
"partial".

Tests (in-memory Egeria): sub-folders followed, flat by default elsewhere, a
cycle and a second path read once, the depth cap, never up or across, a
sub-folder error keeps cached specs, the index (read, refreshed by a sync, not
read, root error, partial, cycle-safe and capped), the root env, the CLI flags.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…s are gone

Read-back 2026-11-10 (Architect), consumer folders phase 2:

C-1 (required, design §9 in code): a shared sync (the cache's manifest is
shared, e.g. the Portal's) skips any ReportSpec that carries a governance
zone, until B6's public-only read. Zones are read from the 6.2 header key
elementHeader.zoneMembership (and the legacy classifications list), on the
member listing and again on the full element. The skip reads "zoned: not
synced into a shared cache (until B6's public-only read); zones ...", and a
cached copy is pruned. A private (per-user) cache still takes zoned specs.
The consumer index, also a shared file, leaves zoned labels out with a note.

C-2: a sub-folder whose member read is refused as not visible
(OPEN-METADATA-SECURITY-403-020 / is_not_visible_error) or not found (404)
is gone: its specs are pruned and the report says so. Only a genuine error
(timeout, 5xx) keeps the cache as before.

Tests: a zoned spec directly in the consumer folder and in a sub-folder
(header key and legacy list), a private sync still taking them, a spec zoned
after caching pruned from a shared cache, zones only on the full element,
the index without zoned labels, a hidden and a deleted sub-folder pruned,
and a timeout still keeping the cache.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson merged commit b31c6bc into odpi:main Nov 10, 2026
6 checks passed
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