FOUR-32329: Handle unavailable assets in DevLink bundles#8930
Open
eiresendez wants to merge 1 commit into
Open
FOUR-32329: Handle unavailable assets in DevLink bundles#8930eiresendez wants to merge 1 commit into
eiresendez wants to merge 1 commit into
Conversation
|
|
QA server K8S was successfully deployed https://ci-e4ae468514.engk8s.processmaker.net |
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.





Issue & Reproduction Steps
DevLink bundle serialization assumed that every
bundle_assetsassociation resolved to an available model. When an association referenced a deleted asset or a model class from an unavailable package, opening or exporting the bundle resulted in a generic HTTP 500 error. The original report associated the failure with bundle volume, but the reproduced failure was caused by an orphaned Collection association.A local orphaned association can be created with:
php artisan tinker --execute='$bundle=ProcessMaker\Models\Bundle::factory()->create(["name"=>"FOUR-32329 Orphan Collection Repro"]); ProcessMaker\Models\BundleAsset::factory()->create(["bundle_id"=>$bundle->id,"asset_type"=>ProcessMaker\Models\BundleAsset::COLLECTION_CLASS,"asset_id"=>1000006]); echo $bundle->id.PHP_EOL;'Open
/admin/devlink/local-bundles/{bundle-id}/. Before this change, the bundle metadata request returned a 500 while reading properties from the missing model. Exporting or installing the same bundle also surfaced the server exception.Solution
valid,missing, andtype_unavailableintegrity states to bundle assets, with safe fallback metadata for unavailable assets.How to Test
Run the focused automated coverage:
vendor/bin/phpunit tests/Model/BundleAssetTest.php vendor/bin/phpunit tests/Model/BundleTest.php --filter testExportRejectsBundleWithUnavailableAssetsBeforeExporting vendor/bin/phpunit tests/Model/DevLinkTest.php --filter testInstallRemoteBundleReportsUnavailableRemoteAssets vendor/bin/phpunit tests/Feature/Api/DevLinkTest.php --filter '/(testShowBundleReportsUnavailableAssetsWithoutFailing|testExportBundleRejectsUnavailableAssets|testInstalledBundleAllowsRemovingOnlyUnavailableAssets)/' npm run developmentFor manual validation:
Missing Collection #1000006, without a broken link.Remove from bundleand confirm the dialog states that only the association will be removed.Related Tickets & Packages
ci:deploy