splitio / react-client

React JS SDK client for Split Software
https://split.io
Other
27 stars 10 forks source link

AUT-1705: Adding SonarQube for react-client. #118

Closed gpochettino closed 1 year ago

gpochettino commented 1 year ago

React SDK

What did you accomplish?

Adding SonarQube step to CI in order have a check for code quality

Since main and development are two permanent branches, we are having two executions in order to make sonar to know about the parent branch.

How do we test the changes introduced in this PR?

Testing from this PR if the step is being executed and giving the right output.

From SonarQube site this PR is being analyzed and showing code coverage. https://sonarqube.split-internal.com/dashboard?id=react-client&pullRequest=118 Screen Shot 2022-12-15 at 10 02 46

Enabled decoration for PR: Screen Shot 2022-12-15 at 10 02 58

Extra Notes

Node version using lts/ was bringing node 18, so that caused problems to build. I updated it to 16.16.0 which was working. I did that since I checked from previous successful builds where lts/ was pulling node 16.16.0.

In order to get the blame information to SonarQube, we told GitHubActions to clone the entire history. This was done on this section:

      - name: Checkout code
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

From SonarQube site I applied the following changes:

Set master & development branches as active branches. Enabled PullRequest decoration

sonarqube-pull-requests[bot] commented 1 year ago

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information