Skip to content
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

Closed
1 task
chouinar opened this issue Dec 12, 2024 · 0 comments · Fixed by #3234
Closed
1 task

Remove opportunities connected to test agencies from search results #3204

chouinar opened this issue Dec 12, 2024 · 0 comments · Fixed by #3234
Assignees

Comments

@chouinar
Copy link
Collaborator

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:

Acceptance criteria

  • Both the incremental and full search load do not write test agency opportunities to the index
@chouinar chouinar moved this from Icebox to Todo in Simpler.Grants.gov Product Backlog Dec 12, 2024
@chouinar chouinar self-assigned this Dec 13, 2024
@chouinar chouinar moved this from Todo to In Progress in Simpler.Grants.gov Product Backlog Dec 13, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
1 participant