Closed slimsag closed 8 years ago
Dang, sorry for wasting your time here @beyang. This approach won't work for implementing the optional interfaces.
It appears that only the last wrapped one is actually implemented, it doesn't carry through in the embedded e.g. fileSystem
vcs.Repository
field like I naively thought it did.
Confirmed with http://play.golang.org/p/PbFdH6v_Ph -- I'm going to have to think up a different approach to wrapping all these optional interfaces.
EDIT: I see others have run into this problem too
@beyang I'm not very happy about how it looks, but this implementation will work.
Our only other options would be to pass a context.Context
around in all of the backends and duplicate the tracing code across every backend. Either way we're looking at a lot of code dup (here or there), and I think this is the best of two evils.
Let me know what you think.
kind bump
LGTM, sorry about the delay
This change adds a utility package which records VCS operations to an
*appdash.Recorder
by wrapping avcs.Repository
value. It implements the optional interface types that avcs.Repository
implementation may opt-in to, so no functionality is lost. Because it works at the interface level we can trace all different backends (gitcmd
,git
,hg
, etc) without writing new tracing code.In Appdash, all events are prefixed with
vcs.Type
for easier filtering: