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

reinstate help text, version #648

Closed
dominictarr opened this issue Mar 13, 2019 · 11 comments
Closed

reinstate help text, version #648

dominictarr opened this issue Mar 13, 2019 · 11 comments

Comments

@dominictarr
Copy link
Contributor

dominictarr commented Mar 13, 2019

when we refactored everything, we (I mean I) removed help because sbot was managing it centrally and now it needs to be for each plugin.

#634
#647

but we should put that back...

@dominictarr
Copy link
Contributor Author

@frankiebee found unexpected results for sbot version - it returned ssb-db's version not ssb-server's.
since ssb-server is moving to a distribution model i think version should really give the versions of all the plugins.

I realize that causes complications with: ssbc/secret-stack#36 (multiple versions in one .use(...) but maybe that is something we can fix? what do you think @staltz ?

Also, secret-stack actually allows a plugin without a name... it just becomes "core" so the methods provided by ssb-db such as createLogStream really maybe should be sbot db.createLogStream. Of course, changing that would break everything now (including legacy replication) but well, what we have currently isn't very good. Maybe we can move everything to db... but have a way to alias back to the old pattern.

@staltz
Copy link
Member

staltz commented Mar 14, 2019

@dominictarr Why would compound plugins in secret-stack affect this? .use(AB) is similar to .use(A) followed by .use(B), so it is still possible to call server.A.version and server.B.version.

@dominictarr
Copy link
Contributor Author

@staltz the problem is that it if you did use(A) but really it was use([A,B,C]) and you do versions and get A,B,C you are gonna be confused... it's a leaky abstraction. (maybe we should just accept that though?) or should those versions be represented some way?

Oh, maybe when you load a bundle, each plugin should get a "parent" which points back to the bundle it came from. then the output can at least tell you what bundle it came in?

@staltz
Copy link
Member

staltz commented Mar 18, 2019

@dominictarr I'm still trying to understand, you think compound plugins need versions too?

@dominictarr
Copy link
Contributor Author

@staltz yes I do. for example, ssb-server now doesn't do anything by it self - it's just a distribution of other things I guess it could be the thing which has the version? but I think knowing the version of each plugin would be very useful, and if something came with other things, I think that should be explicit too.

@staltz
Copy link
Member

staltz commented Mar 19, 2019

Ok, I think I understand.

One way to implement this is by changing secret-stack's support for arrays, and instead use an object {bundle: true, plugins: [A, B]} and instead of doing a Array.isArray check, we do if (plugin.bundle) check. I think no one is using array plugins yet, since we didn't release a new secret-stack version with that support, so I'm happy to do this "breaking change".

@jedahan
Copy link

jedahan commented Mar 19, 2019

It looks like the main (only?) difference between use([A, B]) and use(A).use(B) is making clear the intention that there is coupling between [A,B] in the former case, which seems good for helping understand what needs what. If that is the case, is there a way to support {name: 'whatever'} or {bundleName: 'someGroupOfPlugins'}, which would allow for version checking of both the bundle, or the individual plugins? (via server.someGroupOfPlugins.version and server.A.version). If I am missing context, feel free to lmk and I'll be quiet.

@dominictarr
Copy link
Contributor Author

@jedahan yeah, I think some sort of pointer back to the bundle that loaded it would be enough to resolve any ambiguity. then you could do an output like

>sbot versions
{
  server: {
    gossip: v1, replicate: v2, ebt: v3, friends: v3, ...
  },
  oneOffPlugin: v4,
  anotherBundle: {
    ...
  }
}

imagine the vN is replaced with semver strings though...

@dominictarr
Copy link
Contributor Author

I'm testing gitlo (github/trello integration) sorry everyone

@stale
Copy link

stale bot commented Jun 20, 2019

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@stale stale bot added the stale label Jun 20, 2019
@stale stale bot closed this as completed Jul 20, 2019
@gmarcos87
Copy link

gmarcos87 commented Jan 21, 2020

Stale's robot closed this pull-request but in the documentation (ssb-db Readme.md) mentions it as something possible to be merged.

If it's definitely closed we can remove the mention in the Readme, otherwise it should open again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants