Skip to content

Commit da9e6f4

Browse files
committed
Fix Sonarqube
1 parent 0e3f3a7 commit da9e6f4

File tree

6 files changed

+56
-43
lines changed

6 files changed

+56
-43
lines changed

.github/pull_request_template.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@
77

88

99
## Extra Notes
10-

.github/workflows/ci.yml

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,41 @@
1-
on: [push, pull_request]
1+
name: ci
2+
on:
3+
pull_request:
4+
branches:
5+
- development
6+
- master
7+
push:
8+
branches:
9+
- development
10+
- master
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
14+
cancel-in-progress: true
215

316
jobs:
417
test:
18+
name: Test
519
runs-on: ubuntu-latest
620
services:
721
redis:
822
image: redis
923
ports:
1024
- 6379:6379
1125
strategy:
26+
fail-fast: false
1227
matrix:
13-
ruby: [ '2.5.0', '3.1.1' ]
28+
ruby:
29+
- '2.5.0'
30+
- '3.1.1'
1431

1532
steps:
1633
- name: Checkout code
17-
uses: actions/checkout@v2
34+
uses: actions/checkout@v3
1835
with:
1936
fetch-depth: 0
2037

21-
- name: Set up Ruby ${{ matrix.ruby }}
38+
- name: Setup Ruby ${{ matrix.ruby }}
2239
uses: ruby/setup-ruby@v1
2340
with:
2441
ruby-version: ${{ matrix.ruby }}
@@ -30,47 +47,37 @@ jobs:
3047
run: bundle exec rake
3148

3249
- name: Fix code coverage paths
33-
working-directory: ./coverage
50+
working-directory: coverage
3451
run: |
3552
sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' .resultset.json
3653
ruby -rjson -e 'sqube = JSON.load(File.read(".resultset.json"))["RSpec"]["coverage"].transform_values {|lines| lines["lines"]}; total = { "RSpec" => { "coverage" => sqube, "timestamp" => Time.now.to_i }}; puts JSON.dump(total)' > .resultset.sonarqube.json
3754
55+
- name: Set VERSION env
56+
run: echo "VERSION=$(cat lib/splitclient-rb/version.rb | grep VERSION | awk -F "'" '{print $2}')" >> $GITHUB_ENV
3857

3958
- name: SonarQube Scan (Push)
40-
if: github.event_name == 'push'
41-
uses: SonarSource/sonarcloud-github-action@v1.5
59+
if: matrix.version == '3.1.1' && github.event_name == 'push'
60+
uses: SonarSource/sonarcloud-github-action@v1.9
4261
env:
4362
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4464
with:
4565
projectBaseDir: .
4666
args: >
4767
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
48-
-Dsonar.projectName=${{ github.event.repository.name }}
49-
-Dsonar.projectKey=${{ github.event.repository.name }}
50-
-Dsonar.ruby.coverage.reportPaths=coverage/.resultset.sonarqube.json
51-
-Dsonar.c.file.suffixes=-
52-
-Dsonar.cpp.file.suffixes=-
53-
-Dsonar.objc.file.suffixes=-
54-
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
55-
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
68+
-Dsonar.projectVersion=${{ env.VERSION }}
5669
5770
- name: SonarQube Scan (Pull Request)
58-
if: github.event_name == 'pull_request'
59-
uses: SonarSource/sonarcloud-github-action@v1.5
71+
if: matrix.version == '3.1.1' && github.event_name == 'pull_request'
72+
uses: SonarSource/sonarcloud-github-action@v1.9
6073
env:
6174
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6276
with:
6377
projectBaseDir: .
6478
args: >
6579
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
66-
-Dsonar.projectName=${{ github.event.repository.name }}
67-
-Dsonar.projectKey=${{ github.event.repository.name }}
68-
-Dsonar.ruby.coverage.reportPaths=coverage/.resultset.sonarqube.json
69-
-Dsonar.c.file.suffixes=-
70-
-Dsonar.cpp.file.suffixes=-
71-
-Dsonar.objc.file.suffixes=-
72-
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
73-
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
80+
-Dsonar.projectVersion=${{ env.VERSION }}
7481
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
7582
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
7683
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}

.github/workflows/update-license-year.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
uses: actions/checkout@v2
1717
with:
1818
fetch-depth: 0
19-
19+
2020
- name: Set Current year
2121
run: "echo CURRENT=$(date +%Y) >> $GITHUB_ENV"
22-
22+
2323
- name: Set Previous Year
2424
run: "echo PREVIOUS=$(($CURRENT-1)) >> $GITHUB_ENV"
2525

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,6 @@ dump.rdb
5353
# Ignore Appraisal gemfile.lock files
5454
/gemfiles/*.gemfile.lock
5555

56-
release.sh
56+
release.sh
57+
58+
.scannerwork

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Overview
55
This SDK is designed to work with Split, the platform for controlled rollouts, which serves features to your users via a Split feature flag to manage your complete customer experience.
6-
6+
77
[![Twitter Follow](https://img.shields.io/twitter/follow/splitsoftware.svg?style=social&label=Follow&maxAge=1529000)](https://twitter.com/intent/follow?screen_name=splitsoftware)
88

99
## Compatibility
@@ -24,11 +24,11 @@ require 'splitclient-rb'
2424
split_factory = SplitIoClient::SplitFactory.new('SDK_API_KEY')
2525
split_client = split_factory.client
2626

27-
begin
28-
split_client.block_until_ready
27+
begin
28+
split_client.block_until_ready
2929
rescue SplitIoClient::SDKBlockerTimeoutExpiredException
30-
puts 'SDK is not ready. Decide whether to continue or abort execution'
31-
end
30+
puts 'SDK is not ready. Decide whether to continue or abort execution'
31+
end
3232

3333
treatment = split_client.get_treatment('CUSTOMER_ID', 'SPLIT_NAME');
3434

@@ -41,25 +41,25 @@ else
4141
end
4242
```
4343
For multi-process environments you also need to setup Split Synchronizer. See [Sharing state: Redis integration](https://help.split.io/hc/en-us/articles/360020673251-Ruby-SDK#sharing-state-redis-integration)
44-
44+
4545
Please refer to [our official docs](https://help.split.io/hc/en-us/articles/360020673251-Ruby-SDK) to learn about all the functionality provided by our SDK and the configuration options available for tailoring it to your current application setup.
4646

4747
## Submitting issues
4848
The Split team monitors all issues submitted to this [issue tracker](https://github.com/splitio/ruby-client/issues). We encourage you to use this issue tracker to submit any bug reports, feedback, and feature enhancements. We'll do our best to respond in a timely manner.
4949

5050
## Contributing
5151
Please see [Contributors Guide](CONTRIBUTORS-GUIDE.md) to find all you need to submit a Pull Request (PR).
52-
52+
5353
## License
5454
Licensed under the Apache License, Version 2.0. See: [Apache License](http://www.apache.org/licenses/).
5555

56-
## About Split
56+
## About Split
5757
Split is the leading Feature Delivery Platform for engineering teams that want to confidently deploy features as fast as they can develop them. Split’s fine-grained management, real-time monitoring, and data-driven experimentation ensure that new features will improve the customer experience without breaking or degrading performance. Companies like Twilio, Salesforce, GoDaddy and WePay trust Split to power their feature delivery.
58-
58+
5959
To learn more about Split, contact [email protected], or get started with feature flags for free at https://www.split.io/signup.
60-
60+
6161
Split has built and maintains SDKs for:
62-
62+
6363
* Java [Github](https://github.com/splitio/java-client) [Docs](https://help.split.io/hc/en-us/articles/360020405151-Java-SDK)
6464
* Javascript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
6565
* Node [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK)
@@ -70,9 +70,9 @@ Split has built and maintains SDKs for:
7070
* GO [Github](https://github.com/splitio/go-client) [Docs](https://help.split.io/hc/en-us/articles/360020093652-Go-SDK)
7171
* Android [Github](https://github.com/splitio/android-client) [Docs](https://help.split.io/hc/en-us/articles/360020343291-Android-SDK)
7272
* iOS [Github](https://github.com/splitio/ios-client) [Docs](https://help.split.io/hc/en-us/articles/360020401491-iOS-SDK)
73-
73+
7474
For a comprehensive list of open source projects visit our [Github page](https://github.com/splitio?utf8=%E2%9C%93&query=%20only%3Apublic%20).
75-
75+
7676
**Learn more about Split:**
77-
77+
7878
Visit [split.io/product](https://www.split.io/product) for an overview of Split, or visit our documentation at [help.split.io](http://help.split.io) for more detailed information.

sonar-project.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sonar.projectKey=ruby-client
2+
sonar.projectKey=ruby-client
3+
sonar.sources=lib
4+
sonar.tests=spec
5+
sonar.ruby.coverage.reportPaths=coverage/.resultset.sonarqube.json

0 commit comments

Comments
 (0)