-
Notifications
You must be signed in to change notification settings - Fork 0
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
Introduce ADR for fingerprinting #145
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why these changes are being introduced: We currently use fingerprinting for suggested resources. We are planning to expand this functionality to terms to support clustering, and we also need to refactor suggested resource fingerprinting to accommodate multiple phrases/fingerprints per suggested resource. This felt like a good opportunity to reevaluate our fingerprinting implementation. Relevant ticket(s): * [TCO-74](https://mitlibraries.atlassian.net/browse/TCO-74) * [Add automatic fingerprinting for Term records (unticketed -- link to PR)](#138) How this addresses that need: This ADR proposes that we add a central `Fingerprint` model, linked to `Terms`, which is leveraged by `SuggestedResource` and any other detectors that require fingerprinting. EngX had discussed this as a possible approach in a recent meeting. Consensus on this ADR would confirm the decision. Side effects of this change: See ADR for details.
JPrevost
approved these changes
Nov 26, 2024
matt-bernhardt
approved these changes
Dec 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience while I think this through. I agree with this decision; I don't have a meaningful addition to the options, and the only other contributions I've come up with in reading this have felt more nits than substance.
jazairi
added a commit
that referenced
this pull request
Feb 10, 2025
Why these changes are being introduced: We [recently decided](#145) to make a separate Fingerprint model, associated with Term, as multiple detectors are likely to use fringerprinting (implemented in #138). We have also begun to split the ActiveRecord components of detectors into separate models (implemented for Detector::Journal in #162). Relevant ticket(s): * [TCO-111](https://mitlibraries.atlassian.net/browse/TCO-111) * [TCO-122](https://mitlibraries.atlassian.net/browse/TCO-122) How this addresses that need: * Splits the ActiveRecord components of Detector::SuggestedResource into a separate SuggestedResource model. * Associates SuggestedResource with Fingerprint, via Term, such that a suggested resource can have multiple terms and fingerprints. * Removes the suggested resource dashboard (see side effects). Side effects of this change: * Terms that are associated with a suggested resource should not be destroyed. Rails does not allow the `:dependent` option on `belongs_to` associations, so this commit instead adds a `before_destroy` hook with a custom method that aborts the callback and logs the attempt in Sentry. * Because administrate does not handle has_many relationships well, we will need to build a custom dashboard to manage suggested resources. This is ticketed as [TCO-145](https://mitlibraries.atlassian.net/browse/TCO-145). Until that UI is ready, we will use the Rails console to make any requested changes to suggested resources.
jazairi
added a commit
that referenced
this pull request
Feb 10, 2025
Why these changes are being introduced: We [recently decided](#145) to make a separate Fingerprint model, associated with Term, as multiple detectors are likely to use fringerprinting (implemented in #138). We have also begun to split the ActiveRecord components of detectors into separate models (implemented for Detector::Journal in #162). Relevant ticket(s): * [TCO-111](https://mitlibraries.atlassian.net/browse/TCO-111) * [TCO-122](https://mitlibraries.atlassian.net/browse/TCO-122) How this addresses that need: * Splits the ActiveRecord components of Detector::SuggestedResource into a separate SuggestedResource model. * Associates SuggestedResource with Fingerprint, via Term, such that a suggested resource can have multiple terms and fingerprints. * Removes the suggested resource dashboard (see side effects). Side effects of this change: * Terms that are associated with a suggested resource should not be destroyed. Rails does not allow the `:dependent` option on `belongs_to` associations, so this commit instead adds a `before_destroy` hook with a custom method that aborts the callback and logs the attempt in Sentry. * Because administrate does not handle has_many relationships well, we will need to build a custom dashboard to manage suggested resources. This is ticketed as [TCO-145](https://mitlibraries.atlassian.net/browse/TCO-145). Until that UI is ready, we will use the Rails console to make any requested changes to suggested resources.
jazairi
added a commit
that referenced
this pull request
Feb 14, 2025
Why these changes are being introduced: We [recently decided](#145) to make a separate Fingerprint model, associated with Term, as multiple detectors are likely to use fringerprinting (implemented in #138). We have also begun to split the ActiveRecord components of detectors into separate models (implemented for Detector::Journal in #162). Relevant ticket(s): * [TCO-111](https://mitlibraries.atlassian.net/browse/TCO-111) * [TCO-122](https://mitlibraries.atlassian.net/browse/TCO-122) How this addresses that need: * Splits the ActiveRecord components of Detector::SuggestedResource into a separate SuggestedResource model. * Associates SuggestedResource with Fingerprint, via Term, such that a suggested resource can have multiple terms and fingerprints. * Removes the suggested resource dashboard (see side effects). Side effects of this change: * Config has been adjusted to allow for development logging. This was lost in the most recent Rails upgrade. * Terms that are associated with a suggested resource should not be destroyed. Rails does not allow the `:dependent` option on `belongs_to` associations, so this commit instead adds a `before_destroy` hook with a custom method that aborts the callback and logs the attempt in Sentry. * Because administrate does not handle has_many relationships well, we will need to build a custom dashboard to manage suggested resources. This is ticketed as [TCO-145](https://mitlibraries.atlassian.net/browse/TCO-145). Until that UI is ready, we will use the Rails console to make any requested changes to suggested resources.
jazairi
added a commit
that referenced
this pull request
Feb 14, 2025
Why these changes are being introduced: We [recently decided](#145) to make a separate Fingerprint model, associated with Term, as multiple detectors are likely to use fringerprinting (implemented in #138). We have also begun to split the ActiveRecord components of detectors into separate models (implemented for Detector::Journal in #162). Relevant ticket(s): * [TCO-111](https://mitlibraries.atlassian.net/browse/TCO-111) * [TCO-122](https://mitlibraries.atlassian.net/browse/TCO-122) How this addresses that need: * Splits the ActiveRecord components of Detector::SuggestedResource into a separate SuggestedResource model. * Associates SuggestedResource with Fingerprint, via Term, such that a suggested resource can have multiple terms and fingerprints. * Removes the suggested resource dashboard (see side effects). Side effects of this change: * Config has been adjusted to allow for development logging. This was lost in the most recent Rails upgrade. * Terms that are associated with a suggested resource should not be destroyed. Rails does not allow the `:dependent` option on `belongs_to` associations, so this commit instead adds a `before_destroy` hook with a custom method that aborts the callback and logs the attempt in Sentry. * Because administrate does not handle has_many relationships well, we will need to build a custom dashboard to manage suggested resources. This is ticketed as [TCO-145](https://mitlibraries.atlassian.net/browse/TCO-145). Until that UI is ready, we will use the Rails console to make any requested changes to suggested resources. co-authored-by: Jeremy Prevost <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview of changes
Why these changes are being introduced:
We currently use fingerprinting for suggested resources. We are planning to expand this functionality to terms to support clustering, and we also need to refactor suggested resource fingerprinting to accommodate multiple phrases/fingerprints per suggested resource. This felt like a good opportunity to reevaluate our fingerprinting implementation.
Relevant ticket(s):
How this addresses that need:
This ADR proposes that we add a central
Fingerprint
model, linked toTerms
, which is leveraged bySuggestedResource
and any other detectors that require fingerprinting.EngX had discussed this as a possible approach in a recent meeting. Consensus on this ADR would confirm the decision.
Side effects of this change:
See ADR for details.
Developer
Ticket(s)
See above.
Accessibility
all issues introduced by these changes have been resolved or opened
as new issues (link to those issues in the Pull Request details above)
Documentation
ENV
Stakeholders
Dependencies and migrations
NO dependencies are updated
NO migrations are included
Reviewer
Code
added technical debt.
Documentation
(not just this pull request message).
Testing