Change CheckSyncedGitCommits to IsGitCommitSynced#2561
Merged
saquibmian merged 1 commit intomainfrom Nov 10, 2023
Merged
Conversation
We never passed more than one hash in.
saquibmian
commented
Nov 10, 2023
| } | ||
| } | ||
| // not in the cache, request BSR check | ||
| syncedModuleCommits, err := s.handler.CheckSyncedGitCommits(ctx, moduleIdentity, map[string]struct{}{commitHash: {}}) |
Contributor
Author
There was a problem hiding this comment.
We only ever passed in one hash.
unmultimedio
approved these changes
Nov 10, 2023
| return false, fmt.Errorf("get labels in namespace: %w", err) | ||
| } | ||
| return syncedHashes, nil | ||
| return len(res.Msg.Labels) == 1, nil |
Member
There was a problem hiding this comment.
May be make sure that the returned label is actually the one requested?
Contributor
Author
There was a problem hiding this comment.
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( |
Member
There was a problem hiding this comment.
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
added a commit
that referenced
this pull request
Nov 10, 2023
This reverts commit d6484f2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We never passed more than one hash in.