Skip to content

Commit

Permalink
Bump versions of Swagger UI, GraphiQL and GraphQL Playground and impr…
Browse files Browse the repository at this point in the history
…ove contrib instructions
  • Loading branch information
dunglas committed Apr 21, 2020
1 parent 3a14131 commit c31c1eb
Show file tree
Hide file tree
Showing 18 changed files with 1,902 additions and 1,566 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -9,4 +9,5 @@
/swagger.json
/swagger.yaml
/tests/Fixtures/app/var/
/tests/Fixtures/app/public/bundles/
/vendor/
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -21,6 +21,7 @@
* Subresources: Improve queries when there's only one level #3396
* HTTP: Location header is only set on POST with a 201 or between 300 and 400 #3497
* GraphQL: Do not allow empty cursor values on `before` or `after` #3360
* Bump versions of Swagger UI, GraphiQL and GraphQL Playground #3510

## 2.5.4

Expand Down
65 changes: 37 additions & 28 deletions CONTRIBUTING.md
Expand Up @@ -30,14 +30,29 @@ publicly**. We will disclose details of the issue and credit you after having re
First of all, you must decide on what branch your changes will be based depending of the nature of the change.
See [the dedicated documentation entry](https://api-platform.com/docs/extra/releases/).

To prepare your patch directly in the `vendor/` of an existing project (convenient to fix a bug):

1. Remove the existing copy of the library: `rm -Rf vendor/api-platform/core`
2. Reinstall the lib while keeping Git metadata: `composer install --prefer-source`
3. You can now work directly in `vendor/api-platform/core`, create a new branch: `git checkout -b my_patch`
4. When your patch is ready, fork the project and add your Git remote: `git remote add <your-name> git@github.com:<your-name>/core.git`
5. You can now push your code and open your Pull Request: `git push <your-name> my_patch`

Alternatively, you can also work with the test application we provide:

cd tests/Fixtures/app
./console assets:install --symlink
symfony serve

# or if you prefer using the PHP built-in web server
php -S localhost:8000 -t public/

### Matching Coding Standards

The API Platform project follows [Symfony coding standards](https://symfony.com/doc/current/contributing/code/standards.html).
But don't worry, you can fix CS issues automatically using the [PHP CS Fixer](http://cs.sensiolabs.org/) tool:

```shell
php-cs-fixer.phar fix
```
php-cs-fixer.phar fix

And then, add the fixed file to your commit before pushing.
Be sure to add only **your modified files**. If any other file is fixed by cs tools, just revert it before committing.
Expand Down Expand Up @@ -66,45 +81,33 @@ Both `phpunit` and `behat` are development dependencies and should be available

To launch unit tests:

```shell
vendor/bin/phpunit --stop-on-failure -vvv
```
vendor/bin/phpunit --stop-on-failure -vvv

If you want coverage, you will need the `phpdbg` package and run:
If you want coverage, you will need the `pcov` PHP extension and run:

```shell
phpdbg -qrr vendor/bin/phpunit --coverage-html coverage -vvv --stop-on-failure
```
vendor/bin/phpunit --coverage-html coverage -vvv --stop-on-failure

Sometimes there might be an error with too many open files when generating coverage. To fix this, you can increase the `ulimit`, for example:

```shell
ulimit -n 4000
```
ulimit -n 4000

Coverage will be available in `coverage/index.html`.

#### Behat

The command to launch Behat tests is:

```shell
./vendor/bin/behat --suite=default --stop-on-failure -vvv
```
./vendor/bin/behat --suite=default --stop-on-failure -vvv

If you want to launch Behat tests for MongoDB, the command is:

```shell
APP_ENV=mongodb ./vendor/bin/behat --suite=mongodb --stop-on-failure -vvv
```
APP_ENV=mongodb ./vendor/bin/behat --suite=mongodb --stop-on-failure -vvv

## Squash your Commits

If you have 3 commits, start with:

```shell
git rebase -i HEAD~3
```
git rebase -i HEAD~3

An editor will be opened with your 3 commits, all prefixed by `pick`.

Expand All @@ -116,15 +119,11 @@ After that, all your commits will be squashed into the first one and the commit

If you would like to rename your commit message, type:

```shell
git commit --amend
```
git commit --amend

Now force push to update your PR:

```shell
git push --force-with-lease
```
git push --force-with-lease

# License and Copyright Attribution

Expand All @@ -134,3 +133,13 @@ and to transfer the copyright on the submitted code to Kévin Dunglas.
Be sure to you have the right to do that (if you are a professional, ask your company)!

If you include code from another project, please mention it in the Pull Request description and credit the original author.

# Releases

This section is dedicated to maintainers.

1. Update the JavaScript dependencies by running `./update-js.sh` (always check if it works in a browser)
2. Update the `CHANGELOG.md` file (be sure to include Pull Request numbers when appropriate)
3. Create a signed tag: `git tag -s vX.Y.Z -m "Version X.Y.Z"`
4. Create a release using GitHub's UI and copy the changelog
5. Create a new release of `api-platform/api-platform`

0 comments on commit c31c1eb

Please sign in to comment.