Conversation
Signed-off-by: Carlos Martín <carlos.martin.sanchez@gmail.com>
Signed-off-by: Carlos Martín <carlos.martin.sanchez@gmail.com>
Signed-off-by: Carlos Martín <carlos.martin.sanchez@gmail.com>
Signed-off-by: Carlos Martín <carlos.martin.sanchez@gmail.com>
Signed-off-by: Carlos Martín <carlos.martin.sanchez@gmail.com>
Signed-off-by: Carlos Martín <carlos.martin.sanchez@gmail.com>
Signed-off-by: Carlos Martín <carlos.martin.sanchez@gmail.com>
Signed-off-by: Carlos Martín <carlos.martin.sanchez@gmail.com>
| } | ||
|
|
||
| log.Debugf("the DB version is up to date, %v", dbVersion) | ||
| log.With(log.Fields{"db-version": dbVersion}).Debugf("the DB version is up to date") |
There was a problem hiding this comment.
line is 85 characters (lll)
If you have feedback about this comment, please, tell us.
|
|
||
| // NewClient creates new Client | ||
| func NewClient(t http.RoundTripper, cache *cache.ValidableCache, l log.Logger, watchMinInterval string) *Client { | ||
| func NewClient(t http.RoundTripper, cache *cache.ValidableCache, watchMinInterval string) *Client { |
There was a problem hiding this comment.
line is 99 characters (lll)
If you have feedback about this comment, please, tell us.
| t.rateMu.Unlock() | ||
|
|
||
| t.Log.With(logFields).Debugf("http request to %s", req.URL.Path) | ||
| ctxlog.Get(req.Context()).With(logFields).Debugf("http request to %s", req.URL.Path) |
There was a problem hiding this comment.
line is 85 characters (lll)
If you have feedback about this comment, please, tell us.
|
|
||
| w := s.newWatcher([]string{"github.com/mock/test"}) | ||
| err := w.Watch(context.TODO(), func(e lookout.Event) error { | ||
| err := w.Watch(context.TODO(), func(ctx context.Context, e lookout.Event) error { |
There was a problem hiding this comment.
line is 82 characters (lll)
If you have feedback about this comment, please, tell us.
|
|
||
| w := s.newWatcher([]string{"github.com/mock/test"}) | ||
| err := w.Watch(context.TODO(), func(e lookout.Event) error { | ||
| err := w.Watch(context.TODO(), func(ctx context.Context, e lookout.Event) error { |
There was a problem hiding this comment.
line is 82 characters (lll)
If you have feedback about this comment, please, tell us.
| // Validation of the reference name is optional. | ||
| func validateReferences(validateRefName bool, refs ...*lookout.ReferencePointer) error { | ||
| log.Infof("validating refs: %v, validateRefName: %v", refs, validateRefName) | ||
| func validateReferences(ctx context.Context, validateRefName bool, refs ...*lookout.ReferencePointer) error { |
There was a problem hiding this comment.
line is 109 characters (lll)
If you have feedback about this comment, please, tell us.
| func validateReferences(validateRefName bool, refs ...*lookout.ReferencePointer) error { | ||
| log.Infof("validating refs: %v, validateRefName: %v", refs, validateRefName) | ||
| func validateReferences(ctx context.Context, validateRefName bool, refs ...*lookout.ReferencePointer) error { | ||
| ctxlog.Get(ctx).Infof("validating refs: %v, validateRefName: %v", refs, validateRefName) |
There was a problem hiding this comment.
line is 89 characters (lll)
If you have feedback about this comment, please, tell us.
| if "" == rp.ReferenceName { | ||
| rs = config.RefSpec(fmt.Sprintf(config.DefaultFetchRefSpec, defaultRemoteName)) | ||
| log.Warningf("empty ReferenceName given in %v, using default '%s' instead", rp, rs) | ||
| ctxlog.Get(ctx).Warningf("empty ReferenceName given in %v, using default '%s' instead", rp, rs) |
There was a problem hiding this comment.
line is 98 characters (lll)
If you have feedback about this comment, please, tell us.
|
|
||
| w := s.newWatcher([]string{"github.com/mock/test"}) | ||
| err := w.Watch(context.TODO(), func(e lookout.Event) error { | ||
| err := w.Watch(context.TODO(), func(ctx context.Context, e lookout.Event) error { |
There was a problem hiding this comment.
duplicate of /tmp/gometalint392739599/provider___.github.___watcher_test.go:153-158 (dupl)
If you have feedback about this comment, please, tell us.
|
|
||
| w := s.newWatcher([]string{"github.com/mock/test"}) | ||
| err := w.Watch(context.TODO(), func(e lookout.Event) error { | ||
| err := w.Watch(context.TODO(), func(ctx context.Context, e lookout.Event) error { |
There was a problem hiding this comment.
duplicate of /tmp/gometalint392739599/provider___.github.___watcher_test.go:136-141 (dupl)
If you have feedback about this comment, please, tell us.
Grpc allows to send metadata in header or trailer. There are some helpers in go-grpc-middleware for that. |
|
That's great. I created an issue with your suggestion so we don't forget about it: #248 |
Fix #181.
The main change in this PR is that the callbacks with
EventHandleraccept the context, and keep the log fields like the PR number.The
service/gitmethods now get the log from the context, but the problem here is that the gRPC requests come from the analyzer, and we don't have theevent-idor any other field.I didn't look much into it, so I don't know if there is a way to pass some ID fields to the analyzer and get them back when they call
GetFiles/GetChangeswithout modifying theprotomessages.