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

Failing builds and PHP 8 support #8

Closed
hibariya opened this issue Feb 28, 2021 · 3 comments · Fixed by stripe-archive/accept-a-card-payment#69
Closed

Failing builds and PHP 8 support #8

hibariya opened this issue Feb 28, 2021 · 3 comments · Fixed by stripe-archive/accept-a-card-payment#69

Comments

@hibariya
Copy link
Collaborator

Bug report

Describe the bug

It looks like some PHP samples don't support PHP 8. Since the latest composer Docker image bundles PHP 8.0.2, composer failed to satisfy the dependencies in this build in accept-a-card-payment. Considering the cause, I think the other repositories may also have the same issue.

This is the detailed error messages:

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for vlucas/phpdotenv v3.4.0 -> satisfiable by vlucas/phpdotenv[v3.4.0].
    - vlucas/phpdotenv v3.4.0 requires php ^5.4 || ^7.0 -> your PHP version (8.0.2) does not satisfy that requirement.

To Reproduce

https://github.com/stripe-samples/accept-a-card-payment/runs/1972142343

Expected behavior

The build passes.

Additional context

As for accept-a-card-payment, this PR (stripe-archive/accept-a-card-payment#58) will fix the issue for without-webhooks. However, we will need similar changes on using-webhooks, too.

Also, we could make CI use PHP 7 for now.

@hibariya
Copy link
Collaborator Author

hibariya commented Mar 3, 2021

I noticed that after removing the composer.lock, composer install completes without errors. Also, I couldn't see this error when running tests on checkout-one-time-payments which does not have composer.lock in the repository. Maybe we could just remove or update the lock files in accept-a-card-payment?

Here's the steps I did to reproduce the error on my local machine:

(in stripe-samples/accept-a-card-payment)
$ cd decline-on-card-authentication/server/php-slim/
$ md5sum composer.lock 
f86a60eade59b11c36205b830e7fb151  composer.lock
$ docker run --rm -it --workdir=/work -v $PWD:/work composer:1.10 /bin/bash
bash-5.1# composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for vlucas/phpdotenv v3.4.0 -> satisfiable by vlucas/phpdotenv[v3.4.0].
    - vlucas/phpdotenv v3.4.0 requires php ^5.4 || ^7.0 -> your PHP version (8.0.2) does not satisfy that requirement.

After removing composer.lock, the installation completed successfully:

bash-5.1# rm composer.lock 
bash-5.1# composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files
4 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
bash-5.1# 
exit
$ md5sum composer.lock
e8e154af97d620a731d6aad724bc9029  composer.lock

@cjavilla-stripe
Copy link
Contributor

yeah feel free to remove composer.lock. That seems peaceful

hibariya added a commit to hibariya/accept-a-card-payment that referenced this issue Mar 6, 2021
Tests with PHP 8 were failing because some of the dependencies
did not expect newer PHP in the lock file. If we can remove it
like other repositories (e.g., checkout-one-time-payments), the
tests won't fail for the same reason in the future.
Fixes stripe-samples/sample-ci#8.
@hibariya
Copy link
Collaborator Author

hibariya commented Mar 6, 2021

Thanks. I created a PR that removes the lock files: stripe-archive/accept-a-card-payment#69

cjavilla-stripe pushed a commit to stripe-archive/accept-a-card-payment that referenced this issue Mar 9, 2021
Tests with PHP 8 were failing because some of the dependencies
did not expect newer PHP in the lock file. If we can remove it
like other repositories (e.g., checkout-one-time-payments), the
tests won't fail for the same reason in the future.
Fixes stripe-samples/sample-ci#8.
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 a pull request may close this issue.

2 participants