-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Use tmp folder from Magento installation to prevent path collisions #34272
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
Use tmp folder from Magento installation to prevent path collisions #34272
Conversation
Hi @alinalexandru. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
1e57e3f
to
cc97c27
Compare
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
cc97c27
to
c71461b
Compare
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix failing static tests
c71461b
to
2907c0b
Compare
@magento run Static Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@ihor-sviziev Fixed |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @alinalexandru
Thanks for PR. Please look at my comment
@@ -106,8 +106,10 @@ public function prepareExportData() | |||
$this->cryptographer->encode($tmpDirectory->readFile($this->getArchiveRelativePath())) | |||
); | |||
} finally { | |||
$tmpDirectory->delete($this->getTmpFilesDirRelativePath()); | |||
$tmpDirectory->delete($this->getArchiveRelativePath()); | |||
if (isset($tmpDirectory) && $tmpDirectory instanceof WriteInterface) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$tmpDirecory
always will be WriteInterface
and check $tmpDirectory instanceof WriteInterface
is unnecessary
Hi @ihor-sviziev, thank you for the review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Looks good for me. All tests passed
Hi @Den4ik, thank you for the review. |
@magento convert to patch for 2.4.3 |
@sidolov changes has been successfully converted for 2.4.3 version and pushed to the converted-magento-magento2-2.4.3 branch. You may submit a pull request using the link: 2.4.3-release...magento:converted-magento-magento2-2.4.3 |
1 similar comment
@sidolov changes has been successfully converted for 2.4.3 version and pushed to the converted-magento-magento2-2.4.3 branch. You may submit a pull request using the link: 2.4.3-release...magento:converted-magento-magento2-2.4.3 |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
1 similar comment
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Functional Tests EE |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Hi @alinalexandru , @Den4ik , @ihor-sviziev Thanks for your contribution and collaboration . Pre Conditions
Reproducible steps
Observation - Analytics folder was not found in the given path Kindly let me know based on what factors files will get generated in given path, So, that we can proceed further in our testing. |
✔️ QA Passed Preconditions:
Manual testing scenario:
Before: ✖️ The responded command used to return the folder path from both the instances which is a common local system TEMP folder. After: ✔️ The responded command returns the folder path from both the instances which is a unique Since it is a specific case where the reporting folder has been changed, and so no additional regression test case are required for this case. |
Description (*)
Use
tmp
folder relative to magento installation, instead of using the system tmp.SYS_TMP
is defined\Magento\Framework\Filesystem\DirectoryList
, but\Magento\Framework\App\Filesystem\DirectoryList
is used in\Magento\Analytics\Model\ExportDataHandler
, so it means we can usTMP
constant.In this way, every magento2 installation will not interfere with each other.
Fixed Issues (if relevant)
Manual testing scenarios (*)
I see 2 ways to do manual test, as cron cleans everything during execution
finaly
block from\Magento\Analytics\Model\ExportDataHandler
Contribution checklist (*)