Page MenuHomePhabricator

Elastica dependencies need update to v5.3.2
Closed, ResolvedPublic

Description

https://phabricator.wikimedia.org/T182177 describes several usages of "each" which is deprecated in PHP since 7.2. The Elastica dependencies on elasticsearch/elasticsearch and ruflin/elastica should be updated to 5.3.2 from 5.3.0 to pull in the fixes from upstream. Currently, the Elastica extension (REL1_31 in combination with Elasticsearch 5.6.x and PHP 7.2.10) emits this warning (when $wgDevelopmentWarnings = 1;):

Deprecated : The each() function is deprecated. This message will be suppressed on further calls in /srv/www/sites/mediawiki/extensions/Elastica/vendor/ruflin/elastica/lib/Elastica/Multi/MultiBuilder.php on line 50

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

(I'd commit this change to the appropriate branch (or fork) of Extension:Elastica and make a pull request, but I can't find how to do that here.)

Something like the following should work for extension.json

{
        "name": "mediawiki/elastica",
        "description": "Provides the elastica library and a connection layer as a MediaWiki extension",
        "homepage": "https://www.mediawiki.org/wiki/Extension:Elastica",
        "license": "GPL-2.0-or-later",
        "authors": [
                {
                        "name": "Nik Everett"
                },
                {
                        "name": "Chad Horohoe"
                }
        ],
        "repositories": [
                {
                        "type": "package",
                        "package": {
                                "name": "ruflin/elastica",
                                "version": "5.3.2",
                                "dist": {
                                        "url": "https://github.com/ruflin/Elastica/archive/5.3.2.zip",
                                        "type": "zip"
                                },
                                "source": {
                                        "url": "https://github.com/ruflin/Elastica.git",
                                        "type": "git",
                                        "reference": "tags/5.3.2"
                                },
                                "autoload": {
                                        "psr-4": {
                                                "Elastica\\": "lib/Elastica/"
                                        }
                                },
                                "require": {
                                        "php": ">=5.5.0",
                                        "elasticsearch/elasticsearch": ">=5.3.0"
                                }
                        }
                },
                {
                        "type": "package",
                        "package": {
                                "name": "elasticsearch/elasticsearch",
                                "version": "5.3.2",
                                "dist": {
                                        "url": "https://github.com/elastic/elasticsearch-php/archive/v5.3.2.zip",
                                        "type": "zip"
                                },
                                "source": {
                                        "url": "https://github.com/elastic/elasticsearch-php.git",
                                        "type": "git",
                                        "reference": "tags/v5.3.2"
                                },
                                "require": {
                                        "php": ">=5.5.0"
                                },
                                "autoload": {
                                        "psr-4": {
                                                "Elasticsearch\\": "src/Elasticsearch/"
                                        }
                                }
                        }
                }
        ],
        "require": {
                "php": ">=5.5.9",
                "ruflin/elastica": "5.3.2",
                "ext-curl": "*"
        },
        "require-dev": {
                "jakub-onderka/php-parallel-lint": "1.0.0",
                "jakub-onderka/php-console-highlighter": "0.3.2",
                "mediawiki/mediawiki-codesniffer": "18.0.0",
                "mediawiki/minus-x": "0.3.1"
        },
        "scripts": {
                "fix": [
                        "phpcbf",
                        "minus-x fix ."
                ],
                "test": [
                        "parallel-lint . --exclude vendor --exclude node_modules",
                        "phpcs -p -s",
                        "minus-x check ."
                ]
        }
}

Could someone help me out with a pointer on how I'm supposed to contribute a patch? I tried to push to a new branch using my developer account, but was rejected:

root@ubuntu-DCS-wiki:/srv/www/sites/mediawiki/extensions/Elastica# git push 
fatal: The current branch T208650 has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin T208650

root@ubuntu-DCS-wiki:/srv/www/sites/mediawiki/extensions/Elastica# git push --set-upstream origin T208650
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 406 bytes | 406.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2)
remote: Processing changes: refs: 1, done    
To ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Elastica
 ! [remote rejected] T208650 -> T208650 (prohibited by Gerrit: create not permitted for refs/heads/T208650)
error: failed to push some refs to 'ssh://freephile@gerrit.wikimedia.org:29418/mediawiki/extensions/Elastica'
root@ubuntu-DCS-wiki:/srv/www/sites/mediawiki/extensions/Elastica# git remote -v
origin  ssh://freephile@gerrit.wikimedia.org:29418/mediawiki/extensions/Elastica (fetch)
origin  ssh://freephile@gerrit.wikimedia.org:29418/mediawiki/extensions/Elastica (push)

Could someone help me out with a pointer on how I'm supposed to contribute a patch? I tried to push to a new branch

@freephile: Thanks for taking a look at the code! Please see https://www.mediawiki.org/wiki/Gerrit/Tutorial

Change 471532 had a related patch set uploaded (by Freephile; owner: Freephile):
[mediawiki/extensions/Elastica@master] fixes T208650 - remove deprecated "each" in PHP

https://gerrit.wikimedia.org/r/471532

Change 472160 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/vendor@master] Update elasticsearch/elasticsearch and ruflin/elastica to 5.3.2

https://gerrit.wikimedia.org/r/472160

EBjune triaged this task as Medium priority.Nov 8 2018, 6:03 PM

Change 471532 had a related patch set uploaded (by Legoktm; owner: Freephile):
[mediawiki/extensions/Elastica@master] Remove deprecated "each" in PHP

https://gerrit.wikimedia.org/r/471532

Change 472160 merged by jenkins-bot:
[mediawiki/vendor@master] Update elasticsearch/elasticsearch and ruflin/elastica to 5.3.2

https://gerrit.wikimedia.org/r/472160

Change 471532 merged by jenkins-bot:
[mediawiki/extensions/Elastica@master] Remove deprecated "each" in PHP

https://gerrit.wikimedia.org/r/471532

debt claimed this task.