Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JUJU-819] Remove Client() method of api.Connection interface #13878

Merged
merged 5 commits into from Mar 25, 2022

Conversation

arnodel
Copy link
Contributor

@arnodel arnodel commented Mar 24, 2022

The api.Connection interface has a Client method returning an *api.Client for the connection. There is a comment above it indicating that this should not be part of the Connection interface.

This PR replaces the method with a function api.NewClient(Connection) *api.Client. A consequence of this is that the api.Client type is decoupled from api.state as it is only interacts with the Connection interface.

Some tests do reach into the underlying state data structure of a Client's Connection instance. In this case the Connection is coerced to a *state to make it work. This already happens elsewhere in the testing code (not a very good excuse I know).

@arnodel arnodel changed the title Remove Client() method of api.Connection interface [JUJU-819] Remove Client() method of api.Connection interface Mar 24, 2022
Copy link
Member

@SimonRichardson SimonRichardson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a massive fan of this, as this improves consistency throughout the client code base.

@arnodel
Copy link
Contributor Author

arnodel commented Mar 25, 2022

$$merge$$

@jujubot jujubot merged commit f2a3620 into juju:2.9 Mar 25, 2022
@arnodel arnodel deleted the juju-819-remove-connection-client-method branch March 25, 2022 17:34
jujubot added a commit that referenced this pull request Mar 30, 2022
#13897

- #13891 from hmlanigan/lxd-profile-watcher-regression
- #13850 from jack-w-shaw/JUJU-416_Consolidate_retries_worker_tests_1
- #13871 from arnodel/juju-810-simpleconnector-support-for-ha-controllers
- #13843 from jack-w-shaw/JUJU-416_Consolidate_retries_worker_upgradedatabase
- #13842 from jack-w-shaw/JUJU-416_Consolidate_retries_worker_peergrouper
- #13866 from arnodel/juju-803-move-connector-implementations
- #13893 from ycliuhw/allow-OfficialBuild-Build-coexist
- #13883 from barrettj12/deploy-revision-err
- #13886 from ycliuhw/Fix-Build-OfficialBuild
- #13873 from arnodel/juju-812-remove-connection-reboot-method
- #13878 from arnodel/juju-819-remove-connection-client-method
- #13875 from arnodel/juju-814-remove-connection-unitassigner-method
- #13874 from arnodel/juju-813-remove-connection-instancepoller-method
- #13885 from benhoyt/model-defaults-test-bash
- #13856 from naveensrinivasan/naveen/feat/pin-deps
- #13881 from barrettj12/refresh-local-origin2
- #13882 from benhoyt/tweak-assess
- #13834 from wallyworld/leader-settings-dying
- #13870 from wallyworld/model-default-coerce
- #13869 from arnodel/juju-806-remove-connection-uniter-method
- #13852 from hmlanigan/charm-resources-regression
- #13872 from arnodel/juju-811-remove-connection-upgrader-method
- #13863 from SimonRichardson/charmhub-proxy-middleware
- #13865 from hmlanigan/bootstrap-help-update
- #13855 from SimonRichardson/hide-debug-stack
- #13862 from wallyworld/azure-instance-refresh
- #13755 from jack-w-shaw/JUJU-422_Drop_Space.Subnets-2
- #13860 from jack-w-shaw/fix_shfmt_failure

Usual conflicts.

CONFLICT (content): Merge conflict in worker/caasunitprovisioner/worker_test.go
CONFLICT (content): Merge conflict in worker/caasoperatorprovisioner/worker_test.go
CONFLICT (content): Merge conflict in worker/caasfirewaller/worker_test.go
CONFLICT (content): Merge conflict in cmd/juju/machine/remove.go
CONFLICT (content): Merge conflict in cmd/juju/application/refresh.go
CONFLICT (content): Merge conflict in cloudconfig/podcfg/podcfg_test.go
CONFLICT (content): Merge conflict in caas/kubernetes/provider/bootstrap_test.go
CONFLICT (content): Merge conflict in apiserver/facades/client/client/client_test.go
CONFLICT (content): Merge conflict in apiserver/facades/client/charms/services/repofactory.go
CONFLICT (modify/delete): apiserver/facades/client/charmhub/charmhub.go deleted in HEAD and modified in 2.9. Version 2.9 of apiserver/facades/client/charmhub/charmhub.go left in tree.
CONFLICT (content): Merge conflict in apiserver/facades/client/application/application_test.go
CONFLICT (content): Merge conflict in api/agent/uniter/uniter.go


## QA steps

Tests pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants