-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
NEXT-17739 Catch GCP NotFoundException when copying assets #2108
NEXT-17739 Catch GCP NotFoundException when copying assets #2108
Conversation
$this->filesystem->deleteDir($targetDirectory); | ||
|
||
try { | ||
$this->filesystem->deleteDir($targetDirectory); |
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.
implement own filesystem adapter which is extending from the GCP and catch that error there. On the application level, we should not catch specific filesystem exceptions
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.
That's fair. I will create an MR for superbalist/flysystem-google-cloud-storage
so it catches the exception there which makes Shopware work as intended 👍
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.
Upstream patch created: Superbalist/flysystem-google-cloud-storage#122.
Please advice on what to do next, will any new release of https://github.com/Superbalist/flysystem-google-cloud-storage be picked up automatically somewhere during the preparation of a new Shopware 6 release (as long as the Flysystem GCP package release is following SemVer), or do I need to do a manual action for this?
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.
currently a specific version of this package is pinned in our composer.json
so this needs an adjustment, once your upstream fix was released
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.
Could you change in the composer.json the pinning in this pull request? So when upstream releases a new version, it will be directly picked up?
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.
Yes I will! this MR is closed for now, which is fine, will bump it when merged upstream!
I am unpinning the dependency, so it will be updated when they release it. Should be merged the next days. Anyway thanks! 😄 |
1. Why is this change necessary?
Having this fix makes is possible to install Shopware in an environment that uses a Google Cloud Platform bucket as the public filesystem.
2. What does this change do, exactly?
It catches the thrown
Google\Cloud\Core\Exception\NotFoundException
upon copying the assets for bundles to Google Cloud. The reason this exception is thrown is that the export action always removes any pre-existing assets and copies a fresh set of bundle assets in place. However if the directory does not exist yet on Google Cloud bucket, the exception is thrown by the Google Cloud PHP library that is used by thesuperbalist/flysystem-google-cloud-storage
package.3. Describe each step to reproduce the issue or behaviour.
google-storage
.bin/console system:install
.4. Please link to the relevant issues (if any).
https://issues.shopware.com/issues/NEXT-17739
5. Checklist