Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request juju#18431 from SimonRichardson/charm-downloader-a…
…nd-store juju#18431 Infrastructure work for downloading a charm asynchronously. This supersedes the internal/charm/downloader, which will be removed once the async downloading of a charm is done. This correctly handles the downloading of a charm, checking the integrity of a file once downloaded against the source of the file, and the removal of files on errors. By doing less, we can achieve more. ---- This pull request introduces several new functionalities and improvements, including the addition of a `String` method to the `Origin` struct, new charm store functionalities, and enhancements to the charm downloader. The most important changes are summarized below: ### New functionalities and methods: * Added a `String` method to the `Origin` struct in `core/charm/origin.go` to provide a formatted string representation of the `Origin` object. ### Charm store enhancements: * Introduced the `CharmStore` struct and implemented methods for storing charms, including error handling for file not found and hash checking, in `domain/application/charm/store/store.go`. * Added unit tests for the `CharmStore` functionalities in `domain/application/charm/store/store_test.go`. * Generated mock implementations for `ObjectStore` and `ModelObjectStoreGetter` interfaces using `go:generate` in `domain/application/charm/store/store_mock_test.go`. ### Charm downloader improvements: * Added the `CharmDownloader` struct and implemented methods for downloading charms, verifying their hashes, and handling temporary files in `internal/charm/charmdownloader/downloader.go`. * Documented the purpose and functionality of the `charmdownloader` package in `internal/charm/charmdownloader/doc.go`. These changes enhance the charm store and downloader functionalities, improve error handling, and add comprehensive unit tests and documentation. ---- ## QA Steps Regression testing should be employed, all of this is just infrastructure work, broken off the juju#18398 PR. ## Jira https://warthogs.atlassian.net/browse/JUJU-7166
- Loading branch information