Updates and support for re-use of CMS logic in Deploy #14990
Merged
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.
Prerequisites
Description
This PR contains two updates that we'd like to make for Umbraco 13 in order to simplify code in Deploy.
Amend to IFileSource interface
I've added an extra parameter to the interface method
IFileSource.GetFilesAsync
. We have a use for this where we want to continue if a file matching one of the provided UDIs isn't found in some cases, and in others, throw aFileNotFoundException
. Hence the need for the parameter. Currently we are working around this by casting to the concrete type, but it would be cleaner if it were on the interface.There are no uses of this interface within the CMS itself.
Migrate logic for redirect tracking and creation to a service
Currently this logic is within a notification handler -
RedirectTrackingHandler
- which means the logic within can't easily be re-used in Deploy where we also need to track content moves and name changes in order to create redirects. As such we have this logic effectively duplicated in existing versions of Deploy.In this PR I've moved the logic into a service -
IRedirectTracker
/RedirectTracker
- from where we should be able to re-use it in Deploy rather than duplicating.I've also included some refactoring and minor bug fixing work that @ronaldbarendse carried out when reviewing and updating this for Deploy.
To Test: