Integrate TACOS with external lambda#242
Closed
matt-bernhardt wants to merge 3 commits into
Closed
Conversation
d732abe to
991b363
Compare
** 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.
6e737ab to
ebe88f1
Compare
Also move relevant tests from citation to features model
Member
Author
|
This approach was abandoned in favor of what became #243 |
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.
I'm going to keep this PR open for comparison purposes, ideally until we refactor the feature extraction.
The original scope of this PR was to integrate the application with the external detector lambda - a change that was eventually accomplished in #243. However, one of the aspects of this PR was to refactor the feature extraction into its own class, in a way that may prove to be useful.
Those last two commits are the reason why I'm keeping this around for at least a little while longer.