Skip to content

fix(tech-catalog): read both survey-report payload shapes for an annotation - #605

Merged
mandy-chessell merged 1 commit into
odpi:mainfrom
dwolfson:fix/survey-report-singular-fallback
Oct 4, 2026
Merged

mandy-chessell merged 1 commit into
odpi:mainfrom
dwolfson:fix/survey-report-singular-fallback

Conversation

@dwolfson

@dwolfson dwolfson commented Oct 4, 2026

Copy link
Copy Markdown
Member

Follow-up to #604 (annotation reuse / fromSurveyReports).

Problem

_survey_reports() reads only the list fromSurveyReports. That is only the payload pyegeria passes through; a platform that has not moved to it still returns the single fromSurveyReport, and against that every annotation looks report-less. The running quickstart platform is one of those (its annotation beans carry a singular fromSurveyReport dict at graph depth 1 and no plural).

Measured on the live quickstart with the plural-only helper from main: 0 of 16 survey reports return any annotations from GET /api/tech-catalog/survey-reports/{guid}/annotations, so the report drill-down and report filter are empty and the Annotations table loses its report column and "go to report" button.

Change (quickstart and freshstart)

_survey_reports() reads fromSurveyReports and, when that is absent or empty, wraps the single fromSurveyReport as a one-item list, so one code path serves both payloads. The list wins when both are present and nothing is duplicated; a wrongly typed list field is ignored and a lone dict in it is tolerated. No change to callers (_serialize_annotation, the report-annotations endpoint) or to tech-catalog.html.

Measured on the live platform with the fix: 8 of the 16 survey reports return annotations (460 in total, bounded by the page size).

Tests

  • tests/test_survey_reports_payload.py: 14 cases run against the helper extracted (via ast) from each handler file, i.e. 28 tests, without importing pyegeria or FastAPI. List newest-first; singular fallback; list wins when both present; empty list falls back; no link; malformed entries; wrongly typed field; lone dict; missing createTime sorts last.
  • Against the previous (plural-only) handlers the singular-payload, empty-list and wrongly-typed cases fail, so the tests detect the problem.
  • Live check described above.
  • Not exercised against a platform that returns the plural form (none available here); the plural path is covered by the unit tests only.

🤖 Generated with Claude Code

…tation

_survey_reports() read only the list fromSurveyReports (odpi#604). That is
only the payload pyegeria passes through: a platform that has not moved to it still returns the
single fromSurveyReport, and against that every annotation looked report-less. The running
quickstart platform is one of those: with the plural-only helper, 0 of its 16 survey reports
return any annotations from /api/tech-catalog/survey-reports/{guid}/annotations (the report
drill-down and report filter are empty), and the Annotations table loses its report column and
"go to report" button.

The helper now reads fromSurveyReports and, when that is absent or empty, wraps the single
fromSurveyReport as a one-item list, so one code path serves both payloads (the list wins when
both are present; nothing is duplicated). A wrongly typed list field is ignored and a lone dict
in it is tolerated. Quickstart and freshstart.

Verified on the live platform: with the fix, 8 of the 16 survey reports return annotations
(460 in total, bounded by the page size) where the plural-only handler returned none.

Tests: tests/test_survey_reports_payload.py runs 14 cases against the helper extracted from each
handler file (28 tests), without importing pyegeria or FastAPI. Against the previous handlers the
single-payload, empty-list and wrongly-typed cases fail.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson dwolfson self-assigned this Oct 4, 2026
@mandy-chessell
mandy-chessell merged commit e43077c into odpi:main Oct 4, 2026
7 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.

2 participants