providers: refactor `capture_logs_from_instance()`
Metadata
Current evaluation
Merged into main following approval and passing CI. Refactored capture_logs_from_instance() to use craft-providers temporarily_pull_file() and moved it to providers.py, trimming 28 lines and increasing coverage by 0.09%.
Suggested action: —
No scores available.
Issue body
- [X] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [X] Have you successfully run `make lint`?
- [X] Have you successfully run `pytest tests/unit`?
-----
Refactor `capture_logs_from_instance()`:
- Use new `craft-providers` call `temporarily_pull_file()`
- Move method to `snapcraft/providers/providers.py`
Similar to [rockcraft](https://github.com/canonical/rockcraft/pull/77)
(CRAFT-1307)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged into main following approval and passing CI. Refactored capture_logs_from_instance() to use craft-providers temporarily_pull_file() and moved it to providers.py, trimming 28 lines and increasing coverage by 0.09%. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into main. Refactored capture_logs_from_instance() to use craft-providers temporarily_pull_file() and relocated it to snapcraft/providers/providers.py. Increased test coverage by 0.09%. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged refactoring of capture_logs_from_instance() to utilize craft-providers temporarily_pull_file() and relocate the method to snapcraft/providers/providers.py. Successfully integrated, increasing code coverage by 0.09%. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #77 providers: capture logs from instance | rockcraft | merged | Merged a refactor moving capture_logs_from_instance() to rockcraft/providers/providers.py and updating it to use craft-providers temporarily_pull_file(). Approved, resolving CRAFT-1351 with a 63-line reduction across six files. | |
| #893 (internal) Refactor capture_logs_from_instance to use new interface (CRAFT-1306). | charmcraft | merged | Merged refactoring of capture_logs_from_instance to use a new interface per CRAFT-1306. Approved by one reviewer with no unresolved comments. The update modifies seven files, reducing 133 lines and adding 59. | |
| #3926 providers: move `get_instance_name()` to providers.py | snapcraft | merged | Merged. Moved get_instance_name() to snapcraft/providers/providers.py, removing snapcraft-specific logic from provider modules. This refactoring prepares the codebase for the new craft-providers API. Approved by reviewers and passed all CI checks. | |
| #92 providers: refactor get_provider() | rockcraft | merged | Merged after approval and passing CI. Refactored and moved get_provider() from _get_provider.py to providers.py across seven files, reducing code by 25 lines. Resolves CRAFT-1375. | |
| #12 providers: retrieve data from instance log file (CRAFT-589) | rockcraft | merged | Merged implementation to retrieve instance log data upon provider execution completion and append it to external logs. Uses craft-cli predictable naming and sets library logs to debug level. Approved, rebased on main, and merged. |