Bug report: Web API endpoint search_gitlab_repos lists old component data instead of new

Hi @Colin Any updates with the new year?

Hey @lfvjimisola

Unfortunately, no updates to share. This ticket did not make it into the upcoming LTA.

Did you see my previous questions?

Yes, when we automate creating projects etc in our CI/CD and lookup to see if a GitLab project exists in SonarQube the API will return one project (the older one) instead of returning a list or at least the newest (active one).

To cite from my initial message:

two components that had the same GitLab project id and the older one was the one showing up in search_gitlab_repos instead of the current one.

I guess what I’m trying to understand is that right now:

  • You use the endpoint to determine whether or not there’s already a repo bound to the project
  • Right now you only get a single project even when there are multiple (agreed it’s not great, that’s why there’s a ticket)

However, now you know that at least one project is linked to that repo. What does your automation do that it needs to know the latest?

I’m not questioning your use-case, just trying to understand it completely to see if there’s anything I can suggest.

The project that is linked is not the current project.

Yes, it’s returning one project but the incorrect one. The returned project is of no use and there is no way to determine what the current (correct) project in your API now as I see it. Please advise if I’m wrong.