Conversation
…aller to continue on a file not found exception.
…ice, allowing for re-use in Deploy.
bergmania
requested changes
Oct 23, 2023
Member
bergmania
left a comment
There was a problem hiding this comment.
A small change request, but the rest looks good to me
| ///// <param name="Udi">A file entity identifier.</param> | ||
| ///// <returns>A byte array containing the file content.</returns> | ||
| // byte[] GetFileBytes(StringUdi Udi); | ||
| Task GetFilesAsync(IEnumerable<StringUdi> udis, IFileTypeCollection fileTypes, bool continueOnFileNotFound, CancellationToken token); |
Member
There was a problem hiding this comment.
IMO we should have the old signature with a default implementation that makes this part not breaking
Contributor
Author
There was a problem hiding this comment.
Have applied that amend.
8 tasks
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.
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: