You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tamaya.apache.org by "P. Ottlinger" <po...@apache.org> on 2019/04/21 21:13:31 UTC

[workInProgress] Sonar-Integration: working manually at the moment

Hi guys,

I'm working on a Sonarcloud-integration of Tamaya
via TAMAYA-277.

Any new code smells result in red builds.

At the moment only manual uploads are possible as I'm waiting for a hint
from INFRA on how to configure credentials properly (don't want to put
them in .travis.yml and am unsure if they are correct in ASF-Jenkins).

Sorry for all the mailspam ;) -
happy easter,

Phil


Re: [workInProgress] Sonar-Integration: working manually at the moment

Posted by Aaron Coburn <aa...@gmail.com>.
That's great. Thanks for your persistence in getting this to work!

Aaron

On Tue, Apr 23, 2019 at 4:21 PM P. Ottlinger <po...@apache.org> wrote:

> Am 22.04.19 um 21:38 schrieb P. Ottlinger:
> > @Aaron, thanks for your hints and ideas ....
>
> It seems that comments from all three of us seemed to help.
>
> I managed to get green builds that said to have sent data to SonarCloud.
>
> The next code change should prove me right or wrong :-)
>
> During the coming days I'll try to do the same trick for our other repos.
> Phil
>

Re: [workInProgress] Sonar-Integration: working manually at the moment

Posted by "P. Ottlinger" <po...@apache.org>.
Am 22.04.19 um 21:38 schrieb P. Ottlinger:
> @Aaron, thanks for your hints and ideas ....

It seems that comments from all three of us seemed to help.

I managed to get green builds that said to have sent data to SonarCloud.

The next code change should prove me right or wrong :-)

During the coming days I'll try to do the same trick for our other repos.
Phil

Re: [workInProgress] Sonar-Integration: working manually at the moment

Posted by "P. Ottlinger" <po...@apache.org>.
@Aaron, thanks for your hints and ideas ....

I tried to apply most of them (as I'm unable to install the travis GEM
locally on my Ubuntu box) I tried the integration via environment variable.

Unfortunately not that successful :(

I also started a thread on builds@apache.org -
let's see if someone comes up with a hint ;)

Cheers,
Phil

Am 22.04.19 um 14:55 schrieb Aaron Coburn:
> The second approach involves adjusting the settings in the Travis-CI web
> interface: https://travis-ci.org/apache/incubator-tamaya/settings
> 
> Under the "Environment Variables" section, you'd need to add an entry with
> the Name set to SONAR_TOKEN and the Value set to the value of the token
> from Sonarcloud. Make sure that "Display value in build log" is set to
> "false".
> 
> I tend to like the second option because it means you can rotate tokens
> without having to adjust the code. Also, as a side note, the `travis
> encrypt` command makes use of the repository's name to generate the secure
> token, so after Tamaya graduates and the repository changes from
> `incubator-tamaya` to just `tamaya`, that secure token (if that's the path
> you choose) would need to be regenerated.

Re: [workInProgress] Sonar-Integration: working manually at the moment

Posted by Aaron Coburn <aa...@gmail.com>.
There are two ways (that I know of) to add these credentials to the Travis
configuration without including them as plain text. I take it that you've
already generated a token from the sonar cloud interface. For both
approaches, you'll need to add this to the .travis.yml file:

addons:
    sonarcloud:
        organization: (I think this would be "apache")

One option is to create an encrypted version of the token. Documentation is
here:
https://docs.travis-ci.com/user/environment-variables/#defining-encrypted-variables-in-travisyml

For this, there is a ruby gem called `travis`. Once installed ($ gem
install travis), you can run

   $ travis encrypt <the-sonar-token>

The output of that command is the secure token, which would go here:

addons:
    sonarcloud:
        token:
            secure: <token-goes-here>

The second approach involves adjusting the settings in the Travis-CI web
interface: https://travis-ci.org/apache/incubator-tamaya/settings

Under the "Environment Variables" section, you'd need to add an entry with
the Name set to SONAR_TOKEN and the Value set to the value of the token
from Sonarcloud. Make sure that "Display value in build log" is set to
"false".

I tend to like the second option because it means you can rotate tokens
without having to adjust the code. Also, as a side note, the `travis
encrypt` command makes use of the repository's name to generate the secure
token, so after Tamaya graduates and the repository changes from
`incubator-tamaya` to just `tamaya`, that secure token (if that's the path
you choose) would need to be regenerated.

Best,
Aaron


On Sun, Apr 21, 2019 at 8:19 PM Anatole Tresch <at...@gmail.com> wrote:

> sounds great!
>
> P. Ottlinger <po...@apache.org> schrieb am So., 21. Apr. 2019, 23:13:
>
> > Hi guys,
> >
> > I'm working on a Sonarcloud-integration of Tamaya
> > via TAMAYA-277.
> >
> > Any new code smells result in red builds.
> >
> > At the moment only manual uploads are possible as I'm waiting for a hint
> > from INFRA on how to configure credentials properly (don't want to put
> > them in .travis.yml and am unsure if they are correct in ASF-Jenkins).
> >
> > Sorry for all the mailspam ;) -
> > happy easter,
> >
> > Phil
> >
> >
>

Re: [workInProgress] Sonar-Integration: working manually at the moment

Posted by Anatole Tresch <at...@gmail.com>.
sounds great!

P. Ottlinger <po...@apache.org> schrieb am So., 21. Apr. 2019, 23:13:

> Hi guys,
>
> I'm working on a Sonarcloud-integration of Tamaya
> via TAMAYA-277.
>
> Any new code smells result in red builds.
>
> At the moment only manual uploads are possible as I'm waiting for a hint
> from INFRA on how to configure credentials properly (don't want to put
> them in .travis.yml and am unsure if they are correct in ASF-Jenkins).
>
> Sorry for all the mailspam ;) -
> happy easter,
>
> Phil
>
>

Re: [solved] Sonar-Integration: working manually at the moment

Posted by "P. Ottlinger" <po...@apache.org>.
Hi again,

all 3 repos are linked to SonarCloud now -
at the moment the SonarCloud side does not seem to take the most current
branch into account, but I hope this gets fixed automagically once new
code changes happen.

If there are any other problems let me know or reopen TAMAYA-277 ;)

I used the same token (generated directly after logging in to
SonarCloud) for all 3 jobs, the rest is documented in the ticket:
https://issues.apache.org/jira/browse/TAMAYA-277

Cheers + HTH
Philipp

Am 21.04.19 um 23:13 schrieb P. Ottlinger:
> Hi guys,
> 
> I'm working on a Sonarcloud-integration of Tamaya
> via TAMAYA-277.
> 
> Any new code smells result in red builds.
> 
> At the moment only manual uploads are possible as I'm waiting for a hint
> from INFRA on how to configure credentials properly (don't want to put
> them in .travis.yml and am unsure if they are correct in ASF-Jenkins).
> 
> Sorry for all the mailspam ;) -
> happy easter,
> 
> Phil
>