Skip to content

Optimized dev:urn-catalog:generate for PHPStorm #23291

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

Merged
merged 7 commits into from
Jul 18, 2019
Merged

Optimized dev:urn-catalog:generate for PHPStorm #23291

merged 7 commits into from
Jul 18, 2019

Conversation

JeroenBoersma
Copy link
Member

When generating the urn-catalog from within any docker setup with path mappings this isn't reflected correctly to PHPStorm because the path's won't match up. This is no problem for people running local php instances.

Description (*)

This change resolves the project directory and replaces all paths to $PROJECT_DIR$, this also makes moving your project possible. The change does a compare from the realpath for the given .idea/misc.xml to resolve the projectdir.

Fixed Issues (if relevant)

I didn't find any, so it only bothered me.

Manual testing scenarios (*)

Run in any console bin/magento dev:urn-catalog:generate test.xml this will replace the absolute paths to $PROJECT_DIR/path/to/file.xsd in the location attribute.

Questions or comments

No Unittests because there weren't any to optimize.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Jun 17, 2019

Hi @JeroenBoersma. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Jun 17, 2019

CLA assistant check
All committers have signed the CLA.

- removed unused import
- removed unused @param
@JeroenBoersma
Copy link
Member Author

PHP Code Sniffer detected 1 violation(s): 

FILE: .../app/code/Magento/Developer/Model/XmlCatalog/Format/PhpStorm.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
----------------------------------------------------------------------
 137 | WARNING | The use of function realpath() is discouraged
 137 | WARNING | The use of function dirname() is discouraged
----------------------------------------------------------------------

This is intended behavior. Please help me howto proceed?

@ghost ghost assigned sidolov Jun 25, 2019
* internally used code is no longer public
Use currentReaddir to make relative paths.
Second iteration which uses way less code with the same result.

- removed realpath usage
- removed dirname usage
- removed unused method
- removed unused constant
@JeroenBoersma
Copy link
Member Author

Did a second iteration with fresh mind, came up with a "better" solution.
Thanks for the feedback

@JeroenBoersma JeroenBoersma requested a review from sidolov June 27, 2019 12:04
@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, thank you for the review.
ENGCOM-5404 has been created to process this Pull Request
✳️ @sivaschenko, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@magento-engcom-team
Copy link
Contributor

@JeroenBoersma thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@JeroenBoersma JeroenBoersma removed the request for review from sidolov July 5, 2019 14:41
@engcom-Alfa engcom-Alfa self-assigned this Jul 8, 2019
@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

@m2-assistant
Copy link

m2-assistant bot commented Jul 18, 2019

Hi @JeroenBoersma, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.3 milestone Jul 18, 2019
@VladimirZaets VladimirZaets added the Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests label Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants