Repository navigation
fix(tech-catalog): read both survey-report payload shapes for an annotation - #605
Merged
mandy-chessell merged 1 commit intoOct 4, 2026
Merged
Conversation
…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>
mandy-chessell
approved these changes
Oct 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #604 (annotation reuse /
fromSurveyReports).Problem
_survey_reports()reads only the listfromSurveyReports. That is only the payload pyegeria passes through; a platform that has not moved to it still returns the singlefromSurveyReport, and against that every annotation looks report-less. The running quickstart platform is one of those (its annotation beans carry a singularfromSurveyReportdict 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 fromGET /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()readsfromSurveyReportsand, when that is absent or empty, wraps the singlefromSurveyReportas 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 totech-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 (viaast) 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.🤖 Generated with Claude Code