Problem/Motivation
Hello project maintainers,
This is an automated issue to help make this module compatible with Drupal 10.
To read more about this effort by the Drupal Association, please read: The project update bot is being refreshed to support Drupal 10 readiness of contributed projects
Patches will periodically be added to this issue that remove Drupal 10 deprecated API uses. To stop further patches from being posted, change the status to anything other than Active, Needs review, Needs work or Reviewed and tested by the community. Alternatively, you can remove the "ProjectUpdateBotD10" tag from the issue to stop the bot from posting updates.
The patches will be posted by the Project Update Bot official user account. This account will not receive any issue credit contributions for itself or any company.
Proposed resolution
You have a few options for how to use this issue:
- Accept automated patches until this issue is closed
If this issue is left open (status of Active, Needs review, Needs work or Reviewed and tested by the community) and the "ProjectUpdateBotD10" tag is left on this issue, new patches will be posted periodically if new deprecation fixes are needed.
As the Drupal Rector project improves and is able to fix more deprecated API uses, the patches posted here will cover more of the deprecated API uses in the module.
Patches and/or merge requests posted by others are ignored by the bot, and general human interactions in the issue do not stop the bot from posting updates, so feel free to use this issue to refine bot patches. The bot will still post new patches then if there is a change in the new generated patch compared to the patch that the bot posted last. Those changes are then up to humans to integrate.
- Leave open but stop new automated patches.
If you want to use this issue as a starting point to remove deprecated API uses but then don't want new automated patches, remove the "ProjectUpdateBotD10" tag from the issue and use it like any other issue (the status does not matter then). If you want to receive automated patches again, add back the "ProjectUpdateBotD10" tag.
- Close it and don't use it
If the maintainers of this project don't find this issue useful, they can close this issue (any status besides Active, Needs review, Needs work and Reviewed and tested by the community) and no more automated patches will be posted here.
If the issue is reopened, then new automated patches will be posted.
If you are using another issue(s) to work on Drupal 10 compatibility it would be very useful to other contributors to add those issues as "Related issues" when closing this issue.
Remaining tasks
Using the patches
- Apply the latest patch in the comments by Project Update Bot or human contributors that made it better.
- Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
- Provide feedback about how the testing went. If you can improve the patch, post an updated patch here.
Providing feedback
If there are problems with one of the patches posted by the Project Update Bot, such as it does not correctly replace a deprecation, you can file an issue in the Drupal Rector issue queue. For other issues with the bot, for instance if the issue summary created by the bot is unclear, use the Project analysis issue queue.
Issue fork genpass-3287722
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
project update bot commentedThis is an automated patch generated by Drupal Rector. Please see the issue summary for more details.
It is important that any automated tests available are run with this patch and that you manually test this patch.
Drupal 10 Compatibility
According to the Upgrade Status module this patch makes this module compatible with Drupal 10! 🎉
This patch updates the
info.ymlfile for Drupal 10 compatibility.Leaving this issue open, even after committing the current patch, will allow the Project Update Bot to post additional Drupal 10 compatibility fixes as they become available in Drupal Rector.
Debug info
This patch was created using these packages:
Comment #3
project update bot commentedComment #4
prudloff commentedModuleHandlerInterface::getImplementations()is deprecated and Drupal 10 provides no easy way to get a list of modules implementing a hook: https://www.drupal.org/node/3000490This patch adds an hard-coded list for people that need to use this module on Drupal 10 and don't need other implementations, but we should find a new way to implement this.
Comment #5
yashingole commentedI have reviewed and checked Patch #4 this works for drupal 9.5 and drupal 10.0. and 10.0.1
Screenshots of the compatibility on 9.5 and Config page on 10 have been attached for reference:
Comment #6
anybodyDrupal 10 is close so this is important.
But the patch introduces a new @todo and
core_version_requirement: ^8 || ^9 || ^10is incorrect!
Must be
core_version_requirement: ^8.7.7 || ^9 || ^10or
core_version_requirement: ^8.9 || ^9 || ^10And please use merge-requests.
Comment #9
hardikpandya commentedComment #10
rajab natshahComment #11
rajab natshahThank you for maintaining the Generate Password module.
Hoping for a soft commit and a soft tag release. To ease testing with Drupal 10
Testing now with
git clone git@git.drupal.org:project/genpass.gitHad Real physical testing round for Generate Password with Drupal ~10
Get the patch and apply it under Drupal 10 site. ( to be able to enable )
Change file/directory mod and ownership of files:
Install with Drush
Rebuild the cache:
Open a browser and change the address to:
http://localhost/sandboxes/drupal10genpass__test/web/After a login with the webmaster test user
When creating a new testing user
test.genpassfor exampleAfter saving the new user the following message will show up
Comment #12
gregglesThere's some unresolved feedback on the merge request from Anybody so moving this back to Needs Work.
The default works, but custom password implementations will not work as expected.
Comment #13
rajab natshahComment #14
gregglesThis is still "needs work."
Comment #15
rajab natshahGot that Greg, Thanks for having time to follow up on this issue.
Important notes from #12
Noticed Pierre's notes about
Comment #16
rajab natshahOh the last code was a static return!
Researched a bit on what other modules are doing in this case
https://git.drupalcode.org/project/scheduler/-/commit/1bb684d#66fb3c85a3...
Got the point.
Testing custom module with a
hook_passwordto be listed in the return of thegenpass_algorithm_modulesfunction.Not sure if I have a push access over the issue fork.
Hoping for Pierre to commit his suggested change.
It could be that
invokeAllWithwill invoke the functions.To my understanding. In our case we only want to list not to invoke others.
Comment #17
rajab natshahAll hook invocation delegated to Module Handler service
#2616814: Delegate all hook invocations to ModuleHandler
https://git.drupalcode.org/project/drupal/-/commit/8f1c7a8#9a1c5d1dd1901...
Suggesting to change to use has Implementations:
Comment #18
rajab natshahComment #19
grevil commentedIf we are using
moduleHandler()->hasImplementations, we can't keep the D8 compatibility, as this method was introduced in Drupal 9.4.Comment #20
grevil commentedFurthermore, while running the tests locally, I got the following deprecation notice:
But I can not seem to find any code using,
user_password()and I have no idea what is causing this deprecation notice. Maybe one of the maintainers can rerun the tests using PHP >= 8.1, to see if that problem also appears on remote?Comment #21
rajab natshahNice, good point Joshua.
To me it feels a new
2.0.xbranch would keep deprecated code and what newclass/function/serviceto use. and support for PHP 8.1, PHP 8.2, later on.Managing between that is a tricky business
Let us see how the final changes will look like.
Comment #22
grevil commented@Rajab Natshah, sounds good! :)
Comment #23
anybody@greggles, could you perhaps create that 2.0.x as of #20 and #21? So we can proceed here :)
Comment #26
kunalgautam commentedHello @Anybody I have created 2.0.x branch in this issue fork. This is MR
f9be2491
Comment #27
gregglesWhat would the path to upgrade be for someone on Drupal 9 with this new 2.0.x that's proposed? Do they need to disable genpass as part of the core upgrade process?
Comment #28
rajab natshahSuggested to do this in two steps:
2.0.xfor^9 || ^10( only new code - ditching any~8.0or~9.0code using a logic with version compare!version_compare(\Drupal::VERSION, '10.0.0', 'lt')8.x-1.xfor^8 || ^9 || ^10( with old code and new code - only needed for the upgraded process to2.0.x)8and9sites could update to latest version on the genpass~1.0Drupal 10, only change in the composer from~1.0to~2.0drush updbon the switch from~1.0to~2.0New features could only be committed to
2.0.xand freeze new features on the
8.x-1.xbranch.Hoping that this would be a good plan.
Greg, do you find this plan logical? for sure you know more needed cases to cover.
Comment #29
gregglesThanks for laying that out, @Rajab Natshah. That mostly makes sense to me. 2.0.x being for 9 or 10 works for me, but I think you maintain a bit more compatibility than needed.
That plan means that 2.0.x only needs to work with 10.x, right? That seems easier to do.
Another option:
Make 8.x-1.x compatible with both 8.x and 9.x (at this point I don't think we should invest much time in 8, honestly).
Make 2.0.x compatible with both 9.x and 10.x.
The upgrade flow is for 8.x-and 9.x to get on 9.x core with 8.x-1.x. I believe this is already possible and we can say that 8.x-1.x is no longer actively developed. Then once core is at 9.x people should upgrade to genpass 2.x and can upgrade core to 10.x.
Either of these 3 plans (yours, my first modification to yours to drop 10 support from 8.x-1.x branch, the 3rd one here to drop 10 support form 8.x-1.x and adjust the upgrade flow) works for me.
I'm also happy passing on maintainership if someone else wants to become maintainer - please file an issue with links to your activity in this module's queue showing creation of patches, reviews, etc. that demonstrate the work of a maintainer.
Comment #30
grevil commentedI am ok, with either keeping the 2.0x branch D9 and D10 compatible OR D10 only.
Although if we want to keep the D9 compatibility we have to define
core_version_requirement: ^9.4 || ^10, as explained in #19:Comment #31
rajab natshahThanks, Greg, I agree that your modification plan is better.
with Joshua's notes too.
2.0.x will have ^9.4 || ^10
8.x-1.x will have ^8 || ^9
Paving the way for a smooth upgrade workflow.
Love to help in maintaining the Generate Password module.
#3338506: Offering to Support and Maintain the Generate Password module
Comment #32
rajab natshahGreg, Thank you for time and consideration.
Starting with #3338638: Start a 2.0.x branch for the Generate Password module to support Drupal ^9.4 || ^10
Comment #33
rajab natshahComment #34
rajab natshahComment #35
rajab natshahAs listed in #17
Comment #36
rajab natshahComment #37
grevil commentedThank you, Rajab for bringing this issue towards an end! :)
What are the remaining steps to get this committed to 2.0.x? As I am aware, we only need to test your changes (especially the "hasImplementations" part)?!
Or is there anything else to do, as you changed the status to "Needs work"?
Comment #38
rajab natshahComment #41
rajab natshahComment #42
rajab natshah#3338638: Start a 2.0.x branch for the Generate Password module to support Drupal ^9.4 || ^10
Comment #43
rajab natshahDevelopment version: 2.0.x-dev updated 7 Feb 2023 at 09:35 UTC
Comment #44
rajab natshahComment #45
grevil commentedGreat work! Thanks for your time! :)
Comment #46
rajab natshahThank you all, for the nice collaborative work on this issue for this important module.
✅ Released genpass-2.0.0-alpha1
Soft release (
pre-release)Having more post release testing before releasing the stable
2.0.0tag.Comment #47
rajab natshah