fix(Workspace): Purge and remove transport files via package workspace paths#16936
Open
Ibochkarev wants to merge 1 commit intomodxcms:3.xfrom
Open
fix(Workspace): Purge and remove transport files via package workspace paths#16936Ibochkarev wants to merge 1 commit intomodxcms:3.xfrom
Ibochkarev wants to merge 1 commit intomodxcms:3.xfrom
Conversation
…paths Resolve transport zip and unpacked directory paths from the package workspace (aligned with modTransportPackage transport layout), with fallback to core packages when no workspace row exists. Share filesystem cleanup via TransportPackageFilesystemTrait; add PHPUnit coverage for path resolution and purge/remove flows. Resolves modxcms#16929
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does it do?
Introduces
TransportPackageFilesystemTraitwithresolveTransportPaths()so Purge and Remove locate the.transport.zipand unpacked directory using the package’s workspacepath+packages/(andsource/ signature basename), matching how transport artifacts are laid out on disk—not only undercore_path/packages/. Shared zip/unlink anddeleteTreelogic lives in the trait (same logging as before). Purge keeps batch-friendly behaviour (removePackage(true)with optionalremove()fallback; skip filesystem cleanup when both artifacts exist but neither DB removal succeeds). Remove triesremove()after a failedremovePackage()before failing the request. PHPUnit adds coverage for path resolution and purge/remove flows;phpunit.xmlregistersTests/Processors/Workspace.Why is it needed?
Manually uploaded packages (often with no provider) are stored under the workspace packages directory. The previous implementation always used
core_path+packages/, so Purge Old Packages could report success while leaving old versions and files on disk for those uploads (issue #16929).How to test
TransportPackageFilesystemTrait|PackagesPurgeRemove).packages/directory are removed as expected.Related issue(s)/PR(s)
Resolves #16929