简体   繁体   中英

StashIssueReportingPostJob not enabled - how to enable?

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!

根据插件的代码,你必须添加参数-Dsonar.stash.notification=true

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 ie "$ git branch" returns "master"

  3. Issue a pull request for master to update your local master in local repo ie "$ 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM