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

Don't skip repos for remotes table with more than 1 URL #789

Merged
merged 3 commits into from
Apr 10, 2019
Merged

Don't skip repos for remotes table with more than 1 URL #789

merged 3 commits into from
Apr 10, 2019

Conversation

kuba--
Copy link
Contributor

@kuba-- kuba-- commented Apr 9, 2019

Signed-off-by: kuba-- kuba@sourced.tech

Fixes #788

For remotes with more than 1 URL, remotesIndexKeyValueIter skip repos.

@kuba-- kuba-- requested a review from a team April 9, 2019 14:26
@kuba-- kuba-- added the bug Something isn't working label Apr 9, 2019
remotes_test.go Outdated
@@ -151,5 +151,5 @@ func TestRemotesIndexIterClosed(t *testing.T) {
}

func TestRemotesIterClosed(t *testing.T) {
testTableIterClosed(t, new(remotesTable))
testTableIndexIterRows(t, new(remotesTable), 11)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually here I should compare results with non index iterator!

Signed-off-by: kuba-- <kuba@sourced.tech>
@kuba--
Copy link
Contributor Author

kuba-- commented Apr 9, 2019

@src-d/data-processing could you review my PR changes, again. I've added some fixes not only for index iterator (but also for remotesRowIter). It seems, we had a bug in remotes iterators.
PTAL.

remotes.go Outdated
@@ -177,13 +174,23 @@ func (i *remotesRowIter) Close() error {
}

func remoteToRow(repoID string, config *config.RemoteConfig, pos int) sql.Row {
url := ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no URL, it should be nil, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, URLs are strings

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, I meant at SQL table level. If there is no value, we should return NULL instead of empty string.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, done.

Signed-off-by: kuba-- <kuba@sourced.tech>
Signed-off-by: kuba-- <kuba@sourced.tech>
@ajnavarro ajnavarro merged commit fd71314 into src-d:master Apr 10, 2019
@kuba-- kuba-- deleted the fix-788/remotes branch April 10, 2019 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants