Jan Richter closed issue #15: Database entries order at Beraldo Leal / Insights4CI

Jan Richter
2022-08-16T11:41:06Z

We need to change the order in which the entries are stored into the database during the fetching from CI backend. This problem is related to all objects from Pipelines to Tests.

Right now, the isights4CI sores data in the order which is provided by CI backend and doesn't check it. Unfortunately, the GitLab api provides rows in descending order from the new one to the oldest one. This behavior casing that the database ID doesn't correspond to the age of the entries. This problem becoming more obvious when we fetch new data to the existing project.

This is the order now:

id | date
1 | 9.6.2022
2 | 8.6.2022
3 | 7.6.2022
4 | 6.6.2022
5 | 9.7.2022
6 | 8.7.2022
7 | 7.7.2022
8 | 6.7.2022

How the order should look like:

id | date
1 | 6.6.2022
2 | 7.6.2022
3 | 8.6.2022
4 | 9.6.2022
5 | 6.7.2022
6 | 7.7.2022
7 | 8.7.2022
8 | 9.7.2022