-
Notifications
You must be signed in to change notification settings - Fork 2
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
Allow DeliveryChannels to be modified #778
Merged
Merged
Conversation
This file contains 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
Create an imageStorage with a size of 0 for assets using `"channel":"none"` Add test for IngestExecutor skipping the processing of assets using the `none` delivery channel
Use fluent validation for images via PATCH, include new PATCH and PUT specific rules Change ModifyAssetTests that involve updating existing assets to include delivery channels use PUT HydraImageValidator rules in PutImage Make `AssetBeforeProcessing.DeliveryChannelsBeforeProcessing` nullable Include PUT rules in validator for queued images Add DeliveryChannel_ValidationError_WhenEmpty_OnPatch test to HydraImageValidatorTests Add ModifyAssetTests tests ensuring that null or empty delivery channels cannot be specified via PUT on existing assets, and empty channels cannot be specified via PATCH Add ImageBatchPatchValidator test that ensures that delivery channels cannot be specified
Use has sufficiently diverged that refactoring to remove base caching class in favour of helper makes sense. Simplifies use of asset repo in api
Introduced new class to manage reconciliation of changes submitted when updating. Update Delivery channel repos to be async
Removed 'virtual' keyword from DeliveryChannelPolicy as not using lazyLoading or change-tracking proxy
JackLewis-digirati
approved these changes
Mar 28, 2024
src/protagonist/API/Features/Image/Ingest/DeliveryChannelProcessor.cs
Outdated
Show resolved
Hide resolved
griffri
approved these changes
Mar 28, 2024
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.
Fixes #764 / WDC-60
Main Change
As detailed in related ticket, the main change here is to support updating DeliveryChannels (via PUT, PATCH or batch operation).
Refactored
AssetProcessor
, previously this handled creation of DeliveryChannels - either setting from default or finding full policies from DB. This logic was moved to a new class,DeliveryChannelProcessor
, which will:"deliveryChannels"
specified.deliveryChannelPolicyId
for existing ImageDeliveryChannel if policy changed for same channel (e.g."iiif-img"
from"default"
->"iiif-img"
)Related Refactoring
Refactored
ApiAssetRepository
. Previously this was a decorator around basicAssetRepository
which shared theAssetRepositoryCachingBase
abstract base class withDapperAssetRepository
. This setup no longer made sense and by refactoring it allowed the save and delete functionality inApiAssetRepository
to be simplified. Get operations are now specific for API usage and can be controlled by 2 bool params (bool forUpdate = false, bool noCache = false)
Updated
DeliveryChannelPolicyRepository
andDefaultDeliveryChannelRepository
to useasync
operations when interacting with database. Also moved these andAvChannelPolicyOptionsRepository
to a.DataAccess
namespace to ease groking in solution explorer.Extracted hardcoded known DeliveryChannelPolicyIds to
KnownDeliveryChannelPolicies
to make referencing in tests etc easier.