DO NOT MERGE - lambda integration via lookup pattern#245
Closed
matt-bernhardt wants to merge 1 commit into
Closed
Conversation
** Why are these changes being introduced: We need a way for TACOS to communicate with the new detector lambda that serves the next iteration of our citation detector. ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/tco-183 ** How does this address that need: * The big change is that we add a lookup_citation model that handles communication with the lambda. The patterns used are similar to our other external integrations (the other lookup_ classes) - although this is not consistently implemented. * A secondary change is to define a fourth instance variable on the citation model, for @features. This is compiled from the existing work, reformatting and joining two other instance variables. * There is a mismatch between the features generated by the existing citation class and those expected by the new detector. Two features have different names, while one feature is not used at all. That change is handled via the extract_features method on lookup_citation, in order to make these changes as close as possible to the external call. ** Document any side effects to this change: * Using a lookup_* pattern for this is a departure from the way the other classes are used, and I'm tempted to refactor this PR in order to adopt a gateway pattern instead. The other lookup classes are used by GraphQL to look up external information after a detector has fired - while this lookup_citation is much earlier in the application flow, being part of the detector itself.
16 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.
This is a reference PR to compare against #243 , should the reviewer want to consider an alternate approach.
This PR will be closed when that other PR is resolved.