Skip to content

feat(esm_catalog): PR-C2 — personal collections (storage + API routes)#1495

Open
siligam wants to merge 1 commit into
esm-catalog/pr-c1-middleware-exportfrom
esm-catalog/pr-c2-personal-collections
Open

feat(esm_catalog): PR-C2 — personal collections (storage + API routes)#1495
siligam wants to merge 1 commit into
esm-catalog/pr-c1-middleware-exportfrom
esm-catalog/pr-c2-personal-collections

Conversation

@siligam

@siligam siligam commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Provenance: this implementation is substantially Paul Gierz's work, carried over from his esm-tools-plus/simcat/pgierz-workbench prototype branch (commits Mar–Apr 2026). This PR ports it, largely as-is, into the reviewable stack.

  • Adds storage/personal.py: PersonalCollectionStore — DuckDB-backed per-user collections with RBAC (owner/maintainer/developer/viewer roles), item refs, labels, shared access, and sidebar tree
  • Adds api/personal_models.py: Pydantic request/response models for all personal-collections endpoints
  • Adds api/personal_routes.py: create_personal_router() — full CRUD under /users/{username}/... for collections, items, labels, shares, and tree; open-access (no auth required when authenticator=None)
  • Wires router into create_app() inside a try/except so the API degrades gracefully if personal.duckdb is inaccessible
  • Adds pytz to [catalog] extras and CI pip install line — required by DuckDB TIMESTAMPTZ column deserialization
  • 25 new tests covering storage layer (direct) + all route groups (via TestClient)

Test plan

  • pytest src/esm_catalog/tests/test_personal_collections.py -v — 25 pass
  • pytest src/esm_catalog/tests/ — 162 total green
  • CI esm-catalog-tests passes on Python 3.9 + 3.12

Stack position

release → PR-0 → A1a → A1b-1 → A1b-2 → A2 → A3 → A4 → B1 → B2 → B3 → B4 → C1 → C2 (this PR)

🤖 Generated with Claude Code

@siligam
siligam force-pushed the esm-catalog/pr-c1-middleware-export branch from 5f8f856 to c06cb4f Compare June 14, 2026 00:12
@siligam
siligam force-pushed the esm-catalog/pr-c2-personal-collections branch from 986cbba to 422c646 Compare June 14, 2026 00:13
@siligam
siligam force-pushed the esm-catalog/pr-c1-middleware-export branch from c06cb4f to a095781 Compare June 17, 2026 12:14
@siligam
siligam force-pushed the esm-catalog/pr-c2-personal-collections branch from 422c646 to e2e2e23 Compare June 17, 2026 12:14
@siligam
siligam force-pushed the esm-catalog/pr-c1-middleware-export branch from a095781 to 73dbc73 Compare June 17, 2026 16:01
@siligam
siligam force-pushed the esm-catalog/pr-c2-personal-collections branch from e2e2e23 to 4b1519f Compare June 17, 2026 16:01
@siligam
siligam force-pushed the esm-catalog/pr-c1-middleware-export branch from 73dbc73 to 96e0047 Compare June 17, 2026 16:34
@siligam
siligam force-pushed the esm-catalog/pr-c2-personal-collections branch from 4b1519f to 57a7f07 Compare June 17, 2026 16:34
Adds DuckDB-backed PersonalCollectionStore (CRUD for collections, items,
labels, tree, and shares), Pydantic models, and /users/{username}/...
REST API routes. Routes are wired into create_app() via try/except so
the API degrades gracefully if the DB is unavailable. Adds pytz to CI
and setup.py extras (required by DuckDB TIMESTAMPTZ columns). 25 new
tests, 162 total green.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@siligam
siligam force-pushed the esm-catalog/pr-c1-middleware-export branch from 96e0047 to 5f389e0 Compare June 17, 2026 17:03
@siligam
siligam force-pushed the esm-catalog/pr-c2-personal-collections branch from 57a7f07 to 2eec95a Compare June 17, 2026 17:03
@siligam

siligam commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the corrected PR-0 base (#1483) — test relocation to tests/test_esm_catalog/, restored dedicated CI workflow at the new path, and a couple of CI fixes (doctest-collection exclusion, eval_type_backport for pydantic on Python 3.9). No change to this PR's own diff/scope. CI is green.

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