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

refactor: use generic PSR-18 as an HTTP client #129

Merged
merged 28 commits into from
Sep 19, 2022
Merged

Conversation

bednar
Copy link
Contributor

@bednar bednar commented Aug 30, 2022

Closes #120
Closes #130

Proposed Changes

Uses https://www.php-fig.org/psr/psr-18/ as a HTTP client instead strong depends to Guzzle:

This PR drops strong couple to Guzzle HTTP client.
Now the user is able to use any implementation of PSR-18 compliant HTTP client - https://packagist.org/providers/psr/http-client-implementation.

The client has to be installed together with HTTP client:

composer require influxdata/influxdb-client-php guzzlehttp/guzzle

Update InfluxDB API to latest version:

This PR also uses a new version of InfluxDB OSS API definitions - oss.yml. The following breaking changes are in underlying API services and doesn't affect common apis such as - WriteApi, QueryApi, HealthApi, ...

  • Add ConfigService to retrieve InfluxDB's runtime configuration
  • Add DebugService to retrieve debug and performance data from runtime
  • Add MetricsService to deal with exposed prometheus metrics
  • Add RemoteConnectionsService to deal with registered remote InfluxDB connections
  • Add ResourcesService to manage InfluxDB resources
  • Add ReplicationService to manage InfluxDB replications
  • Add ReplicationService to manage InfluxDB replications
  • Update TemplatesService to deal with Stack and Template API
  • Update RestoreService to deal with new restore functions of InfluxDB

Breaking Changes

  • Remove asynchronous operation based on GuzzleHttp\Message\FutureResponse
  • Remove DocumentService in favour of InfluxDB Community Templates. For more info see - influxdb#19300, openapi#192
  • Remove DefaultSerive:
    • PostSignin operation is moved to SigninService
    • PostSignout operation is moved to SignoutService

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • make test completes successfully
  • Commit messages are conventional
  • Sign CLA (if not already signed)

@bednar bednar changed the title refactor: use generic PSR-7 as a HTTP client refactor: use generic PSR-18 as a HTTP client Sep 5, 2022
@bednar bednar changed the title refactor: use generic PSR-18 as a HTTP client refactor: use generic PSR-18 as an HTTP client Sep 5, 2022
@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2022

Codecov Report

Merging #129 (d7b2e85) into master (66dccec) will decrease coverage by 6.25%.
The diff coverage is 95.12%.

@@             Coverage Diff              @@
##             master     #129      +/-   ##
============================================
- Coverage     80.92%   74.67%   -6.26%     
- Complexity      412      421       +9     
============================================
  Files            24       25       +1     
  Lines          1012     1082      +70     
============================================
- Hits            819      808      -11     
- Misses          193      274      +81     
Impacted Files Coverage Δ
src/InfluxDB2/ApiException.php 64.28% <ø> (-21.43%) ⬇️
src/InfluxDB2/HeaderSelector.php 73.91% <ø> (ø)
src/InfluxDB2/Client.php 93.75% <66.66%> (-1.25%) ⬇️
src/InfluxDB2/DefaultApi.php 90.47% <94.23%> (-2.55%) ⬇️
src/InfluxDB2/Internal/DebugHttpPlugin.php 100.00% <100.00%> (ø)
src/InfluxDB2/Configuration.php 0.00% <0.00%> (-29.49%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@bednar bednar marked this pull request as ready for review September 6, 2022 09:43
@bednar bednar requested review from rhajek and michaelahojna and removed request for rhajek September 7, 2022 09:56
@bednar bednar merged commit b66a559 into master Sep 19, 2022
@bednar bednar deleted the generic-http-client branch September 19, 2022 12:17
@bednar bednar added this to the 2.10.0 milestone Sep 19, 2022
peynman pushed a commit to peynman/influxdb-client-php that referenced this pull request Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP, generic support of HTTP libraries Depend on PSR-18 instead of Guzzle.
3 participants