How to automatically add issues to GitHub repo from Sonarcloud issues - sonarqube

After every Sonarcloud analysis of my GitHub repo, I get informed of issues and bugs on Sonarcloud's project page. Is there a way to automate the process to get those issues published to GitHub issues of my repository?
Edit:
Also see this question: How do I get Sonarcloud to run on pull requests from forks with Travis, Maven & github and this answer to it: https://stackoverflow.com/a/45776416.

Related

Gitlab fork option greyed out

The fork option is greyed out for me I have developer access what do I do?
I’m told for importing to github to look for the project url e.g
I also don't see that button in the first image do I have to fork first? Also, if so do pulls using github desktop automatically pull to the main branch in gitlab, or do I need to pull in gitlab as well.
What is the least technical way of using gitlab?
The fork option in your project probably been disabled. This setting can be changed in the Project:
Settings -> General -> Visibility, project features, permissions
However you need to be a Maintainer or above.
If you want to import a GitLab project to GitHub, see Transfer git repositories from GitLab to GitHub - can we, how to and pitfalls (if any)?

Upsource with TeamCity build on Pull request

I have project hosted on Bitbucket and I'm using Upsource for reviews/pull requests. Is there a way how to setup TeamCity to build branch which is on review?
I saw guide fro the Github which is sadly not applicable to Bitbucket since adding +:refs/pull/*/merge didn't change anything.
I would like to have work-flow like this.
Create review
TeamCity runs build
Icon in Upsource indicates that build was ok

How can we enforce mandatory reviews in GitHub but still allow Maven release builds from CI?

We would like to use mandatory code reviews on pull requests in GitHub Enterprise 2.10 (using the "Require pull request reviews before merging" feature in the repository protected branch settings).
However, when we enable this feature, Maven release builds fail, since the release plugin tries to push the new SNAPSHOT version to the repository using the credentials of the user that runs the TeamCity release build.
Has anyone come up with an approach that works for this? Our requirements are:
Require code reviews for normal commits/pull requests
Allow automated release builds to commit the updated POM versions
Have all commits done by specific non-shared user accounts
I found this answer on a related question: https://stackoverflow.com/a/47006088
My impression is that if you leave the "include administrators" checkbox unchecked, then you can use a repository owner with the release plugin. The trade off is you would then rely on discipline from your developers who are repository owners to not skip the review process.

SonarQube preview mode for pull request shows all issues instead of diff

We'd like to have code analysis results from SonarQube in Stash pull requests, more precisely only for the changed/added code.
The setup looks like this:
Atlassian Bitbucket v4.14.4
Jenkins ver. 2.69
SonarQube Version 6.4 (with sonar-stash plugin from https://github.com/AmadeusITGroup/sonar-stash)
Jenkins fetches changes in branches and builds them. Depending on the branch it will then (for the development branch) call SonarQube to (per default) publish its analysis. For pull requests we want a preview, so SonarQube is called with the parameter -Dsonar.analysis.mode=preview. Additional parameters for the sonar-stash plugin are working so that the analysis result is sent to Stash (Bitbucket) from SonarQube. The problem is, that the results contain all issues/bugs/violations based on the complete source code, not on the changes.
Narrowed this issue down to a problem that the sonar-stash plugin uses a list of issues which are filtered to contain only those issues that are new and linked to a file. So it looks like all issues are marked as new which is strange because in SonarQube we have a baseline for our known (legacy) issues.
Thanks for your time and feedback!
I had a pretty similar issue, my resolution is outlined in the answers below.
My SonarQube Pull Request Issues only question

Having some problems integrating TeamCity, GitHub and Visual Studio

What I want to do:
I want to set up Continuous Integration with Team City for a project that's hosted on GitHub.
What's Currently Working
I'm properly connected to GitHub. Commits, pushing, etc etc all seem to be fine.
TeamCity is set up and I can kick off a build which will run and run my unit tests, but...
What's Not Working
When I do a TeamCity build, it looks like it's pulling down code from GitHub before doing the build or running unit tests. I want to trigger a TC build when I do a commit, before it does the push to GitHub. I don't really want it to pull any code out of GitHub before running the TC build. This doesn't seem to be working at all.
I've set up a BuildTrigger which is a VCS Trigger. I've checked the box that says Trigger a Build on Each Check-in. I added a rule to the BuildTrigger with the VCS (Github) source and my username.
When I do a commit, I don't notice TC doing anything. When I then push the commit to GitHub, TC doesn't do anything either. I see no builds queuing or anything like that.
Any clues on what I'm doing incorrectly?
Thanks!
Have you looked at TeamCity's pre-tested commit feature? It doesn't work exactly as you described you would like your workflow to operate, but it might be useful. I've used it with Subversion in the past and it works pretty well, I haven't used it with Git but JetBrains state it also works with Git.
However, the most common workflow for Git is to create feature/bugfix branches for everything you do, which allows you to commit and push freely, and merge to master when you are ready. GitHub makes the merge (and optional code review) step painless and TeamCity has built-in support to automatically build branches, see the TeamCity documentation on feature branches for specific details it provides.

Resources