Skip to content

migrate-cache should also normalize enum cache files #15

@cmungall

Description

@cmungall

Problem

migrate-cache currently only handles */terms.csv files (curie, label, retrieved_at). It does not touch the enum membership cache files in cache/enums/*.csv (curie-only format).

These enum cache files suffer from the same ordering instability — they're written in non-deterministic order depending on which code path generated them (_save_enum_cache sorts, but _add_to_enum_cache appends). Existing files on disk may be unsorted even though newer code paths produce sorted output.

Expected

migrate-cache --sort-only should also find and sort enums/*.csv files by CURIE, so that a single command normalizes all cache artifacts.

Current workaround

for f in cache/enums/*.csv; do
  head -1 "$f" > /tmp/header.csv
  tail -n+2 "$f" | sort > /tmp/sorted.csv
  cat /tmp/header.csv /tmp/sorted.csv > "$f"
done

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions