-
Notifications
You must be signed in to change notification settings - Fork 223
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
bug 1889156: script to load processed crashes into Elasticsearch #6609
Conversation
ecddb5a
to
ed713a7
Compare
7720a12
to
cbe3687
Compare
except Exception as exc: | ||
click.echo( | ||
f"Unable to load crash with ID {crash_id!r} from {type(crash_source).__name__!r}; error: {exc}." | ||
) | ||
continue |
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 couldn't think of any special types of exceptions that we'd want to handle differently -- are there any?
Also, please let me know if we'd like to handle exceptions in the general case differently -- right now we just log to stdout that we couldn't load it and move on.
c8132d0
to
9704c8f
Compare
Okay I've updated the PR for all your feedback except for #6609 (comment) . I'll submit a separate commit for that tomorrow, so it's easier to revert if willkg weighs in and says it's a bad idea. |
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.
e9ec174
to
85284aa
Compare
Because:
This PR:
settings.CRASH_SOURCE
) into Elasticsearch by either date (YYYY-MM-DD) or crash ID.How to test this locally
I have painstakingly added test cases for all the major scenarios, so running the tests in
socorro/tests/test_load_processed_crashes_into_es.py
(or replicating the setup before running the script with similar args) should be sufficient.The test cases conditionally skip based onSee #6609 (comment) -- this PR now runs both test cases against both cloud providers thanks to some clever pytest config.settings.CLOUD_PROVIDER
, so to test the script with GCS as the crash storage source locally, you can edit yourmy.env
so thatCLOUD_PROVIDER=GCP
and rebuild the test container (which in my case is thedevcontainer
). Just don't forget to revert that change when you're done.I can add some manual testing instructions if things aren't clear from the test. I might just add those here tomorrow.