Integration Percy visual regression testing status check with Github - github

I am trying to integrate Percy.io, a visual regression testing tool with Github status check.
I have signed up for free account with Percy and paid Github version.
I wanted to setup status check with Percy with each pull request as below suggested at percy doc on status check
I have integrated Percy in Github
Added rules in Github
but still don't see check on pull request.
Added same project in percy.io too
Any Idea what I am missing over here?

It's hard to be specific without knowing more about your application, however one piece that seems to be missing from your setup is a CI/CD configuration.
Basically, you need a Continuous Integration service (such as Travis, Jenkins, CircleCI or others to trigger a build for your project so that percy can capture snapshots. Did you configure one?
See the documentation here.
Here an example configuration for one of my projects. Note that how you set this up may differ if you use a different set of tools than what's in the article.

Related

SonarQube + Azure DevOps + Pipeline as Code - Is it possible?

The company I work on recently purchased SonarQube Enterprise to improve code quality throughout all repositories. I found out that there is a feature that enables SonarQube to comment automatically on PRs targeting a specific branch, and I successfully managed to try that out.
Thing is:
That configuration is not scalable: I would need to manually configure every repo to follow that rule
That configuration needs a build pipeline to be defined "old school" on Azure DevOps to work, and we are moving into Pipeline as Code, starting of course with CI (where this takes place)
Anyone managed to get the PR commenting working in that scenario? Or, at least, solving the #1 problem?
Cheers
You can use REST APIs to do whatever configuration you need to do across your repositories. Refer to the REST API documentation.
Shouldn't matter, although I haven't tested it. The SonarQube tasks aren't aware of whether the build source is YAML or visual designer/classic/JSON builds. The underlying tasks and job running architecture is the same. As long as the build is hooked up to a branch policy, it should still work.

How do I disable a Github check for Google Cloud Build

I've installed the Google Cloud Build app from Github Marketplace, and enabled it on several repositories, only to discover that enabling access for those repositories automatically starts running the Google Cloud Build "check" after every PR or push to a PR. Since some of those repositories are not actually ready for Google Cloud build, I needed to turn off the checks... I used the URL mentioned in the docs to get to the page where you can select which repositories should be connected to your GCP project, and unchecked a bunch of them... this disconnected them from the project, but, surprisingly, did not disable the Github checks! So now, there are Github checks on several repositories that just result in an error because they're not connected to any projects in Cloud Build.
Surely, it is not an uncommon use case to need a way to "disable Checks" on a per-repository basis - is there any way to do that?
(If not, consider it a requested feature if there are any Google Engineers reading!) ;)
I did talk to chat support, and the only way we could figure out to remove the checks would be to uninstall Google Cloud Build completely from the entire organization, which I don't want to do because we do have some setup that I want to keep, and I don't know how much of that configuration would have to be redone if I uninstalled it completely.
Here is a screenshot of the broken check that I can't disable:
I think there are 2 steps to disable CloudBuild,
1. Disable on CloudBuild itself. For some time I kept seeing 2 builds per push made, but disabling a trigger on CloudBuild helped fix that.
2. On Github, you can configure the Cloudbuild app to monitor a specific repo on the organization level setting.
3. If you feel a lot adventurous though and it's not solved, on the project level setting, you could delete the Webhooks integration for cloudbuild, as that's what Github notifies of each build.
It can be found within GH App installations:
https://console.cloud.google.com/gcb-github-registration
Select the GH account used for your link between Cloud Build and GH, then the GCP project you want to edit.
Here connected repositories can be edited, and in the second step (Trigger settings), the "Default GitHub Checks" can be disabled.
You can also goto settings of your repository and click installations inside settings.
And then remove Google cloud build from Installed apps and authorized github apps.
Cloud Build Triggers are still in beta, and have gone through several updates since this question was posted, but it now appears that the "Github Default Checks" are no longer hidden from management. They are now explicitly offered (but not automatically created) when connecting a repo, and you can finally view and disable (or delete) individual "Github Default Checks" on the trigger management page: https://console.cloud.google.com/cloud-build/triggers
I'll leave this as unanswered, because I'm uncertain this is how it is working for everyone, or that this answer will remain true, but if it works for you, feel free to vote up the answer!
To link GCP Project to the Github repository, create a trigger by clicking on resolve link, besides Action Required and then disable the same. For me this procedure worked out.

How to prevent the pull request integration for SonarQube to report issues as inline comments on Githuib?

I configured SonarQube analysis to report it's status to pull requests on my GitHub project. SonarCloud already supports pull requests as first class citizen as described in https://blog.sonarsource.com/sonarcloud-loves-your-build-pipeline. As I understand, this kind of integration is not using the GitHub Plugin for SonarQube.
The configuration provides these properties (look here for the complete configuration)
sonar.pullrequest.provider
sonar.pullrequest.github.repository
sonar.pullrequest.branch
sonar.pullrequest.key
The credentials for the technical user are set in the SonarCloud project administration.
You can see the results here: https://github.com/BudgetFreak/BudgetFreak/pull/86#pullrequestreview-125364230
Every issue is reported as an inline comment, one summary comment is made and the status is reported for the code-quality/sonarqube check.
I would like to disable the inline comment on every issue. This was possible using the GitHub plugin. Can this also be achieved with the new pull request integration?
Unfortunately, on SonarCloud, this feature is not available.

SonarQube and Github, Travis CI

Is there any way to programmatically check say, using the GitHub API or some API for Travis CI, if a particular project on GitHub or Travis CI uses SonarQube?
Also apart from SonarQube what other program analysis tools do people usually use?
Neither GitHub API nor Travis CI API will be able to provide you with such information - simply because code analysis tools/services are third-party systems that are not built-in features of GitHub or Travis CI.
If you want to "see how many open source projects on GitHub use static program analysis tools", then you would have to browse the source code of each repository to discover some facts that might give you this information (like for instance looking into the .travis.yml file). But because there's no built-in/standard feature on that topic, this would be extremely difficult to correctly achieve this goal IMO.

Custom Github Shields

How do you make custom GitHub shields that track status on your repository?
I am using shields.io and have figured out how to use a Jenkins plugin to expose the build status and create a shield, but wondering how others automate status for code coverage, documentation coverage, linting, unit tests, etc?
Code coverage, linting, etc. are provided by various services that you have to sign up with. For example, coveralls.io provides test coverage. Another popular service that provides many different types of code analysis and coverage tools is Code Climate. Most of those sites provide badges you can add to your GitHub repo, usually in the README.
For example, a repo I maintain has accounts with Travis, Gemnasium, and Code Climate, and I have badges for those services on my README: https://github.com/monfresh/ohana-sms