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

Tracker Factory for dependency injection #1327

merged 5 commits into from Jul 19, 2019


Copy link

commented Jul 19, 2019

Allow callers of NewFromConfig to supply a tracker factory.

Tracker Factory for dependency injection
Allow callers of NewFromConfig to supply a tracker factory.

@gdbelvin gdbelvin requested a review from google/keytransparency as a code owner Jul 19, 2019

@googlebot googlebot added the cla: yes label Jul 19, 2019


This comment has been minimized.

Copy link

commented Jul 19, 2019

Codecov Report

Merging #1327 into master will increase coverage by 0.04%.
The diff coverage is 10.71%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1327      +/-   ##
+ Coverage   30.26%   30.3%   +0.04%     
  Files          48      48              
  Lines        3873    3867       -6     
  Hits         1172    1172              
+ Misses       2519    2513       -6     
  Partials      182     182
Impacted Files Coverage Δ
core/monitor/monitor.go 19.44% <0%> (-0.28%) ⬇️
core/client/tracker/tracker.go 66.66% <0%> (ø) ⬆️
core/client/client.go 28.28% <0%> (-0.66%) ⬇️
impl/integration/env.go 0% <0%> (ø) ⬆️
core/integration/client_tests.go 0% <0%> (ø) ⬆️
core/client/verifier/verifier.go 56.57% <100%> (+0.57%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f3ee35a...04b6d09. Read the comment docs.

@@ -53,6 +52,8 @@ type LogTracker interface {
VerifyLogRoot(state *pb.LogRootRequest, newRoot *pb.LogRoot) (*types.LogRootV1, error)

type LogTrackerFactory func(*tclient.LogVerifier) LogTracker

This comment has been minimized.

Copy link

mhutchinson Jul 19, 2019

Given the length of the conversation we had around this yesterday, I think a short description here would be worthwhile. It only needs to say that this allows different implementation strategies, including a no-op implementation, for a Tracker to be injected based on a verifier. It feels obvious now, but I'm not sure that would be true without the context.

core/client/gobindclient/client.go Outdated Show resolved Hide resolved
core/client/tracker/tracker.go Outdated Show resolved Hide resolved

@gdbelvin gdbelvin force-pushed the gdbelvin:factory branch from ba93b20 to cfa95b9 Jul 19, 2019

gdbelvin added some commits Jul 19, 2019

@gdbelvin gdbelvin merged commit 3c05089 into google:master Jul 19, 2019

4 of 5 checks passed

codecov/patch 10.71% of diff hit (target 30.26%)
GolangCI No issues found!
Travis CI - Pull Request Build Passed
cla/google All necessary CLAs are signed
codecov/project 30.3% (+0.04%) compared to f3ee35a

@gdbelvin gdbelvin deleted the gdbelvin:factory branch Jul 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
4 participants
You can’t perform that action at this time.