gayanak
(Gayana Karade)
February 6, 2024, 2:07pm
1
Hello,
I am trying to get the right Gtihub Repository that is associated with the sonar cloud project. By reverse engineering, I found out the below URL will retrieve the repo name.
"https://sonarcloud.io/api/navigation/component?component=$PROJECT_KEY"'
I’m just concerned that this API is not published API. Will this change over the future and break what we have in place? Do you have plans to release this API by any chance?
Colin
(Colin)
February 7, 2024, 3:21pm
2
It’s an internal API that’s unlikely (but not impossible) to change.
Can you explain your use-case a bit more, about needing to derive the repo from the SonarCloud project? How will you use the information?
Hi
I will check when a project is removed in git it will also removed in SonarCloud.
How i can accomplish this without scm url ?
I have found this:
https://api.sonarcloud.io/dop-translation/project-bindings?projectId= **********
Colin
(Colin)
July 31, 2024, 6:18am
4
Hey @Yannick_DENIMAL
If your project is bound , you can use the API that @gayanak mentioned in the original post.
If your project isn’t bound, you’re going to have a hard time tracing the SonarCloud project back to a repo in any automated fashion.
Hi,
We have no bound projects!
We pay for LOC!
For me it’s a due to have api to limit our costs!
Colin
(Colin)
July 31, 2024, 8:07am
6
If you bind your projects, you’ll have the link you’re looking for. If not, unfortunately, we can’t create the mapping out of thin air.