Skip to content

Conversation

@matt-bernhardt
Copy link
Member

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

The lambda has been updated to return a boolean rather than a string when making a prediction. This means we need to update the cassettes, and also the comparison we perform as part of the response handling.

There are tests and cassettes that capture the new behavior, but if you want to see it live, I've added the env vars to the review app to point at the lambda in Dev1. Opening a console in the review app should allow you to kick off the whole process, see logs get generatd in Cloudwatch, and see the response from the detector get parsed correctly into the Detector::MlCitation model.

Developer

Ticket(s)

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

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.

The lambda has been updated to return a boolean rather
than a string when making a prediction. This means we need
to update the cassettes, and also the comparison we
perform as part of the response handling.
@mitlib mitlib temporarily deployed to tacos-api-pipeline-pr-252 June 25, 2025 16:08 Inactive
@matt-bernhardt matt-bernhardt requested a review from JPrevost June 25, 2025 17:11

if response.status == 200
JSON.parse(response.body)['response'] == 'True'
JSON.parse(response.body)['response'] == true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not requesting a change, but I'm curious if we should just have this be:

JSON.parse(response.body)['response'] now that it's a boolean.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps, although I'm leaning somewhat on whether rubocop flags something like this (which it isn't). I'm also thinking of this as a guardrail, in that the comparison will force the return into a boolean even if something else somehow gets returned.

@matt-bernhardt matt-bernhardt merged commit 6540631 into main Jun 25, 2025
7 checks passed
@matt-bernhardt matt-bernhardt deleted the integration-again branch June 25, 2025 18:40
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