Skip to content

Conversation

@jazairi
Copy link
Contributor

@jazairi jazairi commented Sep 9, 2024

Why these changes are being introduced:

We've replaced the Hints system built into Bento with the Suggested Resources detector, provided by TACOS API. Since Bento is already logging search terms to TACOS in production, it makes sense to switch to using Suggested Resources.

Relevant ticket(s):

How this addresses that need:

This removes the Hint feature and replaces it with Suggested Resources. We are currently triggering Suggested Resources in the same way as Hints (and the other controllers), but it might make sense to refactor this feature using a tool like Stimulus or Turbo. I've opened (ENGX-283)[https://mitlibraries.atlassian.net/browse/ENGX-283] to track further work on this.

While discussing this feature, we realized that GraphQL returns an array for suggestedResources even though that detector will only return a single resource. We are handling this in Bento by just calling first on the array, but we should reconsider whether the GraphQL type is returning the correct data structure. The spike ticket TCO-84 will further explore this problem space.

Side effects of this change:

  • As far as I can tell, we don't really have a notion of hint source anymore, so I haven't tried to replicate the helper methods. This seems most pertinent to HintHelper#data_type, which professes to allow analytics tools to distinguish between hint sources. (It's unclear if this is still used by Matomo.) It also affects the display type, of which we have two for Hints, but that doesn't seem like a significant change.
  • Debug and ClimateControl have been added to the Gemfile. The former is what we should be using to debug instead of Pry, and the latter was needed to test various ENV conditions.

Developer

  • All new ENV is documented in README
  • All new ENV has been added to Heroku Pipeline, Staging and Prod (Added to staging and prod)
  • 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)
  • Stakeholder approval has been confirmed (or is not needed)

Code Reviewer

  • The commit message is clear and follows our guidelines
    (not just this pull request message)
  • There are appropriate tests covering any new functionality
  • The documentation has been updated or is unnecessary
  • The changes have been verified
  • New dependencies are appropriate or there were no changes

Requires database migrations?

NO

Includes new or updated dependencies?

YES

@coveralls
Copy link

coveralls commented Sep 9, 2024

Coverage Status

coverage: 99.123% (-0.09%) from 99.216%
when pulling 5464e64 on tco-66-hints-to-tacos
into 29fd71f on main.

@mitlib mitlib temporarily deployed to mit-bento-pr-1351 September 9, 2024 21:59 Inactive
@jazairi jazairi force-pushed the tco-66-hints-to-tacos branch from 7f555e7 to 17d8929 Compare October 4, 2024 16:18
@jazairi jazairi temporarily deployed to mit-bento-pr-1351 October 4, 2024 16:18 Inactive
@jazairi jazairi force-pushed the tco-66-hints-to-tacos branch from 17d8929 to c864607 Compare October 4, 2024 16:19
@jazairi jazairi temporarily deployed to mit-bento-pr-1351 October 4, 2024 16:20 Inactive
@jazairi jazairi force-pushed the tco-66-hints-to-tacos branch from c864607 to c9762f4 Compare October 4, 2024 16:21
@jazairi jazairi force-pushed the tco-66-hints-to-tacos branch from c9762f4 to 79acb01 Compare October 4, 2024 16:23
Why these changes are being introduced:

We've replaced the Hints system built into Bento with the
Suggested Resources detector, provided by TACOS API. Since Bento is
already logging search terms to TACOS in production, it makes
sense to switch to using Suggested Resources.

Relevant ticket(s):

* [TCO-66](https://mitlibraries.atlassian.net/browse/TCO-66)

How this addresses that need:

This removes the Hint feature and replaces it with Suggested
Resources. We are currently triggering Suggested Resources in
the same way as Hints (and the other controllers), but it might
make sense to refactor this feature using a tool like Stimulus or
Turbo. I've opened (ENGX-283)[https://mitlibraries.atlassian.net/browse/ENGX-283]
to track further work on this.

While discussing this feature, we realized that GraphQL returns
an array for `suggestedResources` even though that detector will
only return a single resource. We are handling this in Bento by
just calling `first` on the array, but we should reconsider whether
the GraphQL type is returning the correct data structure. The spike
ticket [TCO-66](https://mitlibraries.atlassian.net/browse/TCO-66)
will further explore this problem space.

Side effects of this change:

Debug and ClimateControl have been added to the Gemfile. The
former is what we should be using to debug instead of Pry, and
the latter was needed to test various ENV conditions.

Co-authored-by: Jeremy Prevost <JPrevost@users.noreply.github.com>
@jazairi jazairi force-pushed the tco-66-hints-to-tacos branch from 79acb01 to 5464e64 Compare October 4, 2024 16:27
@jazairi jazairi temporarily deployed to mit-bento-pr-1351 October 4, 2024 16:27 Inactive
@jazairi
Copy link
Contributor Author

jazairi commented Oct 4, 2024

Merging without review since two engineers have worked on this, as discussed during our demo/retro this morning.

@jazairi jazairi merged commit 7ea90d3 into main Oct 4, 2024
2 of 4 checks passed
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.

5 participants