magento / marketplace-eqp

Magento 1.x Coding Standard
http://docs.magento.com/marketplace/user_guide/Resources/pdf/Extension_Quality_Program_Overview.pdf
MIT License
224 stars 68 forks source link

Issue installing marketplace-eqp on Mac os sierra #50

Closed Banjerr closed 6 years ago

Banjerr commented 7 years ago
The "https://repo.magento.com/packages.json" file could not be downloaded: SSL: Connection reset by peer  
Failed to enable crypto                                                                                   
failed to open stream: operation failed

Getting this error after attempting to install. I never get prompted for any auth. I've tried setting up an auth.json file, according to the Composer docs, and added the public/secret keys that I set up with my Magento account, but get the same error as without having an auth.json.

Any tips?

Banjerr commented 7 years ago

I was able to resolve this by following this Issue https://github.com/magento/marketplace-eqp/issues/2

I was under the impression this would be able to be installed "globally", but this works for me.

Banjerr commented 7 years ago

Actually, this does not seem to have worked. At first, I was getting the error

ERROR: the "MEQP1" coding standard is not installed. The installed coding standards are MySource, PEAR, PHPCS, PSR1, PSR2, Squiz and Zend

and then set the install path using...

vendor/bin/phpcs --config-set installed_paths /path/to/marketplace-eqp

and now the error is gone, but i get no output when actually trying to test an extension?

erfanimani commented 7 years ago

Maybe check if it's outputting errors @Banjerr. I've done the same, but I'm actually getting a fatal error:

Fatal error: Trait 'Utils\Helper' not found in .../vendor/magento/marketplace-eqp/MEQP2/Sniffs/Classes/CollectionDependencySniff.php on line 21

Seems like my base path is wrong or something.. I've installed marketplace-eqp through Composer on a project basis.

edit: I can fix that error by adding an include path to php cli, but then something else can't be found. I'm thinking I'm using it the wrong way..

edit2: Running on bitbucket pipelines mentions Fatal error: Interface 'PHP_CodeSniffer_Sniff' not found in ./vendor/magento/marketplace-eqp/MEQP2/Sniffs/NamingConventions/ReservedWordsSniff.php on line 15. Seems you're not supposed to install it on a project basis, since it expects the squizlabs codesniffer to be installed as a dependency.

lenaorobei commented 7 years ago

@Banjerr is this issue still actual? If yes, please provide steps to reproduce it.

Banjerr commented 7 years ago

@lenaorobei indeed it is. I believe the main problem is not being able to install with Composer; i'd get that SSL issue every time. Adding as a dependency on a project seemed to work, but that doesn't seem to work at all, similar experience to @erfanimani

  reset by peer   
  Failed to enable crypto                                                                                   
  failed to open stream: operation failed
lenaorobei commented 7 years ago

@Banjerr it seems like this problem is related to Magento packages repository. Please, find more about similar issues in the article and in the GitHub-thread.

lenaorobei commented 7 years ago

@Banjerr was this answer helpful for you? Can I close this issue?

ronpeled commented 7 years ago

This is still an issue for me. I have installed phpcs from either composer or brew and it results in the same issue:

PHP Fatal error:  Interface 'PHP_CodeSniffer_Sniff' not found in /usr/local/etc/php-code-sniffer/Standards/MEQP1/Sniffs/Classes/Mysql4Sniff.php on line 15
PHP Stack trace:
PHP   1. {main}() /usr/local/Cellar/php-code-sniffer/3.0.2/bin/phpcs:0
PHP   2. PHP_CodeSniffer\Runner->runPHPCS() /usr/local/Cellar/php-code-sniffer/3.0.2/bin/phpcs:18
PHP   3. PHP_CodeSniffer\Runner->init() /usr/local/Cellar/php-code-sniffer/3.0.2/src/Runner.php:70
PHP   4. PHP_CodeSniffer\Ruleset->__construct() /usr/local/Cellar/php-code-sniffer/3.0.2/src/Runner.php:294
PHP   5. PHP_CodeSniffer\Ruleset->registerSniffs() /usr/local/Cellar/php-code-sniffer/3.0.2/src/Ruleset.php:206
PHP   6. PHP_CodeSniffer\Autoload::loadFile() /usr/local/Cellar/php-code-sniffer/3.0.2/src/Ruleset.php:1094
PHP   7. include() /usr/local/Cellar/php-code-sniffer/3.0.2/autoload.php:167

Fatal error: Interface 'PHP_CodeSniffer_Sniff' not found in /usr/local/etc/php-code-sniffer/Standards/MEQP1/Sniffs/Classes/Mysql4Sniff.php on line 15

Call Stack:
    0.0020     352832   1. {main}() /usr/local/Cellar/php-code-sniffer/3.0.2/bin/phpcs:0
    0.0037     507080   2. PHP_CodeSniffer\Runner->runPHPCS() /usr/local/Cellar/php-code-sniffer/3.0.2/bin/phpcs:18
    0.0140     860728   3. PHP_CodeSniffer\Runner->init() /usr/local/Cellar/php-code-sniffer/3.0.2/src/Runner.php:70
    0.0194    1082160   4. PHP_CodeSniffer\Ruleset->__construct() /usr/local/Cellar/php-code-sniffer/3.0.2/src/Runner.php:294
    0.0449    1179984   5. PHP_CodeSniffer\Ruleset->registerSniffs() /usr/local/Cellar/php-code-sniffer/3.0.2/src/Ruleset.php:206
    0.0450    1180040   6. PHP_CodeSniffer\Autoload::loadFile() /usr/local/Cellar/php-code-sniffer/3.0.2/src/Ruleset.php:1094
    0.0452    1203400   7. include('/usr/local/etc/php-code-sniffer/Standards/MEQP1/Sniffs/Classes/Mysql4Sniff.php') /usr/local/Cellar/php-code-sniffer/3.0.2/autoload.php:167

Any idea on how to resolve this, that would be very helpful. If I find a way to resolve it I will include it here below.

ronpeled commented 7 years ago

ok, I was able to make this work now. The only way it worked is with the older version of Code Sniffer 2.9.

I used brew to install it brew install homebrew/php/php-code-sniffer@2.9 and once it was installed properly everything worked as it should.

Seems like some work needs to be done to make this package play nice with the newer version.

lenaorobei commented 7 years ago

@ronpeled did you installed via Composer by running $ composer create-project --repository=https://repo.magento.com magento/marketplace-eqp magento-coding-standard command?

In composer.json we require version 2.6.2 of PHP_CodeSniffer.

ronpeled commented 7 years ago

@lenaorobei Yes.

lenaorobei commented 7 years ago

@ronpeled what errors did you get in case of installing via Composer? In the provided stack trace I see version 3.0.2.

ronpeled commented 7 years ago

I'm not sure, but when I had php code sniffer 3.0.2 installed via composer that's when all the issues came up. It seems this version of code sniffer includes some additional config settings that take over the local setup with php code sniffer 2.6.2. Once removed, it all worked as expected.

orlangur commented 7 years ago

@ronpeled I don't think problem related to code sniffer in any way, I bet it's purely Composer / system $PATH issue.

So, /usr/local/Cellar/php-code-sniffer/3.0.2/bin/phpcs:0 seems like globally installed phpcs (latest stable version) while this project requires version 2.6.2.

To make them play well with each other you need either to composer require this project globally (so that 2.6.2 version of phpcs is installed globally as well) or put it to some directory but then you should use not phpcs command but <YOUR DIRECTORY>/vendor/bin/phpcs.

ronpeled commented 7 years ago

@orlangur Yes I think you are correct. The issue was with the global phpcs I had setup on my environment. Once removed the local version worked as expected. All good now.

in my other comment I mentioned it would be ideal that it worked with any version of phpcs but I'm sure it's a bit more complicated. This package as is now works and is very helpful.

Side note: it would be ideal when Magento's core files will actually 'pass' these tests... :)

orlangur commented 7 years ago

I don't think it makes sense due to

This is the first stable release of the 3.0 branch, and is a large refactoring of the code base. It breaks backwards compatibility for all custom sniffs and custom reports. An upgrade guide for sniff and report developers is available here: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Version-3.0-Upgrade-Guide

Everything is fine until proper constraints specified in composer.json.

Magento 2 main repo is currently using ancient 1.x version, after both repositories migrate to 3.x combined set of rules can be enforced for core. It will lead to improving both Magento code base and this coding standard I believe.

lenaorobei commented 6 years ago

If there are any additional questions please refer to the Magento Stack Exchange for further discussion.

roberto-ebizmarts commented 5 years ago

@ronpeled, Hello. I am trying to understand what was de definitive solution to this issue. Could you please tell me if it is with composer or not?