-
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
Remove opportunities connected to test agencies from search results #3204
Comments
github-project-automation
bot
moved this to Icebox
in Simpler.Grants.gov Product Backlog
Dec 12, 2024
chouinar
added a commit
that referenced
this issue
Dec 16, 2024
chouinar
added a commit
that referenced
this issue
Dec 16, 2024
…arch results (#3234) ## Summary Fixes #3204 ### Time to review: __5 mins__ ## Changes proposed If an opportunity is connected to a test agency, do not load it into the search index Fixed a bug with how incremental updates/deletes worked that was deleting everything if it wasn't in an update ## Context for reviewers Certain agencies are marked as test agencies, and will be excluded from appearing in the left-hand navigation already. However, that doesn't stop you from finding them in search results by other means. Even though the number of test records appearing in search is small (5 at the time of writing), we'll be cautious and just filter them all out, which lets us potentially do more in the future as well. We also handle deleting anything that already exists in the incremental job - that likely won't matter in most cases, but if an agency is ever marked as a test that wasn't previously, we'll handle that. ## Additional information In prod, there are only 5 opportunities this will actually filter out right now, some subagencies aren't included in the list yet, but we'll deal with that separately: https://simpler.grants.gov/search?agency=GDIT,IVV,IVPDF,0001,FGLT,NGMS,NGMS-Sub1,SECSCAN&status=forecasted,posted,archived,closed
github-project-automation
bot
moved this from In Progress
to Done
in Simpler.Grants.gov Product Backlog
Dec 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
When we load opportunities to the search index into our search index, if the agency attached to the opportunity is a test agency, do not write it to the search index.
There is an agency object connected to an opportunity through a relationship, if the
is_test_agency
value is True, don't load it. If there is no agency (unlikely, but possible) we should load it.Technical notes:
.options(selectinload(Opportunity.agency_record).selectinload(Agency.top_level_agency))
to the queries to better fetch the agency when querying, see: https://github.com/HHS/simpler-grants-gov/blob/main/api/src/services/opportunities_v1/get_opportunity.py#L22 where we do this / why.Acceptance criteria
The text was updated successfully, but these errors were encountered: