StashIssueReportingPostJob not enabled - how to enable?

送分小仙女□ 提交于 2019-12-11 07:06:50

问题


using the AmadeusIT sonar-stash plugin...

After branching from main for feature/sprint we updated code locally and added, committed and pushed to BitBucket, creating a pull request. We'd like to run a scan and see the issues presently only for the code we just issued a PR for... I run sonar-scanner with this invocation:

sonar-scanner -Dsonar.analysis.mode=preview -Dsonar.stash.pullrequest.id=8 -
Dsonar.stash.repository=StaticAnalysisPOC -Dsonar.stash.login=myLogin -
Dsonar.stash.password=myPassword -Dsonar.login=sonarLogin -
Dsonar.password=sonarPword -
Dsonar.projectKey=com.company.static:StaticAnalysisPOC -
Dsonar.projectName=stat -Dsonar.projectVersion=1.0.3

output was:

INFO: Executing post-job org.sonar.plugins.stash.StashIssueReportingPostJob
INFO: org.sonar.plugins.stash.StashIssueReportingPostJob@43294e9b 
not enabled, skipping

Tech Stack/Versions;

SonarQube 6.x - latest

BitBucket (on prem) 4.x - latest

Thanks!


回答1:


According to the code of the plugin, you have to add parameter -Dsonar.stash.notification=true




回答2:


My resolution to success was as follows:

  1. Create feature branch off master

  2. Run a clean, vanilla scan with following invocation on master (for baseline scan) as such: "$ sonar-scanner" - this should be called when you are attached to the master on your local machine i.e. "$ git branch" returns "master"

  3. Issue a pull request for master to update your local master in local repo i.e. "$ git pull origin master"

  4. Switch to feature branch on your local machine as such: "$ git checkout "featureBranchName"

5.In Eclipse, if you have the project already open, you can verify you are now attached to feature branch referenced above.

6.Now you may perform your code changes, fixes, etc. as per your desired work on the feature branch.

  1. When work is complete, add, commit and push your changes as such:

    "$ git add ." "$ git commit -m "my commit comment" "$ git push origin myBranchName"

  2. Go to Bitbucket and create a pull request from your newly pushed changes in your feature branch

  3. Take feature branch "pull request id" and append it to this invocation of sonar scanner:

    $ sonar-scanner -Dsonar.analysis.mode=preview -Dsonar.stash.pullrequest.id= <yourPullRequestIDFromAbove> -Dsonar.stash.repository=<YourStashRepo> - Dsonar.stash.login=<StashLoginUser> -Dsonar.stash.password=<stashPassword> - Dsonar.login=<SonarLogin> - Dsonar.password=<sonarPassword> -Dsonar.stash.notification=true - Dsonar.projectKey=<ProjectKey> -Dsonar.projectName=<projectNameInSonar> - Dsonar.stash.project=<StashProjectName> -Dsonar.projectVersion= <projectVersion>

10.Review the issues as found in Bitbucket for your pull request ID



来源:https://stackoverflow.com/questions/46532960/stashissuereportingpostjob-not-enabled-how-to-enable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!