-
Notifications
You must be signed in to change notification settings - Fork 0
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#18422 from SimonRichardson/refactor-applicati…
…on-domain juju#18422 Now that we have the resources, the application domain was getting really hard to construct. The solution was to remove all namespaces and just have a State and a Service, which can be constructed. This has worked well for all the other domains. We can come back to this and split it up if we find pieces that can be broken off. This is work towards the charm async downloader, as I wanted to add one extra dependency and it just got larger and larger. In the future, we'll remove `modelUUID` and the model agent state from the constructor, so there will be even less. If adding more to the constructor, it's better to consider grouping similar things into a type `CharmDependencies` or `CharmServiceConfig`. ----- This pull request includes several changes focused on improving the model migration process and simplifying the service structure in the Juju codebase. The most important changes include removing unused imports, refactoring service initialization, and updating the model migration export and import operations to use new service structures. ### Codebase Simplification: * Removed unused imports in multiple files, including `cleaner_test.go`, `export.go`, `import.go`, `application_test.go`, and `charm.go`. [[1]](diffhunk://#diff-48fb36787e1c279e1ba1ff38ed9cc5ae49a36ed40b0dd0cc22544258983ba410L21-L28) [[2]](diffhunk://#diff-ccbcc810b4f9ffaceaabc9ec2ed3eadb96e4e243df8381cddcd6b3c0dfb3aeb1R11-R35) [[3]](diffhunk://#diff-7961d740899680f58e70493a1801eb5c86cf80e665b8615b876d22e0dd14b7faR12) [[4]](diffhunk://#diff-54808e512b799a9eb1000c96054f7135a8a0fa435bcd7ab6e36f8ee6ade75922L10-L12) [[5]](diffhunk://#diff-f634e196c8c372b1bc36ad4d6db384d26713e39a92b90c981816480a2d1e91d6L15) * Refactored the initialization of `WatchableService` in `cleaner_test.go` to use a simpler structure. * Removed the `NoopDeleteSecretState` and updated the `exportOperation` and `importOperation` to use the new `MigrationService` structure in `export.go` and `import.go`. [[1]](diffhunk://#diff-ccbcc810b4f9ffaceaabc9ec2ed3eadb96e4e243df8381cddcd6b3c0dfb3aeb1L51-R64) [[2]](diffhunk://#diff-ccbcc810b4f9ffaceaabc9ec2ed3eadb96e4e243df8381cddcd6b3c0dfb3aeb1L76-R78) [[3]](diffhunk://#diff-7961d740899680f58e70493a1801eb5c86cf80e665b8615b876d22e0dd14b7faL49-R58) [[4]](diffhunk://#diff-7961d740899680f58e70493a1801eb5c86cf80e665b8615b876d22e0dd14b7faL74-R83) * Simplified the `application_test.go` by removing redundant test setups and mocks. [[1]](diffhunk://#diff-54808e512b799a9eb1000c96054f7135a8a0fa435bcd7ab6e36f8ee6ade75922L1117-R1024) [[2]](diffhunk://#diff-54808e512b799a9eb1000c96054f7135a8a0fa435bcd7ab6e36f8ee6ade75922L1175-R1044) [[3]](diffhunk://#diff-54808e512b799a9eb1000c96054f7135a8a0fa435bcd7ab6e36f8ee6ade75922L1194-L1210) * Merged `CharmService` into `Service` and updated methods in `charm.go` to reflect this change. [[1]](diffhunk://#diff-f634e196c8c372b1bc36ad4d6db384d26713e39a92b90c981816480a2d1e91d6L141-R146) [[2]](diffhunk://#diff-f634e196c8c372b1bc36ad4d6db384d26713e39a92b90c981816480a2d1e91d6L181-R166) [[3]](diffhunk://#diff-f634e196c8c372b1bc36ad4d6db384d26713e39a92b90c981816480a2d1e91d6L199-R184) These changes aim to streamline the code, making it easier to maintain and extend in the future. ### QA Steps ``` $ juju bootstrap lxd test $ juju add-model default $ juju deploy ubuntu ```
- Loading branch information
Showing
37 changed files
with
2,084 additions
and
2,276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.