Skip to content

Conversation

@Justintime50
Copy link
Member

@Justintime50 Justintime50 commented Dec 8, 2022

Description

  • Drops support for PHP 7.3 and adds CI checks for PHP 8.2.
  • This PR also fixes the test config so it could be more helpful in debugging future issues and I corrected various deprecation issues that sprang up when running on PHP 8.2.
  • Finally, this PR removes the need to instantiate a Requestor object since there is no need to do that on every request and instead passes down the client object as a param, making that whole class static. This helps performance and most likely the segfault issue in the long run that I'll be investigating later.

Testing

Tested PHP 8.2 with a scratch file and it worked as expected.

Pull Request Type

Please select the option(s) that are relevant to this PR.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement (fixing a typo, updating readme, renaming a variable name, etc)

@Justintime50
Copy link
Member Author

Justintime50 commented Dec 8, 2022

For whatever reason, CI is failing only on PHP 8.2 with the following which is NOT helpful at all:

Run EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make coverage
composer coverage
> XDEBUG_MODE=coverage ./bin/phpunit --coverage-html clover.html --coverage-clover build/logs/clover.xml
PHPUnit 9.5.26 by Sebastian Bergmann and contributors.

Runtime:       PHP [8](https://github.com/EasyPost/easypost-php/actions/runs/3652991093/jobs/6171968921#step:7:9).2.0 with PCOV 1.0.11
Configuration: /home/runner/work/easypost-php/easypost-php/phpunit.xml.dist

Segmentation fault (core dumped)
Script XDEBUG_MODE=coverage ./bin/phpunit --coverage-html clover.html --coverage-clover build/logs/clover.xml handling the coverage event returned with error code 13[9](https://github.com/EasyPost/easypost-php/actions/runs/3652991093/jobs/6171968921#step:7:10)
make: *** [Makefile:[11](https://github.com/EasyPost/easypost-php/actions/runs/3652991093/jobs/6171968921#step:7:12): coverage] Error 139
.
Error: Process completed with exit code 2.

PHP 8.2 installs correctly; however, when attempting to generate coverage it fails -- Tried swapping the coverage tool from xdebug to pcov and back without luck. I also downgraded Ubuntu thinking that could be it with no luck. I switched the target from coverage to test thinking it was the coverage reporting that was broken but it wouldn't load normal tests either so it's not a coverage generation issue.

@Justintime50 Justintime50 force-pushed the php_versions branch 2 times, most recently from f9e06ae to 10caa5b Compare December 12, 2022 19:10
chore: downgrade ubuntu

chore: use xdebug on CI

fix: composer.lock

fix: don't instantiate requestors everywhere, deprecations

fix: import ordering issue

fix: lint

fix: EasyPostClient tests

fix: min test coverage
@Justintime50 Justintime50 marked this pull request as ready for review December 12, 2022 22:14
@Justintime50 Justintime50 requested a review from a team December 12, 2022 22:14
@Justintime50
Copy link
Member Author

I'd like to move forward with this PR as is. I was able to test PHP 8.2 locally and it works as expected, just not via our unit tests. I've created a follow-up task to look into that so as to not block this PRs progress.

Copy link
Contributor

@jchen293 jchen293 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing my previous comment 👍

@Justintime50 Justintime50 merged commit 1cbd4f9 into master Dec 13, 2022
@Justintime50 Justintime50 deleted the php_versions branch December 13, 2022 18:19
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.

4 participants