Open
Conversation
Reuse and rename BatchStatus enum
Rebased work as PR had been merged, some artifacts were left behind. Also re-added migration as another had been introduced
Not wired up yet but will allow cleaner controller method calls
Removes boilerplate from method calls, single place to deal with unhandled exceptions. "Friendly" error messages are currently lost with this change, only those resulting from an unhandled, non-ApiException. Also allows injection of Logger class for logging exception details
Make more use of IDeliverable interface, add batch operations
Preparation for batch handling
Extracted common code that can be shared by batch logic
Rebase includes exception filter to try..catch and call to HandleHydraRequest can be removed
This method was added in a parallel change, simplifies the request. Modified the LinqKit lib to support async requests
Rebased as PR #1170 had been merged
3025bc8 to
439504f
Compare
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 this change?
Adds support for creating batches of adjuncts. The concept of
Batchalready exists for assets, so this introduces a newAdjunctBatchconcept - it is very similar to asset/batches but different enough to warrant new entities etc.Extend Hydra Model
Resolves #1150
Adjunct HydraModel gains
AssetpropertyAPI + Engine handle AdjunctBatch
Add new entities:
AdjunctBatch- this is the overall record of items/success/failed etc counts for group of adjuncts (equivalent ofBatchfor assets)BatchandAdjunctBatchareIDeliverableBatchas there is some commonality between them.BatchAssetStatus->BatchStatusas it's shared between the 2 different batch types.AdjunctBatchAdjunct- collection of allAdjuncts in anAdjunctBatch, maintains a record of processing for adjunct-batches (equivalent ofBatchAsset)BatchAssetandAdjunctBatchAdjunctare bothIDeliverableBatchItemRefactored adjunct processing code out of
CreateOrUpdateAdjunctand intoAdjunctUpsertService. This handles mapping of fields and raising notifications.As part of extracting to
AdjunctUpsertServiceI updated engine notifications to be sent in batches, which is more efficient. This has resulted in a slight loss of identifying which actual message sending failed as we're no longer sending one at a time but this should be a very rare occurrence so the trade-off seems worthwhile.New controller for
adjunctQueue- currently only supporting POST operations to create a batch.CreateAdjunctBatchmediatr request, thisAdjunctBatchAdjunctrecord with correct status.Extend
AdjunctConverterto include an overload ofToDlcsModel()- this allows either the short or long-form assetId to be passed.Use
"adjunct"queue name, rather than"default". Saving"default"for assets, introducing a new one will make it clearer the differences. This change won't be immediately obvious but is surface in customer-queue endpoints, it allows customers to see how many items are outstanding in each type of queue.Refactor
IEngineClientto make use ofIDeliverablefor single async ingest requests. Stick toAssetandAdjunctfor batch requests as there are more differences (namely priority or not). Internally refactorEngineClientto share more internally based inIDeliverabletype.Resolves #1149
Other Changes
Add
HydraExceptionFilter- this catches any unhandled exceptions. It's essentially replacingHydraController.HandleHydraRequest()so calls to that were removed. The resulting controller code is now clearer to read.Database Migration
Note
Add AdjunctBatchAdjunctBatchestable (with sequenceadjunct_batch_id_sequenceand index on(Customer, Submitted)),AdjunctBatchAdjunctsjunction table, and a nullableBatchFK column onAdjuncts.