Skip to content

Conversation

@matt-bernhardt
Copy link
Member

@matt-bernhardt matt-bernhardt commented Jun 16, 2025

Developer

Now that the detector lambda has been deployed and can do real work, it seems like some last-minute tweaks are needed for TACOS to communicate reliably.

How does this address that need:

Three small tweaks are needed to Detector::MlCitation:

  1. Add a Content-Type header to the communication with the detector
  2. Sort and re-hash the hash of features (the order of parameters matters for scikit-learn)
  3. The response parsing in the fetch method needs to account for a capitalized response "True" instead of "true".

Document any side effects to this change:

Along with these changes comes a few tweaks around the tests.

  • Making sure we explicitly test for both responses via the .new() method
  • Setting the sequence test to use its own cassette with multiple interactions (avoids a first-time-through test failure when renegenerating cassettes)
  • Scrubbing the challenge secret from cassettes as a defense in depth
  • Regenerating all cassettes

Ticket(s)

https://mitlibraries.atlassian.net/browse/TCO-187

Accessibility

  • ANDI or Wave has been run in accordance to our guide and
    all issues introduced by these changes have been resolved or opened
    as new issues (link to those issues in the Pull Request details above)
  • There are no accessibility implications to this change

Documentation

  • Project documentation has been updated, and yard output previewed
  • No documentation changes are needed

ENV

  • All new ENV is documented in README.
  • All new ENV has been added to Heroku Pipeline, Staging and Prod.
  • ENV has not changed.

Stakeholders

  • Stakeholder approval has been confirmed
  • Stakeholder approval is not needed

Dependencies and migrations

NO dependencies are updated

NO migrations are included

Reviewer

Code

  • I have confirmed that the code works as intended.
  • Any CodeClimate issues have been fixed or confirmed as
    added technical debt.

Documentation

  • The commit message is clear and follows our guidelines
    (not just this pull request message).
  • The documentation has been updated or is unnecessary.
  • New dependencies are appropriate or there were no changes.

Testing

  • There are appropriate tests covering any new functionality.
  • No additional test coverage is required.

** Why are these changes being introduced:

Now that the detector lambda has been deployed and can do real work, it
seems like some last-minute tweaks are needed for TACOS to communicate
reliably.

** Relevant ticket(s):

* https://mitlibraries.atlassian.net/browse/tco-187

** How does this address that need:

Three small tweaks are needed to Detector::MlCitation:
1. Add a Content-Type header to the communication with the detector
2. Sort and re-hash the hash of features (the order of parameters
   matters for scikit-learn)
3. The response parsing in the fetch method needs to account for a
   capitalized response "True" instead of "true".

** Document any side effects to this change:

Along with these changes comes a few tweaks around the tests.

- Making sure we explicitly test for both responses via the .new()
method
- Setting the sequence test to use its own cassette with multiple
interactions (avoids a first-time-through test failure when
renegenerating cassettes)
- Scrubbing the challenge secret from cassettes as a defense in depth
- Regenerating all cassettes
@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-250 June 16, 2025 15:42 Inactive
@JPrevost JPrevost self-assigned this Jun 16, 2025
@matt-bernhardt matt-bernhardt merged commit fa235c7 into main Jun 16, 2025
7 checks passed
@matt-bernhardt matt-bernhardt deleted the integration branch June 16, 2025 19:49
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.

4 participants