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

Change CheckSyncedGitCommits to IsGitCommitSynced #2561

Conversation

saquibmian
Copy link
Contributor

We never passed more than one hash in.

We never passed more than one hash in.
return true, nil
}
}
// not in the cache, request BSR check
syncedModuleCommits, err := s.handler.CheckSyncedGitCommits(ctx, moduleIdentity, map[string]struct{}{commitHash: {}})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We only ever passed in one hash.

}
return syncedHashes, nil
return len(res.Msg.Labels) == 1, nil
Copy link
Member

Choose a reason for hiding this comment

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

May be make sure that the returned label is actually the one requested?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about this, but this is going away soon anyway, to be replaced by GetReferenceByName{ Ref: git.Hash() }, so I didn't bother.

Comment on lines +170 to +172
// IsGitCommitSynced is invoked when syncing branches to know if a Git commit is already synced.
// If an error is returned, sync will abort.
IsGitCommitSynced(
Copy link
Member

Choose a reason for hiding this comment

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

Yeah I remember when doing this I was imagining paging many git hashes in a single request, but with multi module directories that became increasingly difficult and right now we just do it one by one. I'm good with this change!

@saquibmian saquibmian merged commit d6484f2 into main Nov 10, 2023
8 checks passed
@saquibmian saquibmian deleted the saquib/bsr-3025-change-checksyncedgitcommits-to-isgitcommitsynced branch November 10, 2023 18:43
saquibmian added a commit that referenced this pull request Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants