Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit 5380d1f

Browse files
committed
Merge branch 'release/v2.12.0'
2 parents 089dee2 + 4660e3d commit 5380d1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3630
-1429
lines changed

.github/workflows/ci.yml

Lines changed: 87 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
22

33
on:
4-
- pull_request
5-
- push
4+
pull_request:
5+
push:
6+
branches: '*'
7+
tags: 'v*'
68

79
name: CI
810

@@ -138,6 +140,8 @@ jobs:
138140

139141
runs-on: ubuntu-latest
140142

143+
if: startsWith( github.ref, 'refs/tags/v') == false
144+
141145
steps:
142146
- name: Checkout
143147
uses: actions/checkout@v2
@@ -182,3 +186,84 @@ jobs:
182186
env:
183187
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
184188
run: bash <(curl -s https://codecov.io/bash) || true
189+
190+
release:
191+
if: startsWith( github.ref, 'refs/tags/v')
192+
name: Create release
193+
194+
runs-on: ubuntu-latest
195+
needs: ["coding-guidelines", "unit"]
196+
197+
steps:
198+
- name: Checkout
199+
uses: actions/checkout@v2
200+
201+
- name: Install PHP with extensions
202+
uses: shivammathur/setup-php@v2
203+
with:
204+
php-version: 7.2
205+
extensions: json, mbstring, intl, apcu
206+
tools: composer, phive
207+
ini-values: assert.exception=1, zend.assertions=1, apc.enabled=1, apc.enable_cli=1
208+
209+
- name: Install dependencies with composer
210+
env:
211+
COMMERCETOOLS_CLIENT_ID: ${{ secrets.COMMERCETOOLS_CLIENT_ID }}
212+
COMMERCETOOLS_CLIENT_SECRET: ${{ secrets.COMMERCETOOLS_CLIENT_SECRET }}
213+
COMMERCETOOLS_PROJECT: ${{ secrets.COMMERCETOOLS_PROJECT }}
214+
run: composer install --no-ansi --no-interaction --no-progress --no-suggest --no-dev
215+
216+
- name: Retrieve branch name
217+
id: branch_name
218+
run: |
219+
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
220+
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
221+
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
222+
223+
- name: Install box
224+
env:
225+
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
226+
run: phive install humbug/box --force-accept-unsigned
227+
228+
- name: Compile phar
229+
run: tools/box compile
230+
231+
- uses: actions/upload-artifact@v1
232+
with:
233+
name: commercetools-php-sdk-${{ steps.branch_name.outputs.SOURCE_TAG }}.phar
234+
path: commercetools-php-sdk.phar
235+
236+
- name: Read changeset
237+
id: changeset
238+
run: |
239+
CHANGESET=`php tools/extract_changelog.php`
240+
CHANGESET="${CHANGESET//'%'/'%25'}"
241+
CHANGESET="${CHANGESET//$'\n'/'%0A'}"
242+
CHANGESET="${CHANGESET//$'\r'/'%0D'}"
243+
echo "::set-output name=changes::$CHANGESET"
244+
245+
- name: Create Release
246+
id: create_release
247+
uses: actions/create-release@v1
248+
env:
249+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
250+
with:
251+
tag_name: ${{ github.ref }}
252+
release_name: ${{ github.ref }}
253+
draft: true
254+
prerelease: false
255+
body: |
256+
${{ steps.changeset.outputs.changes }}
257+
258+
- name: Upload Release Asset
259+
id: upload-release-asset
260+
uses: actions/upload-release-asset@v1
261+
env:
262+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
263+
with:
264+
# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object,
265+
# which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
266+
upload_url: ${{ steps.create_release.outputs.upload_url }}
267+
asset_path: ./commercetools-php-sdk.phar
268+
asset_name: commercetools-php-sdk.phar
269+
asset_content_type: application/php-archive

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ tests/integration/requests.log
2626
tests/fixtures/NotificationExtension.php
2727
tools/http-client.private.env.json
2828
yarn.lock
29+
.phpunit.result.cache
30+
tests/cache/commercetools_io_access_token*

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# [2.12.0](https://github.com/commercetools/commercetools-php-sdk/compare/v2.11.1...v2.12.0) (2020-10-12)
2+
3+
4+
### Features
5+
6+
* **Error:** add response body to exception message for BadRequest ([a0511ab](https://github.com/commercetools/commercetools-php-sdk/commit/a0511ab887b3636063cac0dc39eb09578fa04d05))
7+
* **Order:** migrate the first tests and create the fixture ([39b16f2](https://github.com/commercetools/commercetools-php-sdk/commit/39b16f2c3910bf7fe09d88cedbe9afcdfef8ec96))
8+
* **Project:** support country taxRate fallback ([35001b8](https://github.com/commercetools/commercetools-php-sdk/commit/35001b8663e98e0494b34ee527efb4e325de27bd))
9+
* **Project:** support language used in stores error ([d170ea6](https://github.com/commercetools/commercetools-php-sdk/commit/d170ea66ee37416e402802a7d766d86dd901a591)), closes [#578](https://github.com/commercetools/commercetools-php-sdk/issues/578)
10+
11+
12+
113
# [2.11.0](https://github.com/commercetools/commercetools-php-sdk/compare/v2.10.0...v2.11.0) (2020-05-05)
214

315

box.json.dist

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"files": [
3+
"index.php"
4+
],
5+
"main": false,
6+
"stub": false,
7+
"output": "commercetools-php-sdk.phar",
8+
"chmod": "644"
9+
}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"require": {
3333
"php": ">=5.6",
3434
"psr/log": "^1.0",
35-
"guzzlehttp/guzzle": "^6.0 || ^5.3.3",
35+
"guzzlehttp/guzzle": "^7.0 || ^6.0 || ^5.3.3 ",
3636
"guzzlehttp/psr7": "^1.1",
3737
"psr/cache": "^1.0",
3838
"psr/simple-cache": "^1.0",
@@ -41,7 +41,7 @@
4141
"ext-intl": "*"
4242
},
4343
"require-dev": {
44-
"guzzlehttp/guzzle": "^6.0",
44+
"guzzlehttp/guzzle": "^7.0 || ^6.0",
4545
"phpunit/phpunit": "^8.5",
4646
"symplify/easy-coding-standard": "^7.2",
4747
"doctrine/cache": "^1.6",

phive.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phive xmlns="https://phar.io/phive">
3+
<phar name="humbug/box" version="^3.8.4" installed="3.8.4" location="./tools/box" copy="false"/>
4+
</phive>

set_guzzle5.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
2-
SRC='"guzzlehttp/guzzle": "^6.0"'
2+
SRC='"guzzlehttp/guzzle": "^7.0 \|\| ^6.0"'
33
DST='"guzzlehttp/guzzle": "^5.3.3", "react/promise": "^2.2.0", "guzzlehttp/ringphp": "^1.1.1"'
44
sed -ibak -e "s|$SRC|$DST|g" composer.json

src/Core/AbstractHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
abstract class AbstractHttpClient
1616
{
17-
const VERSION = '2.11.0';
17+
const VERSION = '2.12.0';
1818

1919
/**
2020
* @var AdapterInterface

src/Core/Builder/Request/MeShoppingListRequestBuilder.php

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
use Commercetools\Core\Model\ShoppingList\MyShoppingListDraft;
88
use Commercetools\Core\Model\ShoppingList\ShoppingList;
99
use Commercetools\Core\Request\Me\MeShoppingListByIdGetRequest;
10+
use Commercetools\Core\Request\Me\MeShoppingListByKeyGetRequest;
1011
use Commercetools\Core\Request\Me\MeShoppingListCreateRequest;
12+
use Commercetools\Core\Request\Me\MeShoppingListDeleteByKeyRequest;
1113
use Commercetools\Core\Request\Me\MeShoppingListDeleteRequest;
1214
use Commercetools\Core\Request\Me\MeShoppingListQueryRequest;
15+
use Commercetools\Core\Request\Me\MeShoppingListUpdateByKeyRequest;
1316
use Commercetools\Core\Request\Me\MeShoppingListUpdateRequest;
1417

1518
class MeShoppingListRequestBuilder
1619
{
17-
1820
/**
1921
* @return MeShoppingListQueryRequest
2022
*/
@@ -32,6 +34,15 @@ public function update(ShoppingList $shoppingList)
3234
return MeShoppingListUpdateRequest::ofIdAndVersion($shoppingList->getId(), $shoppingList->getVersion());
3335
}
3436

37+
/**
38+
* @param ShoppingList $shoppingList
39+
* @return MeShoppingListUpdateByKeyRequest
40+
*/
41+
public function updateByKey(ShoppingList $shoppingList)
42+
{
43+
return MeShoppingListUpdateByKeyRequest::ofKeyAndVersion($shoppingList->getKey(), $shoppingList->getVersion());
44+
}
45+
3546
/**
3647
* @param string $shoppingListId
3748
* @return MeShoppingListByIdGetRequest
@@ -41,6 +52,15 @@ public function getById($shoppingListId)
4152
return MeShoppingListByIdGetRequest::ofId($shoppingListId);
4253
}
4354

55+
/**
56+
* @param string $shoppingListKey
57+
* @return MeShoppingListByKeyGetRequest
58+
*/
59+
public function getByKey($shoppingListKey)
60+
{
61+
return MeShoppingListByKeyGetRequest::ofKey($shoppingListKey);
62+
}
63+
4464
/**
4565
* @param MyShoppingListDraft $myShoppingListDraft
4666
* @return MeShoppingListCreateRequest
@@ -58,4 +78,13 @@ public function delete(ShoppingList $shoppingList)
5878
{
5979
return MeShoppingListDeleteRequest::ofIdAndVersion($shoppingList->getId(), $shoppingList->getVersion());
6080
}
81+
82+
/**
83+
* @param ShoppingList $shoppingList
84+
* @return MeShoppingListDeleteByKeyRequest
85+
*/
86+
public function deleteByKey(ShoppingList $shoppingList)
87+
{
88+
return MeShoppingListDeleteByKeyRequest::ofKeyAndVersion($shoppingList->getKey(), $shoppingList->getVersion());
89+
}
6190
}

src/Core/Builder/Update/ProjectActionBuilder.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Commercetools\Core\Error\InvalidArgumentException;
66
use Commercetools\Core\Request\AbstractAction;
77
use Commercetools\Core\Request\Project\Command\ProjectChangeCountriesAction;
8+
use Commercetools\Core\Request\Project\Command\ProjectChangeCountryTaxRateFallbackEnabledAction;
89
use Commercetools\Core\Request\Project\Command\ProjectChangeCurrenciesAction;
910
use Commercetools\Core\Request\Project\Command\ProjectChangeLanguagesAction;
1011
use Commercetools\Core\Request\Project\Command\ProjectChangeMessagesConfigurationAction;
@@ -28,6 +29,17 @@ public function changeCountries($action = null)
2829
return $this;
2930
}
3031

32+
/**
33+
*
34+
* @param ProjectChangeCountryTaxRateFallbackEnabledAction|callable $action
35+
* @return $this
36+
*/
37+
public function changeCountryTaxRateFallbackEnabled($action = null)
38+
{
39+
$this->addAction($this->resolveAction(ProjectChangeCountryTaxRateFallbackEnabledAction::class, $action));
40+
return $this;
41+
}
42+
3143
/**
3244
* @link https://docs.commercetools.com/http-api-projects-project.html#change-currencies
3345
* @param ProjectChangeCurrenciesAction|callable $action

0 commit comments

Comments
 (0)