sbt / sbt-remote-control

Create and manage sbt process using unicorns and forks
Other
74 stars 14 forks source link

add inspect and list settings requests #290

Closed havocp closed 9 years ago

jsuereth commented 9 years ago

List settings makes me nervous. It will probably hit msg size limit....

jsuereth commented 9 years ago

This looks good, but a few quick comments:

  1. MergeSettings show the final set of settings, may ignore session, but will unify duplicate settings. I think this is what we want but may warrant a discussion or api hook to access differing "life cycle" settings
  2. Grabbing all settings is huge. That request should allow some kind of filter, or we'll need a version 3 of the protocol soon
havocp commented 9 years ago

We need to bump up the max message size if we haven't. I'll do that, stay tuned.

What would the filter be i.e. how would you decide what to filter on? I was trying to minimize the size by ONLY listing the keys, not sending all the details for each key.

The simple project in the integration tests has 554 keys. 10x-ing that for a complex project, If we need 128 bytes to encode a key, then 5000 keys = 5000*128 = 625K or so I think. That should transfer quickly over a localhost socket, in theory.

havocp commented 9 years ago

oh, already did it: https://github.com/sbt/sbt-remote-control/commit/b9159211c2c8698a309da63c587b933ff0363958

jsuereth commented 9 years ago

By "sending the keys" you mean the scoped keys right? The filters would be the scope. I.e. filter the keys for project X or build Y or config Z. We had that in sbt-remote-control 0.x but I never ported it to the server rewrite.

jsuereth commented 9 years ago

It's probably good to go as is. A filter would be optional addition to the message anyway, so it won't break protocol.

havocp commented 9 years ago

We do already have "all scoped keys with a certain name" (LookupScopedKey).

Maybe we should YAGNI the filters and see what happens. For me the question is whether any clients that want to list all settings, ONLY need settings for a certain project/build/config. Or at least could use filters to lazy load (e.g. get settings for a project when you enter that project).