eclipse-apoapsis / ort-server

A scalable server implementation of the OSS Review Toolkit.
https://eclipse-apoapsis.github.io/ort-server/
Apache License 2.0
19 stars 8 forks source link

Provide unique IDs for items retrieved with list queries #1228

Open Etsija opened 1 month ago

Etsija commented 1 month ago

In front-end, we have a need to create dynamic parametrized routes for the details of items retrieved from back-end, for example rule violations, vulnerabilities and issues. This will give us the opportunity to dedicate more informative and visual sub-pages to inspect the details of these items, instead of just showing the details as part of the main table, as we have done for vulnerabilities and rule violations so far.

For construction of these parametrized routes, we need from back-end an id for each item, which is unique in some related context. This context can vary; for example, ortRunId is not globally unique, but it is unique within a repository, so we are using it when constructing a list of ORT runs for a repository.

As many (if not all) database tables in ORT Server contain a unique Id of type bigint for each item in a table, it would be extremely convenient for us if the back-end would return those ids as part of the items returned in a list query.

Screenshot from 2024-10-14 11-39-45

mnonnenmacher commented 4 weeks ago

The main problem with providing unique ids is that the query endpoints do not always map directly to a single table. Instead, the SQL queries behind the endpoints could join multiple tables, making it not obvious which id could be used and risking that ids are not unique. Some ideas how this could be addressed:

Some requirements to consider: