Skip to content

/api/users/{orcid}/gp response shape changed (object→list) and is untested after Blazegraph removal #163

Description

@kltm

Summary

GET /api/users/{orcid}/gp changed behavior in the Blazegraph→index migration (commit 4449261, PR #136, umbrella #137). The change was not called out in the PR and has no test coverage. It needs a deliberate, documented contract before/around the 0.4.0 cutover.

Observed behavior (v0.4.0 vs current production 0.3.9)

For ORCID 0000-0003-1813-6857 (the repo's valid_orcids test fixture) and 0000-0002-1706-4196:

0.4.0 (index-backed) — a bare JSON list of GO-CAM model IDs:

["59dc728000000351", "5f46c3b700001031", "60ad85f700001873", "..."]   // 12 items

production 0.3.9 (SPARQL) — a JSON object reporting not-found (with HTTP 200):

{"status_code": 404, "detail": "Item with ID 0000-0003-1813-6857 not found", "headers": null}

So the old endpoint effectively returns nothing for these contributors — including the documented-valid fixture orcid — while the new one returns real data from the contributor index.

Points that need a decision

  1. Shape change (object → bare list) — a breaking change for any consumer; should be intentional and documented (changelog).
  2. Naming vs content — the route is /gp (gene products) but the new payload is GO-CAM model IDs (gomodel ids), not gene products. Intended? Consider renaming/relabeling.
  3. Old endpoint returned 404/empty for valid orcids, so the new behavior is arguably an improvement — but the cutover should be a conscious choice, not a silent side effect.

No test coverage

tests/unit/test_users_endpoints.py (on main) contains only imports and orphaned fixtures (valid_orcids, gene_ids, …) and zero def test_ functions — the user-endpoint tests were removed during the migration and the fixtures left dangling. No test anywhere exercises /api/users/{orcid}/gp (the /gp references elsewhere in the suite are all the unrelated /api/gp/{id}/models route).

Proposed

  • Confirm the intended contract (list-of-model-ids? rename? error shape on miss?).
  • Add hit + miss test coverage for /api/users/{orcid}/gp.

Context

PR #136 ("Remove blazegraph") intentionally removed the deprecated /api/users and /api/groups endpoints, but did not mention re-shaping the surviving /api/users/{orcid}/gp. Historical context on the old user endpoints: #92.

— Posted by Claude Code agent on behalf of @kltm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Low-priority bot thotSomething that a bot thought of during coding; not something we're going to chase right now.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions