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
jujubot
merged 5 commits into
juju:2.9
from
arnodel:juju-819-remove-connection-client-method
Mar 25, 2022
Merged
[JUJU-819] Remove Client() method of api.Connection interface #13878
jujubot
merged 5 commits into
juju:2.9
from
arnodel:juju-819-remove-connection-client-method
Mar 25, 2022
Conversation
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
arnodel
changed the title
Remove Client() method of api.Connection interface
[JUJU-819] Remove Client() method of api.Connection interface
Mar 24, 2022
SimonRichardson
approved these changes
Mar 24, 2022
There was a problem hiding this 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.
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
api.Connection
interface has aClient
method returning an*api.Client
for the connection. There is a comment above it indicating that this should not be part of theConnection
interface.This PR replaces the method with a function
api.NewClient(Connection) *api.Client
. A consequence of this is that theapi.Client
type is decoupled fromapi.state
as it is only interacts with theConnection
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).