Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SC-1063 provide orb that adds support for SonarCloud in CircleCI #2

Merged
2 commits merged into from
Oct 9, 2019

Conversation

tom-vanbraband-sonarsource
Copy link
Contributor

No description provided.

Copy link

@benoit-sns benoit-sns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

README.md Outdated
```yaml
version: 2.1
orbs:
sonarcloud: sonarsource/sonarcloud@dev:alpha

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can already change to v1.0.0

@tom-vanbraband-sonarsource tom-vanbraband-sonarsource force-pushed the feature/tom/SC-1063/orb branch 2 times, most recently from 3306dd0 to 97315d6 Compare October 1, 2019 09:56
command: mkdir -p /tmp/cache/scanner
- restore_cache:
keys:
- v<<parameters.cache_version>>-sonarcloud-scanner-4.1.0.1829
Copy link
Contributor

@simonbrandhof simonbrandhof Oct 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scanner version does not need to be part of the cache key. The cached files are compatible with all versions of scanners.

Suggested change
- v<<parameters.cache_version>>-sonarcloud-scanner-4.1.0.1829
- v<<parameters.cache_version>>-sonarcloud-scanner

Copy link

@jrnail23 jrnail23 Oct 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks like a cache for the (versioned) sonar-scanner executable, not necessarily a cache of generated files
(sorry to butt in here, I've been following this issue, and have already created a similar orb myself)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, the cache will hold the scanner executable, and the plugins downloaded by the scanner. It is not a big deal if we remove it, but if we ever want to use another scanner executable version then we should change the cache name.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tom-vanbraband-sonarsource, have you been able to get it to avoid downloading plugins by caching? It seems that even when I'm using a cache, sonar-scanner still downloads plugins every time, and it's the longest 17 seconds of my life.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no I failed to make it work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jrnail23, the SONAR_USER_HOME variable determines among other things the directory where your downloaded plugins are stored. So you can use that to make sure that your plugins are stored within the circleci cache directory.

environment:
SONARQUBE_SCANNER_PARAMS: '{"sonar.host.url":"https://dogfood-core.sc-dev.io"}'
- save_cache:
key: v<<parameters.cache_version>>-sonarcloud-scanner-4.1.0.1829
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
key: v<<parameters.cache_version>>-sonarcloud-scanner-4.1.0.1829
key: v<<parameters.cache_version>>-sonarcloud-scanner


$SCANNER_DIRECTORY/sonar-scanner-$VERSION-$OS/bin/sonar-scanner
environment:
SONARQUBE_SCANNER_PARAMS: '{"sonar.host.url":"https://dogfood-core.sc-dev.io"}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not forget to replace sonarcloud.io!

Suggested change
SONARQUBE_SCANNER_PARAMS: '{"sonar.host.url":"https://dogfood-core.sc-dev.io"}'
SONARQUBE_SCANNER_PARAMS: '{"sonar.host.url":"https://sonarcloud.io"}'

@ghost ghost merged commit 2de8678 into master Oct 9, 2019
@ghost ghost deleted the feature/tom/SC-1063/orb branch October 9, 2019 07:03
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants