-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Refactor Git source to use SourceUnits #2058
Conversation
This led to a lot of changes to replace code that expects a channel with a ChunkReporter. Luckily, a reporter can have the same functionality as a channel, so this commit also adds a ChanReporter to maintain functionality for the other codepaths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i'm seeing three parts of this pr, tell me if i've got this right:
- reorganizing the git source
- modifying every source except the git source to use a new channel-wrapping reporter
- modifying the git source to use the new units system
if i do have that right, can i talk you into breaking this into two or even three prs?
- reorganize the git source
- create and use
ChanReporter
everywhere - modify the git source to use units
or
- create and use
ChanReporter
everywhere - reorganize the git source and modify it to use units
@@ -37,7 +37,7 @@ type Handler interface { | |||
// packages them in the provided chunk skeleton, and sends them to chunksChan. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment needs an update
} | ||
if err := s.scanRepo(ctx, repoURI, reporter); err != nil { | ||
ctx.Logger().Info("error scanning repository", "repo", repoURI, "error", err) | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this necessary or is it just here for symmetry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary - it's similar to the return
I did at the end of a function. No functional difference, but marginally better if we add code after it.
For the most part, yes, but the
Yeah, good idea. The latter two PR approach makes more sense to me, so I'll go with that. |
Description:
This led to a lot of changes to replace code that expects a channel with
a ChunkReporter. Luckily, a reporter can have the same functionality as
a channel, so this commit also adds a ChanReporter to maintain
functionality for the other codepaths.
Checklist:
make test-community
)?make lint
this requires golangci-lint)?