Skip to content

Commit 6e2d3b9

Browse files
chore: upgrade API Platform to 4.1.1 (#507)
* chore: upgrade API Platform to 4.1.1 * fix: fix tests * docs: update CONTRIBUTING guide for project update on api-platform/core release * fix: fix GraphiQL bug
1 parent 848a763 commit 6e2d3b9

File tree

12 files changed

+186
-145
lines changed

12 files changed

+186
-145
lines changed

.github/CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ Fill in the following header from the pull request template:
6464
| Doc PR | api-platform/docs#1234
6565
```
6666

67+
## Update Project Version from API Platform Release
68+
69+
When a release occur on [api-platform/core](https://github.com/api-platform/core) repository, you can trigger a workflow to automatically update this project.
70+
71+
Go to Actions > Upgrade API Platform > Run workflow, then click on the `Run workflow` button. This action will detect the new API Platform release, update the API and HELM dependencies, and open a Pull Request to run the CI and review it.
72+
73+
If the CI is green and the review seems valid, the Pull Request can be merged (by member of the API Platform organization), and a release can be created through GitHub UI.
74+
6775
## Squash your Commits
6876

6977
If you have 3 commits. So start with:

api/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,5 @@ RUN set -eux; \
103103
composer dump-autoload --classmap-authoritative --no-dev; \
104104
composer dump-env prod; \
105105
composer run-script --no-dev post-install-cmd; \
106-
chmod +x bin/console; sync;
106+
chmod +x bin/console; sync; \
107+
cp public/assets/react.production.min.js public/bundles/apiplatform/react/react.production.min.js;

api/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"php": ">=8.3",
66
"ext-ctype": "*",
77
"ext-iconv": "*",
8-
"api-platform/doctrine-orm": "^4.1",
9-
"api-platform/graphql": "^4.1",
10-
"api-platform/symfony": "^4.1",
8+
"api-platform/doctrine-orm": "^4.1.1",
9+
"api-platform/graphql": "^4.1.1",
10+
"api-platform/symfony": "^4.1.1",
1111
"doctrine/common": "^3.4",
1212
"doctrine/doctrine-bundle": "^2.11",
1313
"doctrine/doctrine-fixtures-bundle": "^4.0",

api/composer.lock

Lines changed: 80 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/config/packages/api_platform.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
api_platform:
22
title: API Platform's demo
3-
version: 4.1.0
3+
version: 4.1.1
44
description: |
55
This is a demo application of the [API Platform](https://api-platform.com) framework.
66
[Its source code](https://github.com/api-platform/demo) includes various examples, check it out!

api/public/assets/react.production.min.js

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/tests/Api/Admin/BookTest.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public function asNonAdminUserICannotGetACollectionOfBooks(int $expectedCode, st
5555
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
5656
self::assertJsonContains([
5757
'@type' => 'hydra:Error',
58-
'title' => 'An error occurred',
59-
'description' => $hydraDescription,
58+
'hydra:title' => 'An error occurred',
59+
'hydra:description' => $hydraDescription,
6060
]);
6161
}
6262

@@ -197,8 +197,8 @@ public function asNonAdminUserICannotGetABook(int $expectedCode, string $hydraDe
197197
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
198198
self::assertJsonContains([
199199
'@type' => 'hydra:Error',
200-
'title' => 'An error occurred',
201-
'description' => $hydraDescription,
200+
'hydra:title' => 'An error occurred',
201+
'hydra:description' => $hydraDescription,
202202
]);
203203
}
204204

@@ -255,8 +255,8 @@ public function asNonAdminUserICannotCreateABook(int $expectedCode, string $hydr
255255
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
256256
self::assertJsonContains([
257257
'@type' => 'hydra:Error',
258-
'title' => 'An error occurred',
259-
'description' => $hydraDescription,
258+
'hydra:title' => 'An error occurred',
259+
'hydra:description' => $hydraDescription,
260260
]);
261261
}
262262

@@ -290,7 +290,7 @@ public static function getInvalidDataOnCreate(): iterable
290290
Response::HTTP_UNPROCESSABLE_ENTITY,
291291
[
292292
'@type' => 'ConstraintViolation',
293-
'title' => 'An error occurred',
293+
'hydra:title' => 'An error occurred',
294294
'violations' => [
295295
[
296296
'propertyPath' => 'book',
@@ -316,8 +316,8 @@ public static function getInvalidData(): iterable
316316
Response::HTTP_UNPROCESSABLE_ENTITY,
317317
[
318318
'@type' => 'ConstraintViolation',
319-
'title' => 'An error occurred',
320-
'description' => 'condition: This value should be of type ' . BookCondition::class . '.',
319+
'hydra:title' => 'An error occurred',
320+
'hydra:description' => 'condition: This value should be of type ' . BookCondition::class . '.',
321321
'violations' => [
322322
[
323323
'propertyPath' => 'condition',
@@ -334,8 +334,8 @@ public static function getInvalidData(): iterable
334334
Response::HTTP_UNPROCESSABLE_ENTITY,
335335
[
336336
'@type' => 'ConstraintViolation',
337-
'title' => 'An error occurred',
338-
'description' => 'condition: This value should be of type ' . BookCondition::class . '.',
337+
'hydra:title' => 'An error occurred',
338+
'hydra:description' => 'condition: This value should be of type ' . BookCondition::class . '.',
339339
'violations' => [
340340
[
341341
'propertyPath' => 'condition',
@@ -352,7 +352,7 @@ public static function getInvalidData(): iterable
352352
Response::HTTP_UNPROCESSABLE_ENTITY,
353353
[
354354
'@type' => 'ConstraintViolation',
355-
'title' => 'An error occurred',
355+
'hydra:title' => 'An error occurred',
356356
'violations' => [
357357
[
358358
'propertyPath' => 'book',
@@ -443,8 +443,8 @@ public function asNonAdminUserICannotUpdateBook(int $expectedCode, string $hydra
443443
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
444444
self::assertJsonContains([
445445
'@type' => 'hydra:Error',
446-
'title' => 'An error occurred',
447-
'description' => $hydraDescription,
446+
'hydra:title' => 'An error occurred',
447+
'hydra:description' => $hydraDescription,
448448
]);
449449
}
450450

@@ -571,8 +571,8 @@ public function asNonAdminUserICannotDeleteABook(int $expectedCode, string $hydr
571571
self::assertResponseHeaderSame('link', '<http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#error",<http://localhost/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"');
572572
self::assertJsonContains([
573573
'@type' => 'hydra:Error',
574-
'title' => 'An error occurred',
575-
'description' => $hydraDescription,
574+
'hydra:title' => 'An error occurred',
575+
'hydra:description' => $hydraDescription,
576576
]);
577577
}
578578

0 commit comments

Comments
 (0)