-
Notifications
You must be signed in to change notification settings - Fork 16
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
[Issue #1543] Update opportunity factories to use more varied data #1601
Conversation
# Ideally use agencies here that actually exist so anyone | ||
# using data generated by this for front-end dev actually | ||
# has valid values | ||
AGENCIES = ["USAID", "ARPAH", "DOC", "DOC-EDA"] |
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.
@rylew1 / @andycochran - FYI updating the factories so that we don't generate the US-ABC
agencies anymore. Should align with actual values
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 - looks like this matches some of the choices we already have on the agency filter. 🚀
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.
Longer term nits since already approved this pr:
- Would you eventually pull all the actual values or define a type or enum?
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'm not sure how we'll manage Agency long-term in the API. But when the front-end has more agencies in its list, we can add a bunch more here uneventfully regardless of approach.
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.
Looks good! 🚀
Summary
Fixes #1543
Time to review: 5 mins
Changes proposed
Updated our factories to generate more varied data in several important fields
Updated the relationship setup for the link tables to make usage of them simpler
Context for reviewers
The additional info section shows some example data generated before & after this change to help showcase it.
While some of our data was pretty varied before, there were a lot of key fields that just looked too static whenever we demoed it. For example, previously every single opportunity title was
Research into <job> industry
which made the example search results look off. This approach adds quite a bit more variety and sets us up to easily add even more if desired.This is mostly done by creating a new faker "Provider" in which I implemented several of our fields as functions. These functions can do the following:
With this approach, we can add a lot more variety with minimal additional effort.
Additional information