From eaad08a7ff320d2d92bf4ae0e13eba408b17eca2 Mon Sep 17 00:00:00 2001 From: Matias Melograno Date: Tue, 30 Nov 2021 16:33:43 -0300 Subject: [PATCH 01/14] added keyHashTags option --- CHANGES.txt | 3 + .../Cache/Storage/Adapter/PRedis.php | 56 +++++++++++--- src/SplitIO/Version.php | 2 +- tests/Suite/Adapter/RedisAdapterTest.php | 73 +++++++++++++++++++ 4 files changed, 123 insertions(+), 11 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 00964a8c..732140f0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +7.1.0 (Nov XX, 2021) + - Added `keyHashTags` option for cluster to select one against several passed. + 7.0.0 (Nov 23, 2021) - BREAKING CHANGE: Removed support from versions older than PHP 7.3. - BREAKING CHANGE: Removed SharedMemory (shmop) component for Segments. diff --git a/src/SplitIO/Component/Cache/Storage/Adapter/PRedis.php b/src/SplitIO/Component/Cache/Storage/Adapter/PRedis.php index 620a8850..99399f5e 100644 --- a/src/SplitIO/Component/Cache/Storage/Adapter/PRedis.php +++ b/src/SplitIO/Component/Cache/Storage/Adapter/PRedis.php @@ -67,6 +67,19 @@ private function isValidSentinelConfig($sentinels, $options) return true; } + private function validateKeyHashtTag($keyHashTag) + { + if (!is_string($keyHashTag)) { + return array('valid' => false, 'msg' => 'keyHashTag must be string.'); + } + if ((strlen($keyHashTag) < 3) || ($keyHashTag[0] != "{") || + (substr($keyHashTag, -1) != "}") || (substr_count($keyHashTag, "{") != 1) || + (substr_count($keyHashTag, "}") != 1)) { + return array('valid' => false, 'msg' => 'keyHashTag is not valid.'); + } + return array('valid' => true, 'msg' => ''); + } + /** * @param mixed $options * @return string @@ -77,19 +90,42 @@ private function getDefaultKeyHashTag($options) if (!isset($options['keyHashTag'])) { return "{SPLITIO}"; } - $keyHashTag = $options['keyHashTag']; - if (!is_string($keyHashTag)) { - throw new AdapterException("keyHashTag must be string."); - } else { - if ((strlen($keyHashTag) < 3) || ($keyHashTag[0] != "{") || - (substr($keyHashTag, -1) != "}") || (substr_count($keyHashTag, "{") != 1) || - (substr_count($keyHashTag, "}") != 1)) { - throw new AdapterException("keyHashTag is not valid."); + $validation = $this->validateKeyHashtTag($options['keyHashTag']); + if (!($validation['valid'])) { + throw new AdapterException($validation['msg']); + } + return $options['keyHashTag']; + } + + + /** + * @param mixed $options + * @return string + * @throws AdapterException + */ + private function selectKeyHashTag($options) + { + if (!isset($options['keyHashTags'])) { // check if array keyHashTags is set + return $this->getDefaultKeyHashTag($options); // defaulting to keyHashTag or {SPLITIO} + } + $keyHashTags = $options['keyHashTags']; + $msg = $this->isValidConfigArray($keyHashTags, 'keyHashTags'); // check if is valid array + if (!is_null($msg)) { + throw new AdapterException($msg); + } + $filteredArray = array_filter( // filter to only use string element {X} + $keyHashTags, + function ($value) { + return $this->validateKeyHashtTag($value)['valid']; } + ); + if (count($filteredArray) == 0) { + throw new AdapterException('keyHashTags size is zero after filtering valid elements.'); } - return $keyHashTag; + return $selected = $filteredArray[array_rand($filteredArray, 1)]; } + /** * @param array $clusters * @return bool @@ -143,7 +179,7 @@ private function getRedisConfiguration($options) switch ($_options['distributedStrategy']) { case 'cluster': if ($this->isValidClusterConfig($clusters)) { - $keyHashTag = $this->getDefaultKeyHashTag($_options); + $keyHashTag = $this->selectKeyHashTag($_options); $_options['cluster'] = 'redis'; $redisConfigutation['redis'] = $clusters; $prefix = isset($_options['prefix']) ? $_options['prefix'] : ''; diff --git a/src/SplitIO/Version.php b/src/SplitIO/Version.php index 5221d02a..a79cc839 100644 --- a/src/SplitIO/Version.php +++ b/src/SplitIO/Version.php @@ -3,5 +3,5 @@ class Version { - const CURRENT = '7.0.0'; + const CURRENT = '7.1.0-rc1'; } diff --git a/tests/Suite/Adapter/RedisAdapterTest.php b/tests/Suite/Adapter/RedisAdapterTest.php index 7bfb440a..7708f6ea 100644 --- a/tests/Suite/Adapter/RedisAdapterTest.php +++ b/tests/Suite/Adapter/RedisAdapterTest.php @@ -401,6 +401,79 @@ public function testRedisWithoutCustomKeyHashtagClusters() $predis->getItem('this_is_a_test_key'); } + public function testRedisWithClustersKeyHashTags() + { + $this->expectException( + 'SplitIO\Component\Cache\Storage\Exception\AdapterException', + "keyHashTags must be array." + ); + $predis = new PRedis(array( + 'clusterNodes' => array( + 'tcp://MYIP:26379?timeout=3' + ), + 'options' => array( + 'distributedStrategy' => 'cluster', + 'keyHashTags' => '{TEST}' + ) + )); + + $predis->getItem('this_is_a_test_key'); + } + + public function testRedisWithClustersKeyHashTagsInvalid() + { + $this->expectException( + 'SplitIO\Component\Cache\Storage\Exception\AdapterException', + "keyHashTags size is zero after filtering valid elements." + ); + $predis = new PRedis(array( + 'clusterNodes' => array( + 'tcp://MYIP:26379?timeout=3' + ), + 'options' => array( + 'distributedStrategy' => 'cluster', + 'keyHashTags' => array(1, 2) + ) + )); + + $predis->getItem('this_is_a_test_key'); + } + + public function testRedisWithClustersKeyHashTagsInvalidHashTags() + { + $this->expectException( + 'SplitIO\Component\Cache\Storage\Exception\AdapterException', + "keyHashTags size is zero after filtering valid elements." + ); + $predis = new PRedis(array( + 'clusterNodes' => array( + 'tcp://MYIP:26379?timeout=3' + ), + 'options' => array( + 'distributedStrategy' => 'cluster', + 'keyHashTags' => array("one", "two", "three") + ) + )); + + $predis->getItem('this_is_a_test_key'); + } + + public function testRedisWithClustersKeyHashTagsValid() + { + $this->expectException('\Predis\ClientException'); + $predis = new PRedis(array( + 'clusterNodes' => array( + 'tcp://MYIP:26379?timeout=3' + ), + 'options' => array( + 'distributedStrategy' => 'cluster', + 'keyHashTags' => array("{one}", "{two}", "{three}") + ) + )); + + $predis->getItem('this_is_a_test_key'); + } + public function testRedisSSLWithClusterFails() { $this->expectException('SplitIO\Component\Cache\Storage\Exception\AdapterException'); From fcd9d7895d2eed7f4e0edb5186547286736a8f95 Mon Sep 17 00:00:00 2001 From: Matias Melograno Date: Fri, 3 Dec 2021 12:47:02 -0300 Subject: [PATCH 02/14] feedback applied --- CHANGES.txt | 2 +- src/SplitIO/Component/Cache/Storage/Adapter/PRedis.php | 6 +++--- src/SplitIO/Version.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 732140f0..91fdd890 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,5 @@ 7.1.0 (Nov XX, 2021) - - Added `keyHashTags` option for cluster to select one against several passed. + - Added a new option to use when running Redis in cluster mode called `keyHashTags` which receives a list of hashtags from which the SDK will randomly pick one to use on the generated instance. 7.0.0 (Nov 23, 2021) - BREAKING CHANGE: Removed support from versions older than PHP 7.3. diff --git a/src/SplitIO/Component/Cache/Storage/Adapter/PRedis.php b/src/SplitIO/Component/Cache/Storage/Adapter/PRedis.php index 99399f5e..b3f9d60c 100644 --- a/src/SplitIO/Component/Cache/Storage/Adapter/PRedis.php +++ b/src/SplitIO/Component/Cache/Storage/Adapter/PRedis.php @@ -67,7 +67,7 @@ private function isValidSentinelConfig($sentinels, $options) return true; } - private function validateKeyHashtTag($keyHashTag) + private function validateKeyHashTag($keyHashTag) { if (!is_string($keyHashTag)) { return array('valid' => false, 'msg' => 'keyHashTag must be string.'); @@ -90,7 +90,7 @@ private function getDefaultKeyHashTag($options) if (!isset($options['keyHashTag'])) { return "{SPLITIO}"; } - $validation = $this->validateKeyHashtTag($options['keyHashTag']); + $validation = $this->validateKeyHashTag($options['keyHashTag']); if (!($validation['valid'])) { throw new AdapterException($validation['msg']); } @@ -116,7 +116,7 @@ private function selectKeyHashTag($options) $filteredArray = array_filter( // filter to only use string element {X} $keyHashTags, function ($value) { - return $this->validateKeyHashtTag($value)['valid']; + return $this->validateKeyHashTag($value)['valid']; } ); if (count($filteredArray) == 0) { diff --git a/src/SplitIO/Version.php b/src/SplitIO/Version.php index a79cc839..f6d34498 100644 --- a/src/SplitIO/Version.php +++ b/src/SplitIO/Version.php @@ -3,5 +3,5 @@ class Version { - const CURRENT = '7.1.0-rc1'; + const CURRENT = '7.1.0'; } From 98fd4822bbc3c38cc49fa668be5f2ecde659c022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Daniel=20Fad=C3=B3n?= Date: Fri, 3 Dec 2021 13:05:09 -0300 Subject: [PATCH 03/14] Force rebuild From 05af9d8b2296320d747ef44c1195ccc92c6c2072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Daniel=20Fad=C3=B3n?= Date: Fri, 3 Dec 2021 13:12:07 -0300 Subject: [PATCH 04/14] Fixing workflow --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++++++- sonar-scanner.sh | 41 ---------------------------------------- 2 files changed, 38 insertions(+), 42 deletions(-) delete mode 100755 sonar-scanner.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2fa395cc..4fa20a2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,11 @@ name: ci on: push: branches: + - develop - master pull_request: branches: + - develop - master jobs: @@ -37,7 +39,42 @@ jobs: composer update composer dumpautoload - - name: script + - name: Build run: | vendor/bin/phpcs --ignore=functions.php --standard=PSR2 src/ vendor/bin/phpunit -c phpunit.xml.dist -v --testsuite integration + + - name: SonarQube Scan (Push) + if: github.event_name == 'push' + uses: SonarSource/sonarcloud-github-action@v1.5 + env: + SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} + with: + projectBaseDir: . + args: > + -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} + -Dsonar.projectName=${{ github.event.repository.name }} + -Dsonar.projectKey=${{ github.event.repository.name }} + -Dsonar.sources='./src' + -Dsonar.exclusions='**/tests/**/*.*' + -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" + -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" + + - name: SonarQube Scan (Pull Request) + if: github.event_name == 'pull_request' + uses: SonarSource/sonarcloud-github-action@v1.5 + env: + SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} + with: + projectBaseDir: . + args: > + -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} + -Dsonar.projectName=${{ github.event.repository.name }} + -Dsonar.projectKey=${{ github.event.repository.name }} + -Dsonar.sources='./src' + -Dsonar.exclusions='**/tests/**/*.*' + -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" + -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" + -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} + -Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} + -Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} diff --git a/sonar-scanner.sh b/sonar-scanner.sh deleted file mode 100755 index c82e7fa6..00000000 --- a/sonar-scanner.sh +++ /dev/null @@ -1,41 +0,0 @@ -#/bin/bash -e - -sonar_scanner() { - local params="$@" - - vendor/bin/sonar-scanner \ - -Dsonar.host.url='https://sonarqube.split-internal.com' \ - -Dsonar.login="$SONAR_TOKEN" \ - -Dsonar.ws.timeout='300' \ - -Dsonar.sources='./src' \ - -Dsonar.projectName='php-client' \ - -Dsonar.exclusions='**/tests/**/*.*' \ - -Dsonar.links.ci='https://travis-ci.com/splitio/php-client' \ - -Dsonar.links.scm='https://github.com/splitio/php-client' \ - "${params}" - - return $? -} - -if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then - sonar_scanner \ - -Dsonar.pullrequest.provider='GitHub' \ - -Dsonar.pullrequest.github.repository='splitio/php-client' \ - -Dsonar.pullrequest.key=$TRAVIS_PULL_REQUEST \ - -Dsonar.pullrequest.branch=$TRAVIS_PULL_REQUEST_BRANCH \ - -Dsonar.pullrequest.base=$TRAVIS_BRANCH -else - if [ "$TRAVIS_BRANCH" == 'master' ]; then - sonar_scanner \ - -Dsonar.branch.name=$TRAVIS_BRANCH - else - if [ "$TRAVIS_BRANCH" == 'develop' ]; then - TARGET_BRANCH='master' - else - TARGET_BRANCH='develop' - fi - sonar_scanner \ - -Dsonar.branch.name=$TRAVIS_BRANCH \ - -Dsonar.branch.target=$TARGET_BRANCH - fi -fi From c281939d841553b1a827e96aaff8af2e551cc55e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Daniel=20Fad=C3=B3n?= Date: Fri, 3 Dec 2021 13:17:11 -0300 Subject: [PATCH 05/14] Adding secondary job for sonarqube --- .github/workflows/ci.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4fa20a2e..adeda3ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,10 @@ on: - develop - master +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.run_number || github.event.pull_request.number }} + cancel-in-progress: true + jobs: build: name: Build @@ -44,6 +48,13 @@ jobs: vendor/bin/phpcs --ignore=functions.php --standard=PSR2 src/ vendor/bin/phpunit -c phpunit.xml.dist -v --testsuite integration + sonarqube: + name: Sonarqube + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: SonarQube Scan (Push) if: github.event_name == 'push' uses: SonarSource/sonarcloud-github-action@v1.5 @@ -55,7 +66,7 @@ jobs: -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} -Dsonar.projectName=${{ github.event.repository.name }} -Dsonar.projectKey=${{ github.event.repository.name }} - -Dsonar.sources='./src' + -Dsonar.sources="${{ github.workspace }}/src" -Dsonar.exclusions='**/tests/**/*.*' -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" @@ -71,7 +82,7 @@ jobs: -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} -Dsonar.projectName=${{ github.event.repository.name }} -Dsonar.projectKey=${{ github.event.repository.name }} - -Dsonar.sources='./src' + -Dsonar.sources="${{ github.workspace }}/src" -Dsonar.exclusions='**/tests/**/*.*' -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" From 56c6cdce78a40f24a0f36fbb230a1dbd9b7bc130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Daniel=20Fad=C3=B3n?= Date: Fri, 3 Dec 2021 13:19:25 -0300 Subject: [PATCH 06/14] Adding secondary job for sonarqube --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index adeda3ab..dc2a2778 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,10 @@ name: ci on: - push: + pull_request: branches: - develop - master - pull_request: + push: branches: - develop - master From 6036f13f20b73efb9f84438796b4efa8233ec72c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Daniel=20Fad=C3=B3n?= Date: Fri, 3 Dec 2021 13:21:20 -0300 Subject: [PATCH 07/14] Removing concurrency --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc2a2778..97909821 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,10 +9,6 @@ on: - develop - master -concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.run_number || github.event.pull_request.number }} - cancel-in-progress: true - jobs: build: name: Build From 46253c824ab0b199754fd8060065693a1519897b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Daniel=20Fad=C3=B3n?= Date: Fri, 3 Dec 2021 13:23:22 -0300 Subject: [PATCH 08/14] Fixing sonarqube --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97909821..8abd2e0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,6 @@ jobs: -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} -Dsonar.projectName=${{ github.event.repository.name }} -Dsonar.projectKey=${{ github.event.repository.name }} - -Dsonar.sources="${{ github.workspace }}/src" -Dsonar.exclusions='**/tests/**/*.*' -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" @@ -78,7 +77,6 @@ jobs: -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} -Dsonar.projectName=${{ github.event.repository.name }} -Dsonar.projectKey=${{ github.event.repository.name }} - -Dsonar.sources="${{ github.workspace }}/src" -Dsonar.exclusions='**/tests/**/*.*' -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" From cbc1803ec8c28804cd95ec524706a253cb73ead3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Daniel=20Fad=C3=B3n?= Date: Fri, 3 Dec 2021 13:29:11 -0300 Subject: [PATCH 09/14] Removed project key --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8abd2e0a..f7cf11f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,6 @@ jobs: args: > -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} -Dsonar.projectName=${{ github.event.repository.name }} - -Dsonar.projectKey=${{ github.event.repository.name }} -Dsonar.exclusions='**/tests/**/*.*' -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" @@ -76,7 +75,6 @@ jobs: args: > -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} -Dsonar.projectName=${{ github.event.repository.name }} - -Dsonar.projectKey=${{ github.event.repository.name }} -Dsonar.exclusions='**/tests/**/*.*' -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" From 700c700a892188919ee77046680cabb4f0e662a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Daniel=20Fad=C3=B3n?= Date: Fri, 3 Dec 2021 13:31:20 -0300 Subject: [PATCH 10/14] Copied proper project key --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7cf11f2..f7ab52b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,6 +61,7 @@ jobs: args: > -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} -Dsonar.projectName=${{ github.event.repository.name }} + -Dsonar.projectKey='splitsoftware_split-sdk-php' -Dsonar.exclusions='**/tests/**/*.*' -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" @@ -75,6 +76,7 @@ jobs: args: > -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} -Dsonar.projectName=${{ github.event.repository.name }} + -Dsonar.projectKey='splitsoftware_split-sdk-php' -Dsonar.exclusions='**/tests/**/*.*' -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" From 39b5565db011d6ba340fc4ee12fef42836d899ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Daniel=20Fad=C3=B3n?= Date: Fri, 3 Dec 2021 13:34:07 -0300 Subject: [PATCH 11/14] Copied proper project key --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7ab52b0..4f516150 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,8 +61,8 @@ jobs: args: > -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} -Dsonar.projectName=${{ github.event.repository.name }} - -Dsonar.projectKey='splitsoftware_split-sdk-php' - -Dsonar.exclusions='**/tests/**/*.*' + -Dsonar.projectKey="splitsoftware_split-sdk-php" + -Dsonar.exclusions="**/tests/**/*.*" -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" @@ -76,8 +76,8 @@ jobs: args: > -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} -Dsonar.projectName=${{ github.event.repository.name }} - -Dsonar.projectKey='splitsoftware_split-sdk-php' - -Dsonar.exclusions='**/tests/**/*.*' + -Dsonar.projectKey="splitsoftware_split-sdk-php" + -Dsonar.exclusions="**/tests/**/*.*" -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} From aa347e1b4169a3a3040c3058e1cdc58c81841012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Daniel=20Fad=C3=B3n?= Date: Fri, 3 Dec 2021 13:36:58 -0300 Subject: [PATCH 12/14] Copied proper project key --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f516150..87d587c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: SonarQube Scan (Push) if: github.event_name == 'push' @@ -61,7 +63,7 @@ jobs: args: > -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} -Dsonar.projectName=${{ github.event.repository.name }} - -Dsonar.projectKey="splitsoftware_split-sdk-php" + -Dsonar.projectKey=splitsoftware_split-sdk-php -Dsonar.exclusions="**/tests/**/*.*" -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" @@ -76,7 +78,7 @@ jobs: args: > -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} -Dsonar.projectName=${{ github.event.repository.name }} - -Dsonar.projectKey="splitsoftware_split-sdk-php" + -Dsonar.projectKey=splitsoftware_split-sdk-php -Dsonar.exclusions="**/tests/**/*.*" -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" From 4a04bea8f978fba231306ee3ef025714feb6458d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Daniel=20Fad=C3=B3n?= Date: Fri, 3 Dec 2021 13:44:56 -0300 Subject: [PATCH 13/14] Better variable name --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87d587c0..3adde2dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: - 6379:6379 strategy: matrix: - php-versions: ['7.3', '8.0'] + version: ['7.3', '8.0'] steps: - name: Checkout code uses: actions/checkout@v2 @@ -28,7 +28,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php-versions }} + php-version: ${{ matrix.version }} extensions: mbstring, intl ini-values: post_max_size=256M, max_execution_time=180 coverage: xdebug From 7bee9ec46e4737905c02298fd017cbb828d4e4f1 Mon Sep 17 00:00:00 2001 From: Matias Melograno Date: Fri, 3 Dec 2021 13:50:41 -0300 Subject: [PATCH 14/14] updated changelog --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 91fdd890..120d55bc 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -7.1.0 (Nov XX, 2021) +7.1.0 (Dec 3, 2021) - Added a new option to use when running Redis in cluster mode called `keyHashTags` which receives a list of hashtags from which the SDK will randomly pick one to use on the generated instance. 7.0.0 (Nov 23, 2021)