Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composer Guzzle 7.0 #7950

Closed
wants to merge 1 commit into from
Closed

Composer Guzzle 7.0 #7950

wants to merge 1 commit into from

Conversation

drjdr
Copy link

@drjdr drjdr commented Nov 16, 2020

output of geneterate-samples.sh included.
https://github.com/guzzle/guzzle/blob/master/UPGRADING.md
Projects were this line was manually added to composer.json seem to work fine.

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./bin/generate-samples.shto update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*. For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.
    @jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), @ackintosh (2017/09) ❤️, @ybelenko (2018/07), @renepardon (2018/12)

@drjdr
Copy link
Author

drjdr commented Nov 17, 2020

@jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), @ackintosh (2017/09) ❤️, @ybelenko (2018/07), @renepardon (2018/12)
These small change seems to work fine for hubspot-api, can it please be merged?

@wing328
Copy link
Member

wing328 commented Dec 1, 2020

@drjdr thanks for the PR but Travis CI tests failed with the following (when testing the PHP client):

  - Installing doctrine/annotations (1.11.1): Downloading (connecting...)���������������������������Downloading (0%)           ���������������������������Downloading (5%)����������������Downloading (60%)�����������������Downloading (65%)�����������������Downloading (70%)�����������������Downloading (75%)�����������������Downloading (100%)
  - Installing composer/xdebug-handler (1.4.5): Downloading (connecting...)���������������������������Downloading (0%)           ���������������������������Downloading (15%)�����������������Downloading (50%)�����������������Downloading (65%)�����������������Downloading (100%)
  - Installing composer/semver (3.2.4): Downloading (connecting...)���������������������������Downloading (0%)           ���������������������������Downloading (5%)����������������Downloading (70%)�����������������Downloading (75%)�����������������Downloading (80%)�����������������Downloading (100%)
  - Installing friendsofphp/php-cs-fixer (v2.16.7): Downloading (connecting...)���������������������������Downloading (0%)           ���������������������������Downloading (5%)����������������Downloading (10%)�����������������Downloading (15%)�����������������Downloading (20%)�����������������Downloading (25%)�����������������Downloading (30%)�����������������Downloading (35%)�����������������Downloading (40%)�����������������Downloading (45%)�����������������Downloading (50%)�����������������Downloading (55%)�����������������Downloading (60%)�����������������Downloading (65%)�����������������Downloading (70%)�����������������Downloading (75%)�����������������Downloading (80%)�����������������Downloading (85%)�����������������Downloading (90%)�����������������Downloading (95%)�����������������Downloading (100%)
guzzlehttp/psr7 suggests installing laminas/laminas-httphandlerrunner (Emit PSR-7 responses)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit suggests installing phpunit/php-invoker (^2.0.0)
symfony/service-contracts suggests installing symfony/service-implementation
symfony/event-dispatcher suggests installing symfony/dependency-injection
symfony/event-dispatcher suggests installing symfony/http-kernel
symfony/console suggests installing symfony/lock
friendsofphp/php-cs-fixer suggests installing php-cs-fixer/phpunit-constraint-isidenticalstring (For IsIdenticalString constraint.)
friendsofphp/php-cs-fixer suggests installing php-cs-fixer/phpunit-constraint-xmlmatchesxsd (For XmlMatchesXsd constraint.)
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
PHP Fatal error:  Declaration of OpenAPI\Client\FakeHttpClient::send(Psr\Http\Message\RequestInterface $request, array $options 
Fatal error: Declaration of OpenAPI\Client\FakeHttpClient::send(Psr\Http\Message\RequestInterface $request, array $options = Array) must be compatible with GuzzleHttp\ClientInterface::send(Psr\Http\Message\RequestInterface $request, array $options = Array): Psr\Http\Message\ResponseInterface in /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/tests/FakeHttpClient.php on line 11

Call Stack:
    0.0001     418696   1. {main}() /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/php/OpenAPIClient-= Array) must be compatible with GuzzleHttp\ClientInterface::send(Psr\Http\Message\RequestInterface $request, array $options = Aphp/vendor/phpunit/phpunit/phpunit:0
    0.0043    1086136   2. PHPUnit\TextUI\Command::main() /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstrray): Psr\Http\Message\ResponseInterface in /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/php/OpenAore/php/OpenAPIClient-php/vendor/phpunit/phpunit/phpunit:61
PIClient-php/tests/FakeHttpClient.php on line 11
PHP Stack trace:
    0.0043    1095000   3. PHPUnit\TextUI\Command->run() /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstoPHP   1. {main}() /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunitre/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/TextUI/Command.php:163
    0.0118    1746536   4. PHPUnit\TextUI\TestRunner->getTest() /home/travis/build/OpenAPITools/openapi-generator/samples/client/phpunit/phpunit:0
PHP   2. PHPUnit\TextUI\Command::main() /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/phpunit:61
/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/TextUI/Command.php:181
PHP   3. PHPUnit\TextUI\Command->run() /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/php/OpenAPIClie    0.0145    1881536   5. PHPUnit\Framework\TestSuite->addTestFiles() /home/travis/build/OpenAPITools/openapi-generator/samplesnt-php/vendor/phpunit/phpunit/src/TextUI/Command.php:163
PHP   4. PHPUnit\TextUI\TestRunner->getTest() /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/php/Open/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php:94
    0.0230    3042688   6. PHPUnit\Framework\TestSuite->addTestFile() /home/travis/build/OpenAPITools/openapi-generator/samples/APIClient-php/vendor/phpunit/phpunit/src/TextUI/Command.php:181
PHP   5. PHPUnit\Framework\TestSuite->addTestFiles() /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/pclient/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/Framework/TestSuite.php:456
    0.0230    3042688   7. PHPUnit\Util\FileLoader::checkAndLoad() /home/travis/build/OpenAPITools/openapi-generator/samples/clihp/OpenAPIClient-php/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php:94
PHP   6. PHPUnit\Framework\TestSuite->addTestFile() /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/phent/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/Framework/TestSuite.php:358
    0.0230    3043168   8. PHPUnit\Util\FileLoader::load() /home/travis/build/OpenAPITools/openapi-generator/samples/client/petsp/OpenAPIClient-php/vendor/phpunit/phpunit/src/Framework/TestSuite.php:456
PHP   7. PHPUnit\Util\FileLoader::checkAndLoad() /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/php/Otore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/Util/FileLoader.php:47
    0.0236    3080456   9. include_once('/home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/php/OpenAPIClpenAPIClient-php/vendor/phpunit/phpunit/src/Framework/TestSuite.php:358
PHP   8. PHPUnit\Util\FileLoader::load() /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/tests/AuthTest.php') /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/Util/FileLoader.php:59
    0.0241    3088120  10. require_once('/home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/phpunit/phpunit/src/Util/FileLoader.php:47
PHP   9. include_once() /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/vendor/pient-php/tests/FakeHttpClient.php') /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/php/OpenAPIClient-hpunit/phpunit/src/Util/FileLoader.php:59
php/tests/AuthTest.php:10

PHP  10. require_once() /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/php/OpenAPIClient-php/tests/AuthTest.php:10
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (bundle-test) on project PhpPetstoreOAS3Tests: Command execution failed. Process exited with an error: 255 (Exit value: 255) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (bundle-test) on project PhpPetstoreOAS3Tests: Command execution failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)

Can you please take a look when you've time?

@wing328 wing328 modified the milestones: 5.0.0, 5.0.1 Dec 21, 2020
@wing328 wing328 modified the milestones: 5.0.1, 5.1.0 Feb 8, 2021
@wing328 wing328 modified the milestones: 5.1.0, 5.1.1 Mar 19, 2021
@simPod
Copy link
Contributor

simPod commented Mar 30, 2021

@drjdr are you planning to finish the PR or is it fine if someone takes over?

@dkarlovi
Copy link
Contributor

This blockage is a good reason why #7518 was suggested as a preferable solution: it's then up to the library to keep compat with the standard, no need to change the downstream implemenation.

@simPod
Copy link
Contributor

simPod commented Mar 30, 2021

@dkarlovi I prefer #7518 as well but since this is already implemented it can be shipped right now and #7518 in the future versions.

@arrilot
Copy link

arrilot commented May 11, 2021

There are two points you should take into considiration:

  1. Major frameworks (like Laravel) require guzzle 7 atm, so there is no way to install generated clients without manually patching them. This problem will arise again in the furure when guzzle 8 is released.

  2. There is at least one breaking change in guzzle 7 that affects the generator - ConnectException no longer extends RequestException and has no response access guzzle/guzzle@6b77639
    As a result
    for sync requests: ConnectException will no longer be converted to ApiException after updating to guzzle
    for async requests: they will end up with fatal error because there is no check for exception type atm before calling $exception->getResponse();

@JPurinsh
Copy link

Any updates here? Any eta when this could get released?

@wing328
Copy link
Member

wing328 commented Oct 16, 2021

Done via #10585 instead. Please pull the latest master to give it a try.

@wing328 wing328 closed this Oct 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants