-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Issue #12431: Re-enable sonar #12433
Conversation
please beware of wercker leftovers Line 581 in 7e0f153
|
fad931d
to
ddb2bc0
Compare
119a99d
to
877e54e
Compare
# execution on local for non-master: | ||
# SONAR_TOKEN=xxxxxx PR=xxxxxx WERCKER_GIT_BRANCH=xxxxxx ./.ci/wercker.sh sonarqube | ||
if [[ $PR && $PR =~ ^([0-9]*)$ ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check for $PR
is redundant if we update regexp to have at least one character
SONAR_PR_VARIABLES="-Dsonar.pullrequest.key=$PR_NUMBER" | ||
SONAR_PR_VARIABLES+=" -Dsonar.pullrequest.branch=$PR_BRANCH_NAME" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable names were not clear, updated these
SONAR_PR_VARIABLES+=" -Dsonar.pullrequest.base=master" | ||
echo "SONAR_PR_VARIABLES: ""$SONAR_PR_VARIABLES" | ||
fi | ||
if [[ -z $SONAR_TOKEN ]]; then echo "SONAR_TOKEN is not set"; sleep 5s; exit 1; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
converted one liner to have better formatting, I can move this to separate commit if need be
export MAVEN_OPTS='-Xmx2000m' | ||
# until https://github.com/checkstyle/checkstyle/issues/11637 | ||
# shellcheck disable=SC2086 | ||
mvn -e --no-transfer-progress -Pno-validations clean package sonar:sonar $SONAR_PR_VARIABLES \ | ||
mvn -e --no-transfer-progress -Pno-validations clean package sonar:sonar \ | ||
$SONAR_PR_VARIABLES \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to resolve shellcheck issue here, but quoting this variable is problematic, as maven interprets it as one argument.
export PR_NUMBER=$CIRCLE_PR_NUMBER | ||
export PR_BRANCH_NAME=$CIRCLE_BRANCH | ||
export SONAR_API_TOKEN=$SONAR_TOKEN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this to make sure that we do not have CI-specific details in the script
# - validate-with-maven-script: | ||
# name: "sonarqube" | ||
# image-name: *custom_img | ||
# command: "./.ci/validation.sh sonarqube" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to jq installation, context usage, and environment variables, I have moved this to it's own job.
@@ -22,7 +22,7 @@ if [ -z "$CE_TASK_ID" ]; then | |||
exit 1 | |||
fi | |||
|
|||
TASK_URL="$SONAR_SERVER/api/ce/task\?id=$CE_TASK_ID" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\
in link was problematic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok to merge
877e54e
to
a29d2f6
Compare
@@ -72,7 +72,28 @@ jobs: | |||
export PR_NUMBER=$CIRCLE_PR_NUMBER | |||
<< parameters.command >> | |||
|
|||
sonarqube: | |||
docker: | |||
- image: checkstyle/jdk-11-groovy-git-mvn:11.0.13__3.0.9__2.25.1__3.6.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
groovy
3.0.9
https://github.com/checkstyle/contribution/tree/master/checkstyle-tester#setup
groovy (2.4.8) is required to execute
which version ci using ?
Just pointing out I think we need to make these all consistent otherwise it will get confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I have been thinking about having one image for all CI, since we do so many similar things
#12431
Proof that analysis is uploading correctly: https://sonarcloud.io/summary/new_code?id=org.checkstyle%3Acheckstyle&pullRequest=12433
Proof of failed build from commit 119a99d
Link to dashboard of failed build: https://sonarcloud.io/dashboard?id=org.checkstyle%3Acheckstyle&pullRequest=12433