Fix and improve crash diagnostics
Summary
This release fixes and adds new features to service crash diagnostics, making it much easier to locally reconstruct errors in a service. This especially true if it has children - crash diagnostics now include a child emulator for every question asked to a child by the service before it failed.
Contents (#541)
IMPORTANT: There are 3 breaking changes.
New features
- Add ability to load crash diagnostics data as a test fixture
- Record messages from each of a service's children when it crashes
Enhancements
- 💥 BREAKING CHANGE: Avoid downloading datasets by default in
get-crash-diagnostics
- 💥 BREAKING CHANGE: Save recorded messages to attribute instead of file
- Log a warning if trying to download files from empty directory
- Add
Serialisable.from_file
method - Add
Manifest.update_dataset_paths
method - Add representation for
Runner
- Avoid uploading null strings when values or manifests not present
- Add option to include
.octue
files when instantiating datasets - Add ability to filter the files downloaded in
GoogleCloudStorageClient.download_all_files
Fixes
- Save original unmutated input and configuration data for crash diagnostics
- Update manifests with local paths if datasets downloaded locally
- Ensure crash diagnostics upload works without manifests
- Ensure empty values or manifests are uploaded for crash diagnostics
- Fix splitting bucket name from signed cloud storage URLs
Refactoring
- 💥 BREAKING CHANGE: Rename
filename
parameter topath
inSerialisable.to_file
- Factor out child instantiation in
Runner
into a method - Move
AnalysisLogHandlerSwitcher
intolog_handlers
module - Move
AppFrom
into newapp_loading
module - Remove unused
Service._sent_messages
attribute - Rename
recorded_messages
attributes toreceived_messages
properties - Factor out manifest/dataset and values uploading for crash diagnostics
- Reduce nesting in
Dataset._instantiate_from_cloud
- Factor out app loading and running in
Runner
Dependencies
- Update
poetry.lock
to avoid usage of insecurepy
package bypytest
Testing
- Make testing downloading crash diagnostics more efficient
- Test crash diagnostics with service that has its own children
- Use test fixture to speed up
octue get-crash-diagnostics
tests - Test that dataset/file metadata is uploaded with crash diagnostics
- Test metadata is preserved with
octue get-crash-diagnostics
Other
- Clarify service troubleshooting doc
Upgrade instructions
💥 Avoid downloading datasets by default in `get-crash-diagnostics`
To keep the previous behaviour, add the --download-datasets
flag when using the octue get-crash-diagnostics
CLI command
💥 Save recorded messages to attribute instead of file
Instead of using the record_messages_to
parameter, set the record_messages
parameter to True
when using Child.ask
or Service.wait_for_answer
. Retrieve messages from the received_messages
property of either class instance.
💥 Rename filename parameter to path in Serialisable.to_file
If using the positional argument filename
in the to_file
method of an instance of a Serialisable
mixed-in class as a keyword argument, replace it with path
.