How to get ALM setting key for sonarqube?
Hi, I want to get project name's git lab repository url, but I don't know how to get ALM setting key. Please help me, thanks! SonarQube Server Version: Community EditionVersion 8.9.3 (build 48735)
from sonarqube.enterprise import SonarEnterpriseClient
def sonar_ent_connector() -> SonarEnterpriseClient:
sonarqube_ent_client = SonarEnterpriseClient(sonarqube_url=SQ_URL, token=SQ_TOKEN)
sonar_ent_credential = sonarqube_ent_client.auth.check_credentials()
if "true" not in sonar_ent_credential.lower():
raise Exception("Permission authentication failure.")
return sonarqube_ent_client
prj_key = "ABDevUtils"
sqe_connector.alm_integrations.search_gitlab_repos(almSettings="xxxx", projectName=prj_key)
@shijl0925 Any updates for this questions ?
how about use the create_gitlab fuction, such as:
almSettings = sonarqube_ent_client.alm_settings.create_gitlab(key, personalAccessToken, url)
- I have configured sonarqube server and imported all projects from git lab. Do I still need to use “create_gitlab” to create almSettings ?
- For function "alm_settings.create_gitlab(key, personalAccessToken, url)" key – Unique key of the GitLab instance setting, I want to know how to get the GitLab instance setting, Where do I know where to get personalAccessToken and url.
Thank you very much. @shijl0925
Hi, @shijl0925 Could you help me to resolve this question ? I would like to get gitlab project repository url by sonar project key. so, could you provide an example?
Hi @shijl0925, Can you provide an example of how to use Sonar Key or Sonar Name to get its git project address?
@binbjz were you able to figure out how to do this? Facing a similar problem.
@binbjz @timothestes Hi all, I know it's a bit late, but the almSetting is actually the configuration name.
When you go here /admin/settings?category=almintegration&alm=gitlab is the first parameter in bold.