Page MenuHomePhabricator

Change GET /api/lists/{list_pk}/revisions/{id}/ to emit full info on tools contained in the list
Closed, ResolvedPublic

Description

So would the way to go here be to modify the /api/lists/{list_pk}/revisions/{id}/ endpoint so that it returns the tools as a list of objects, just like /api/lists/{id}/ does?

I think this would be reasonable, yes. I think it would mostly be a matter of updating the ToolListRevisionDetailSerializer class used to render the retrieve action of ToolListRevisionViewSet to replace its embedded ToolListHistoricVersionSerializer member with a ToolListSerializer. It is probably a bit more complicated than this in practice as the data currently passed to ToolListHistoricVersionSerializer would only have the tool_names list of names and the tools many-to-many relation's full tool details.

I think it would mostly be a matter of updating the ToolListRevisionDetailSerializer class used to render the retrieve action of ToolListRevisionViewSet to replace its embedded ToolListHistoricVersionSerializer member with a ToolListSerializer. It is probably a bit more complicated than this in practice as the data currently passed to ToolListHistoricVersionSerializer would only have the tool_names list of names and the tools many-to-many relation's full tool details.

I'm not sure I'd be able to do this change myself as I'd need some time to get familiar with Django and the backend first.

For the data from the /api/lists/{id}/ and /api/lists/{list_pk}/revisions/{id}/ endpoints to be interchangeable in the ListView component so that it can be used to display both current lists and list revisions, the latter would have to return the following info:

  • created_by
  • created_date
  • tools as a list of objects instead of as a list of tool names.

/api/lists/{id}/ returns all three of these, /api/lists/{list_pk}/revisions/{id}/ currently does not.

Event Timeline

Slst2020 moved this task from Backlog to Research needed on the Toolhub board.

Change 754552 had a related patch set uploaded (by Raymond Ndibe; author: Raymond Ndibe):

[wikimedia/toolhub@main] lists: Change GET /api/lists/{list_pk}/revisions/{id}/ to emit full info on tools contained in the list

https://gerrit.wikimedia.org/r/754552

Change 754552 merged by jenkins-bot:

[wikimedia/toolhub@main] lists: emit full info on tools contained in a historic revision

https://gerrit.wikimedia.org/r/754552

Change 770638 had a related patch set uploaded (by BryanDavis; author: Bryan Davis):

[operations/deployment-charts@master] toolhub: Bump container version to 2022-03-15-002555-production

https://gerrit.wikimedia.org/r/770638

Change 770638 merged by jenkins-bot:

[operations/deployment-charts@master] toolhub: Bump container version to 2022-03-15-002555-production

https://gerrit.wikimedia.org/r/770638