cta-observatory / ctapipe

Low-level data processing pipeline software for CTAO or similar arrays of Imaging Atmospheric Cherenkov Telescopes
https://ctapipe.readthedocs.org
BSD 3-Clause "New" or "Revised" License
64 stars 268 forks source link

Sonarqube setup does not work in PRs from forks #2577

Closed maxnoe closed 2 months ago

maxnoe commented 3 months ago

The CI run fails because the job from your fork doesn't have access to SONAR_TOKEN.

Which is really not good and we should have noticed earlier... how to we proceed here? Convert the SONAR_TOKEN from a secret to a simple env variable? Doesn't seem like a good idea.

Originally posted by @maxnoe in https://github.com/cta-observatory/ctapipe/issues/2573#issuecomment-2214368482

maxnoe commented 3 months ago

A possible solution is described here:

https://community.sonarsource.com/t/how-to-use-sonarcloud-with-a-forked-repository-on-github/7363/30

The jobs that run in the PR context upload the coverage report as artifact, which triggers a workflow in the main repo that then talks to the sonar qube server.

maxnoe commented 2 months ago

For some reason the sonar job triggered by the fork does not have branch / or number I formation it seems

maxnoe commented 2 months ago

Fixed now by a series of trial / error fixes.