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

Fixes #614 for PHP 8.1, Symfony 6, Drush 11, etc. #615

Closed
wants to merge 4 commits into from

Conversation

mikemadison13
Copy link
Contributor

Updates the following:

  • drupal related dependencies to allow 10.x
  • drush to allow drush 11
  • behat/mink-goutte-driver to allow 2.x
  • symfony packages to allow ^6

@Berdir
Copy link
Contributor

Berdir commented Aug 4, 2022

Overlaps with #610

@mikemadison13
Copy link
Contributor Author

@Berdir yeah, i know it overlaps with a couple of other efforts. i'm hoping we can get at least one of them merged, though. my behat testing is currently blocking me from being able to execute CI on my PHP 8.1 project update.

@mikemadison13
Copy link
Contributor Author

the failure I'm hitting seems to be related to symfony/panther#291, digging more.

@mikemadison13
Copy link
Contributor Author

@jhedstrom digging into the issues in the build failure, it looks like https://github.com/FriendsOfBehat/MinkExtension did some refactoring in version 2 which is causing the set client error in the build:

In GoutteFactory.php line 117:
                                                    
Method Goutte\Client::setClient() does not exist  

I've started poking at this a little bit, it looks like they are checking for Goutte1 in their code (see https://github.com/FriendsOfBehat/MinkExtension/blob/master/src/Behat/MinkExtension/ServiceContainer/Driver/GoutteFactory.php#L115) which could be the root cause.

I'm going to go open an issue over there to see if we can make forward progress.

@mikemadison13
Copy link
Contributor Author

actually, it looks like there is a PR that fixes this FriendsOfBehat/MinkExtension#16 and it works, but not for the Drupal 7 stuff. I think we may need to split the drupalextension and have one version that is for newer versions of symfony. any thoughts?

@jhedstrom
Copy link
Owner

@mikemadison13 yeah, I think we could start a 5.x and drop support for Drupal 7 in that branch?

@mikemadison13 mikemadison13 force-pushed the 614 branch 4 times, most recently from 2276754 to ef875ea Compare September 2, 2022 20:22
@mikemadison13
Copy link
Contributor Author

it's unclear to me if there's anything in #610 that we need to roll into this. i don't think so based on what i see there, but that PR does change the behat.yml.dist file from goutte to browserkit_http. i'm not sure if that's still needed? @claudiu-cristea might have some input?

@mikemadison13
Copy link
Contributor Author

i think we can also close #602 as well given this?

@mikemadison13 mikemadison13 changed the title Fixes #614 to allow symfony 6. Fixes #614 for PHP 8.1, Symfony 6, Drush 11, etc. Sep 2, 2022
composer.json Outdated
@@ -59,6 +61,11 @@
}
},
"extra": {
"patches": {
"friends-of-behat/mink-extension": {
"setClient error": "https://github.com/FriendsOfBehat/MinkExtension/files/9480850/16.txt"
Copy link
Owner

Choose a reason for hiding this comment

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

Let's add the PR number #16 here for easy reference to the issue in case we forget where this came from :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I created mikemadison13#1 (against fork)

Copy link
Contributor

Choose a reason for hiding this comment

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

In my project the patch doesn't apply, friends-of-behat/mink-extension is locked to 2.3.1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i wonder if we need to set a minimum version to 2.7.1 of the mink-extension? I'm not sure how we make this PR work without that patch (because it fatal errs out). So we either need to pin way earlier (2.3.1 and remove the patch) or pin later (2.7.1) with. my preference would be the newer version. thoughts @jhedstrom ?

composer.json Outdated
"friends-of-behat/mink-extension": {
"setClient error": "https://github.com/FriendsOfBehat/MinkExtension/files/9480850/16.txt"
}
},
"branch-alias": {
"dev-master": "4.3.x-dev"
Copy link
Owner

Choose a reason for hiding this comment

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

you'll want to merge master in since this line has changed for 5.0.x now.

Copy link
Contributor

Choose a reason for hiding this comment

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

I created mikemadison13#1 (against fork)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i've rebased off of the upstream/master and have this change now.

@claudiu-cristea
Copy link
Contributor

@mikemadison13 I don't have time for #610 and, honestly, I have no idea how to fix it. Feel free to include here anything that could be useful

@claudiu-cristea
Copy link
Contributor

claudiu-cristea commented Sep 6, 2022

@mikemadison13 This PR is fixing the dependency issues I have when updating to PHP 8.1. Thank you. Could you, please fix the 2 minor remarks and let's get this in?

composer.json Outdated
@@ -59,6 +61,11 @@
}
},
"extra": {
"patches": {
"friends-of-behat/mink-extension": {
"setClient error from PR16": "https://github.com/FriendsOfBehat/MinkExtension/files/9480850/16.txt"
Copy link
Contributor

Choose a reason for hiding this comment

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

even with the version constraint, a patch is IMHO too unstable, sooner or later that won't apply anymore or will be merged. We could maybe combine it with a specific requirement on that specific version, but waiting for that to be merged and committed is probably the safer option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Berdir there have been a number of requests to merge the PR and it hasn't happened, so I don't fundamentally disagree with the concern, but I'm not sure if the maintainer can merge things at the moment given their location. we did try and make this "more stable" by pointing at a patch file vs. the actual PR. i guess we could explicitly pin to 2.7.1 to prevent accidental breakage / updates?

@AlexSkrypnyk
Copy link

AlexSkrypnyk commented Oct 6, 2022

Can we please get this merged. The CI passes, the patch is actually a "static" file - all looks like it is working.

If that patch won't apply in the future - we can always update this package and roll a new version.

This is currently blocks using Behat with Drupal 10 big time.

@claudiu-cristea
Copy link
Contributor

claudiu-cristea commented Oct 15, 2022

@jhedstrom @Berdir @mikemadison13 wouldn't be better if we try to move away from the Goutte driver? See here how Moodle community did it stronk7/moodle@master...bump_goutte_driver_20

@Berdir
Copy link
Contributor

Berdir commented Oct 15, 2022

Sure, that's what I always expected will need to happen eventually, see first comment in #606 :) Back then it was blocked on FriendsOfBehat/MinkExtension#14, but now that should be possible?

@claudiu-cristea
Copy link
Contributor

claudiu-cristea commented Oct 15, 2022

Sure, that's what I always expected will need to happen eventually, see first comment in #606 :) Back then it was blocked on FriendsOfBehat/MinkExtension#14, but now that should be possible?

@Berdir could you, please, take a look at #620. It's not ready yet but I have a green there

EDIT:

@claudiu-cristea
Copy link
Contributor

@AlexSkrypnyk could you take a look and try #620? That drops Goutte Driver.

@mikemadison13 should we close this in favor of #620?

@mikemadison13
Copy link
Contributor Author

my strong preference would be to get this in ASAP so we can unblock d10. and then we can explore the feature dev for Goutte. but obviously i defer to @jhedstrom

@claudiu-cristea
Copy link
Contributor

claudiu-cristea commented Oct 17, 2022

my strong preference would be to get this in ASAP so we can unblock d10

@mikemadison13 we're already there. See the tests on GitHub actions here https://github.com/claudiu-cristea/drupalextension/actions/runs/3266111531. I'm now investigating the failure with Drupal 10, which is happening in drupal/drupal-driver

EDIT: I had to implement GitHub actions as Travis CI hit some quota

@mikemadison13
Copy link
Contributor Author

i believe we would still need to merge in all of the symfony 6 stuff from this (or another PR) to get us to d10, right?

@claudiu-cristea
Copy link
Contributor

i believe we would still need to merge in all of the symfony 6 stuff from this (or another PR) to get us to d10, right?

I've cherry picked some commits from here in #620. Actually, it supports Sf 6, Drush 11. I'm still working on D10 stuff. Very close...

@AlexSkrypnyk
Copy link

The upstream blocker was merged.

If I may suggest - can we update this PR, merge it, release it and then look at 620?

@claudiu-cristea
Copy link
Contributor

claudiu-cristea commented Oct 18, 2022

@AlexSkrypnyk they are doing the same, with the exception that FriendsOfBehat/MinkExtension#16 wraps the BrowserKit Driver from Goutte Driver while #620 uses directly the BrowserKit Driver and drops the dependency on Goutte Driver

@AlexSkrypnyk
Copy link

@jhedstrom
Can we please merge and release this one and tackle #620. There are already several complex dependency resolution issues happening here. Bringing in a new dependency in this PR (which is 100% working and is ready to go) can potentially throw us back into discussions about approaches. I would suggest to have those discussions separately (in #620) and merge this one as is.

@claudiu-cristea
Copy link
Contributor

@AlexSkrypnyk I don't see why this needs to be merged as #620 is solving exactly the same issue but as a definitive fix. Did you give #620 a try? If we merge this just to drop it in #620 somebody has to rework/reroll #620. Useless work. Why not, better, focusing on that to se if fulfills the scope?

@AlexSkrypnyk
Copy link

@claudiu-cristea
That PR adds a lot of changes that need to be discussed. I simply want to unblock downstream packages ASAP and then take time to review #620.

There is only 1 files change in this PR (composer.json) that will need a re-roll in #620.

@Berdir
Copy link
Contributor

Berdir commented Oct 26, 2022

goutte v2 is just a wrapper around browserkit, I agree that it makes more sense to pursue that directly.

@claudiu-cristea
Copy link
Contributor

@AlexSkrypnyk 90% of changes are only file removals, renaming, docs changes and Behat tags removals because it drops the Drupal 7/8 support

@mikemadison13
Copy link
Contributor Author

just to chime in to support the point @AlexSkrypnyk is making, it would be fantastic to get D10 unblocked asap. if that's with this pr great. if that's with 620 great, i don't have a lot of skin in the game. i just want to get behat unblocked. it feels safer to use the current approach first and then explore a new approach separately, but 🤷

@AlexSkrypnyk
Copy link

@Berdir @claudiu-cristea
It makes sense to replace goutte as it is a wrapper around browserkit and should be decommissioned. But it is about when to do it and how long it will take to review and accept changes in #620 (which I think are great).

#620 has a lot of changes: there are new local env configs, new CI configs, Drupal 8 deprecations, test artefacts and other changes that will take time to discuss. I guess it is up to project maintainer to decide if changes in that PR can be accepted as-is or more discussions are required.

We have this PR that is working and does not change any dependencies (so that downstream projects do not have to update theirs). It is ready to be merged right now. It has minimal changes and, therefore, less risk to introduce new issues.

I do not see a problem with merging this PR as-is and releasing a new version (could even be a patch version) to unblock downstream and then concentrate on #620 and spend as much time as required there.

@jhedstrom
Copy link
Owner

This could potentially go against the latest 4.x.x branch, and keep #620 against master (which will be 5.0.x)?

@mikemadison13
Copy link
Contributor Author

@jhedstrom i think we discussed cutting the 5.x branch for Drupal 10 given that we had to remove some of the earlier supported versions of things, right? just making sure i don't misremember. this branch will not work well with older things.

@jhedstrom
Copy link
Owner

Yeah, 5.x will drop D7 support and add D10 support, so scratch my thought above. Since 5.x is not released, and #620 is the eventual direction we'd want to go anyway, I'm inclined to go that route...

@mikemadison13
Copy link
Contributor Author

cool, if that's the route to go then as i said above i don't really care. i just would like the most expedient route to d10. so if we aren't merging this and cutting it (despite it being ready to go right now) when can we have the other? happy to help test once we have the dependencies merged.

@claudiu-cristea
Copy link
Contributor

I guess this can be closed. The fix from #620 has been already merged in master. I would love to get some feedback from projects using the current master.

@jhedstrom
Copy link
Owner

Thanks for all the work here! I'm closing this out since #620 was merged.

@jhedstrom jhedstrom closed this Dec 22, 2022
@AlexSkrypnyk
Copy link

@jhedstrom
This PR was authored in October 2022. It was then closed in Dec 2022. It is now March 2023 and we still do not have a stable release with this update for 4.x or 5.x after 5 months :(

The reason for submitting this pull request was to prevent this specific situation from occurring.

Could you please advise what is the planned course of actions here? Is 5.x going to have a release soon? Can this PR be ported to 4.x and released?

@jhedstrom
Copy link
Owner

@AlexSkrypnyk thanks for the reminder. Since no major issues have been reported with the alpha release I've tagged RC1 for 5.0.0.

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.

5 participants