Splitting out state/api into its own repo
John Meinel
john at arbash-meinel.com
Fri Jun 27 09:24:35 UTC 2014
So 'params' lives in 'api' because both client code and server side code
uses it (api.Client exposes params for many of its methods, I believe).
That may be a signal of a different problem, but there is a fair amount of
code (eg worker) that makes use of api/params, and it makes more sense to
have that in 'api' than in 'apiserver'.
Now it might be that we have a clearer indication we're doing something
wrong, but certainly what *worker* code sees needs to be in api.
Certainly almost all of those objects acts as in and out side of the api,
though I would be reasonably ok if that meant they were in apiserver.
I'm less happy for things that are exposed outside of api to be in
apiserver.
On Fri, Jun 27, 2014 at 1:05 PM, William Reade <william.reade at canonical.com>
wrote:
> I think one of the biggest problems is the naming: state/api is a hackish
> and minimal api client implementation, while state/apiserver is where the
> actual api is defined... except the params package, which for some reason
> lives under state/api.
>
> I think the most important actions are:
>
> * move state/api/params under state/apiserver
> * move state/apiserver to the top level, and make sure it's clearly
> documented
>
> Then I'd be keen to separate the internal api client code from the
> external one; and at that point I'd be happy to move the external api
> client code into its own repo. There's no disadvantage to having that code
> external, because we can't afford to break our external api clients
> regardless; for the internal ones we have more power and control, because
> we're the only ones who have to deal with the impact of change.
>
Just to be clear, I've used the term "agent" vs "user" or "client" here. I
believe you're distinguishing the client-side of Agent facades (as internal
clients) vs the client-side of User facades (like Client, KeyManager, etc).
We also have the top level "juju/api.go" which is actually our entry point
(where juju.NewAPIClientFromName et al exist).
I would certainly be happy to see those things consolidated.
> (This would then involve separating the protocol-level code out somewhere
> *else*, so that we could reuse it both internally and externally; and we'd
> probably want both the server and client protocol parts together; but I
> think that the point where we can reasonably move a package outside the
> main repo is some way away regardless, so I'm not keen to focus on it at
> the moment.)
>
> Cheers
> William
>
When you say protocol level, do you mean the "rpc" package, or are you
talking more about the actual definitions of the API (what methods are on
Client, etc.)
John
=:->
>
>
>
> On Fri, Jun 27, 2014 at 10:01 AM, roger peppe <roger.peppe at canonical.com>
> wrote:
>
>> On 27 June 2014 07:51, David Cheney <david.cheney at canonical.com> wrote:
>> > On Fri, Jun 27, 2014 at 4:21 PM, John Meinel <john at arbash-meinel.com>
>> wrote:
>> >> Just my quick thought, I think moving it out from "state/api" into
>> just a
>> >> top level "api" would be reasonable and a lot less clumsy than trying
>> to
>> >> pull it out into an entirely separate repository.
>> >
>> > +1
>> >
>> > I don't think the api package is useful outside Juju (at this time)
>> > and splitting it into another repo just doubles the amount of work.
>>
>> Do you mean that the API package isn't useful *from* outside Juju,
>> or that the API package isn't useful *independently of* Juju?
>>
>> If the latter, I totally agree (the whole point is that it integrates
>> with Juju)
>> but if the former, I disagree. If we are to allow any external Go programs
>> that use Juju (and I think we should - we should act as good citizens
>> in the Go ecosystem) then the API package is the only way to do it.
>> We shouldn't force people to write their own API interface just because
>> we're not prepared to support our own.
>>
>> BTW, I think it would be a good idea to split off the agent parts of the
>> API
>> from the client parts - the former should not be considered public.
>>
>> --
>> Juju-dev mailing list
>> Juju-dev at lists.ubuntu.com
>> Modify settings or unsubscribe at:
>> https://lists.ubuntu.com/mailman/listinfo/juju-dev
>>
>
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20140627/d1a74b2e/attachment.html>
More information about the Juju-dev
mailing list