-
Notifications
You must be signed in to change notification settings - Fork 0
Adds Suggested Resource detection based on regex patterns #207
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
Conversation
No functional changes, just a minor refactor
These are not ActiveRecord models so these don't make sense (anymore)
05b053a to
6e5075d
Compare
Why are these changes being introduced: * LIRS staff and UXWS have both noted that searching for Standards is not useful in our system Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/TCO-141 How does this address that need: * Adds a regex pattern based system that is similar to, but different than, SuggestedResources * These patterns can be used for more than just Standards, so the models were made to be more generic in name * The SuggestedPatterns will be stored in our database, which is a bit different than our other regular expression based detectors. These feel different enough to warrant this difference as we want to store additional metadata about what to display for these types of patterns when the other regex patterns use external resources to fetch data. Document any side effects to this change: * I'm not confident the naming is ideal
6e5075d to
a1f3da6
Compare
matt-bernhardt
left a comment
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.
I really like the SuggestedPattern feature as you've built it, and think it will combine nicely with SuggestedResource.
I see the tests pass, and the review app seems to respond as expected for standards requests. I have two small requests about some code comments, and a few questions to make sure I'm understanding things correctly. I don't think any of those questions are blocking, an approval, but I wanted to get your thoughts while I'm thinking about these changes.
I've tried to summarize all the line-level comments here - hopefully they're consistent.
Small requests:
- I think we need a comment block on the
log_summarymethod - There's a reference to
SuggestedResourcesthat I think should be updated toSuggestedPatternin a comment block
Questions:
- I'm unable to get a response from the staging app for SuggestedResource records now, like 'hours'. I may not be populating these records correctly, however. Could you take a look at this?
- I'm wondering why we're choosing to only respond with one type of Suggested* response in the (highly unlikely) case where a term might generate a response from both a Suggested Pattern and a Suggested Resource?
- I want to confirm that
shortcodeis only used for distinguishing SuggestedPattern records among users, and not returned by the API? - Is it intentional that we aren't incorporating SuggestedPattern records in the Administrate interface?
- Does my concern about seeding a link between the SuggestedPattern detector and the Transactional category make sense? I'm not opposed to it for now while we don't have any other records, but would prefer we back off from this link if we do end up getting non-transactional patterns down the road.
- We're dropping the use of a
.map()call in the graphql detectors_type, and I want to make sure this is intentional.
Comments:
- You mentioned not being happy about naming, and I agree when it comes to field names in SuggestedPattern. I'm not sure I can come up with better, however.
We need to allow categorization for each pattern independently, and not for all patterns like this was doing.
|
@matt-bernhardt I believe I've addressed your requested changes. Can you please take another look? Thanks |
matt-bernhardt
left a comment
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 answering my questions, and addressing the concerns where they made sense to you. This looks good, and should be a solid feature for the application. Thanks!
![]()
Note: bento staging is connected this the Heroku build associated with this PR if you'd like to see how this works with our existing Suggested Resources intervention.
Why are these changes being introduced:
not useful in our system
Relevant ticket(s):
How does this address that need:
than, SuggestedResources
were made to be more generic in name
different than our other regular expression based detectors. These
feel different enough to warrant this difference as we want to store
additional metadata about what to display for these types of patterns
when the other regex patterns use external resources to fetch data.
Document any side effects to this change:
Developer
Ticket(s)
https://mitlibraries.atlassian.net/browse/TCO-###
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
YES migrations are included
Reviewer
Code
added technical debt.
Documentation
(not just this pull request message).
Testing