Skip to content

DO NOT MERGE - lambda integration via lookup pattern #245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

matt-bernhardt
Copy link
Member

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.

** 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.
@matt-bernhardt matt-bernhardt marked this pull request as draft June 4, 2025 17:42
@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-245 June 4, 2025 17:44 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants