Skip to content

Integrate TACOS with external lambda #242

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

Closed
wants to merge 3 commits into from
Closed

Conversation

matt-bernhardt
Copy link
Member

@matt-bernhardt matt-bernhardt commented May 28, 2025

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.

@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-242 May 28, 2025 14:46 Inactive
@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-242 May 28, 2025 19:42 Inactive
@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-242 May 28, 2025 19:45 Inactive
@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-242 May 29, 2025 16:53 Inactive
@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-242 May 29, 2025 19:37 Inactive
@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-242 May 29, 2025 21:43 Inactive
@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-242 May 29, 2025 22:46 Inactive
@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-242 May 29, 2025 23:38 Inactive
** 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.
@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-242 May 29, 2025 23:51 Inactive
@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-242 May 30, 2025 20:25 Inactive
Also move relevant tests from citation to features model
@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-242 May 30, 2025 21:07 Inactive
@matt-bernhardt
Copy link
Member Author

This approach was abandoned in favor of what became #243

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