Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 51235ab

Browse files
authored
gitserver: Rename RepoUpdate to FetchRepository (#61865)
Just a simple name change to reflect the gRPC API surface in the service layer. Test plan: CI and go compiler
1 parent 24a6cae commit 51235ab

File tree

12 files changed

+145
-293
lines changed

12 files changed

+145
-293
lines changed

cmd/gitserver/internal/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ go_test(
129129
"//internal/limiter",
130130
"//internal/observation",
131131
"//internal/ratelimit",
132-
"//internal/trace",
133132
"//internal/types",
134133
"//internal/vcs",
135134
"//internal/wrexec",

cmd/gitserver/internal/ensurerevision.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func (s *Server) EnsureRevision(ctx context.Context, repo api.RepoName, rev stri
3232
}
3333

3434
// Revision not found, update before returning.
35-
_, _, err := s.RepoUpdate(ctx, repo)
35+
_, _, err := s.FetchRepository(ctx, repo)
3636
if err != nil {
3737
if ctx.Err() == nil {
3838
ensureRevisionCounter.WithLabelValues("update_failed").Inc()

cmd/gitserver/internal/integration_tests/clone_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func TestClone(t *testing.T) {
9191

9292
// Requesting a repo update should figure out that the repo is not yet
9393
// cloned and call clone. We expect that clone to succeed.
94-
_, _, err := s.RepoUpdate(ctx, repo)
94+
_, _, err := s.FetchRepository(ctx, repo)
9595
require.NoError(t, err)
9696

9797
// Should have acquired a lock.
@@ -194,7 +194,7 @@ func TestClone_Fail(t *testing.T) {
194194
// Requesting a repo update should figure out that the repo is not yet
195195
// cloned and call clone. We expect that clone to fail, because vcssyncer.IsCloneable
196196
// fails here.
197-
_, _, err := s.RepoUpdate(ctx, repo)
197+
_, _, err := s.FetchRepository(ctx, repo)
198198
require.Error(t, err)
199199
// Note that this error is from IsCloneable(), not from Clone().
200200
require.Contains(t, err.Error(), "error cloning repo: repo github.com/test/repo not cloneable:")
@@ -232,7 +232,7 @@ func TestClone_Fail(t *testing.T) {
232232
// Requesting another repo update should figure out that the repo is not yet
233233
// cloned and call clone. We expect that clone to fail, but in the vcssyncer.Clone
234234
// stage this time, not vcssyncer.IsCloneable.
235-
_, _, err = s.RepoUpdate(ctx, repo)
235+
_, _, err = s.FetchRepository(ctx, repo)
236236
require.Error(t, err)
237237
require.Contains(t, err.Error(), "failed to clone github.com/test/repo: clone failed. Output: Creating bare repo\nCreated bare repo at")
238238

cmd/gitserver/internal/integration_tests/resolverevisions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func TestClient_ResolveRevision(t *testing.T) {
126126

127127
for _, test := range tests {
128128
t.Run("", func(t *testing.T) {
129-
_, _, err := s.RepoUpdate(ctx, api.RepoName(remote))
129+
_, _, err := s.FetchRepository(ctx, api.RepoName(remote))
130130
require.NoError(t, err)
131131

132132
got, err := cli.ResolveRevision(ctx, api.RepoName(remote), test.input, gitserver.ResolveRevisionOptions{EnsureRevision: false})

cmd/gitserver/internal/integration_tests/utils_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func MakeGitRepository(t testing.TB, cmds ...string) api.RepoName {
145145
t.Helper()
146146
dir := InitGitRepository(t, cmds...)
147147
repo := api.RepoName(filepath.Base(dir))
148-
_, _, err := testServer.RepoUpdate(context.Background(), repo)
148+
_, _, err := testServer.FetchRepository(context.Background(), repo)
149149
require.NoError(t, err)
150150
return repo
151151
}

0 commit comments

Comments
 (0)