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.
<!--- SKIP AUTOGENERATED NOTES --->
Contents ([541](https://github.com/octue/octue-sdk-python/pull/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 to `path` in `Serialisable.to_file`
- Factor out child instantiation in `Runner` into a method
- Move `AnalysisLogHandlerSwitcher` into `log_handlers` module
- Move `AppFrom` into new `app_loading` module
- Remove unused `Service._sent_messages` attribute
- Rename `recorded_messages` attributes to `received_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 [insecure `py` package](https://github.com/octue/octue-sdk-python/security/dependabot/11) by `pytest`
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
<details>
<summary>💥 <b>Avoid downloading datasets by default in `get-crash-diagnostics`</b></summary>
To keep the previous behaviour, add the `--download-datasets` flag when using the `octue get-crash-diagnostics` CLI command
</details>
<details>
<summary>💥 <b>Save recorded messages to attribute instead of file</b></summary>
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.
</details>
<details>
<summary>💥 <b>Rename filename parameter to path in Serialisable.to_file</b></summary>
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`.
</details>
<!--- END AUTOGENERATED NOTES --->