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

Commit cd1cc2d

Browse files
authored
Move enterprise/internal/batches package to internal/batches (#54855) (#54866)
This moves another heavy enterprise component out to the regular directory.
1 parent 7cc05f7 commit cd1cc2d

File tree

420 files changed

+757
-765
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

420 files changed

+757
-765
lines changed

.github/test.CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121

122122
/enterprise/internal/authz/**/* @unknwon
123123

124-
/enterprise/internal/batches/**/* @eseliger
124+
/internal/batches/**/* @eseliger
125125

126126
/enterprise/internal/cloud/**/* @unknwon @michaellzc
127127

cmd/frontend/graphqlbackend/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/repo-updater/repoupdater/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/repo-updater/repoupdater/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"google.golang.org/grpc/status"
1515

1616
"github.com/sourcegraph/sourcegraph/internal/api"
17-
"github.com/sourcegraph/sourcegraph/internal/batches"
17+
"github.com/sourcegraph/sourcegraph/internal/batches/syncer"
1818
"github.com/sourcegraph/sourcegraph/internal/codeintel/dependencies"
1919
"github.com/sourcegraph/sourcegraph/internal/database"
2020
"github.com/sourcegraph/sourcegraph/internal/errcode"
@@ -41,7 +41,7 @@ type Server struct {
4141
UpdateOnce(id api.RepoID, name api.RepoName)
4242
ScheduleInfo(id api.RepoID) *protocol.RepoUpdateSchedulerInfoResult
4343
}
44-
ChangesetSyncRegistry batches.ChangesetSyncRegistry
44+
ChangesetSyncRegistry syncer.ChangesetSyncRegistry
4545
RateLimitSyncer interface {
4646
// SyncRateLimiters should be called when an external service changes so that
4747
// our internal rate limiters are kept in sync

cmd/repo-updater/shared/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/repo-updater/shared/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"github.com/sourcegraph/sourcegraph/internal/actor"
2626
"github.com/sourcegraph/sourcegraph/internal/api"
2727
"github.com/sourcegraph/sourcegraph/internal/authz"
28-
"github.com/sourcegraph/sourcegraph/internal/batches"
28+
"github.com/sourcegraph/sourcegraph/internal/batches/syncer"
2929
"github.com/sourcegraph/sourcegraph/internal/codeintel/dependencies"
3030
"github.com/sourcegraph/sourcegraph/internal/conf"
3131
"github.com/sourcegraph/sourcegraph/internal/conf/conftypes"
@@ -460,7 +460,7 @@ func watchSyncer(
460460
logger log.Logger,
461461
syncer *repos.Syncer,
462462
sched *repos.UpdateScheduler,
463-
changesetSyncer batches.UnarchivedChangesetSyncRegistry,
463+
changesetSyncer syncer.UnarchivedChangesetSyncRegistry,
464464
) {
465465
logger.Debug("started new repo syncer updates scheduler relay thread")
466466

dev/backcompat/defs.bzl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ how to define them.
1010
The final result is the definition of a @sourcegraph_back_compat target, whose test targets are exactly
1111
the same as back then, but with instead a new schema.
1212
13-
Example: `bazel test @sourcegraph_back_compat//enterprise/internal/batches/...`.
13+
Example: `bazel test @sourcegraph_back_compat//internal/batches/...`.
1414
1515
See https://sourcegraph.com/search?q=context:global+dev/backcompat/patches/back_compat_migrations.patch+repo:github.com/sourcegraph/sourcegraph+lang:Go&patternType=standard&sm=0&groupBy=repo
1616
for the command generating the mandatory patch file in CI for these tests to run.
@@ -21,7 +21,6 @@ eventuality of someone running those locally).
2121

2222
load("test_release_version.bzl", "MINIMUM_UPGRADEABLE_VERSION", "MINIMUM_UPGRADEABLE_VERSION_REF")
2323
load("flakes.bzl", "FLAKES")
24-
2524
load("@bazel_gazelle//:deps.bzl", "go_repository")
2625
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
2726

@@ -100,8 +99,8 @@ def back_compat_defs():
10099
],
101100
build_file_proto_mode = "disable_global",
102101
importpath = "github.com/sourcegraph/scip",
103-
sum = "h1:fWPxLkDObzzKTGe9vb6wpzK0FYkwcfSxmxUBvAOc8aw=", # Need to be manually updated when bumping the back compat release target.
104-
version = "v0.2.4-0.20221213205653-aa0e511dcfef", # Need to be manually updated when bumping the back compat release target.
102+
sum = "h1:fWPxLkDObzzKTGe9vb6wpzK0FYkwcfSxmxUBvAOc8aw=", # Need to be manually updated when bumping the back compat release target.
103+
version = "v0.2.4-0.20221213205653-aa0e511dcfef", # Need to be manually updated when bumping the back compat release target.
105104
)
106105

107106
# Same logic for this repository.
@@ -110,13 +109,13 @@ def back_compat_defs():
110109
build_directives = [
111110
"gazelle:resolve go github.com/sourcegraph/sourcegraph/lib/errors @sourcegraph_back_compat//lib/errors",
112111
],
113-
build_file_proto_mode = "disable_global", importpath =
114-
"github.com/sourcegraph/conc",
115-
sum = "h1:96VpOCAtXDCQ8Oycz0ftHqdPyMi8w12ltN4L2noYg7s=", # Need to be manually updated when bumping the back compat release target.
116-
version = "v0.2.0", # Need to be manually updated when bumping the back compat release target.
112+
build_file_proto_mode = "disable_global",
113+
importpath =
114+
"github.com/sourcegraph/conc",
115+
sum = "h1:96VpOCAtXDCQ8Oycz0ftHqdPyMi8w12ltN4L2noYg7s=", # Need to be manually updated when bumping the back compat release target.
116+
version = "v0.2.0", # Need to be manually updated when bumping the back compat release target.
117117
)
118118

119-
120119
# Now that we have declared a replacement for the two problematic go packages that
121120
# @sourcegraph_back_compat depends on, we can define the repository itself. Because it
122121
# comes with its Bazel rules (logical, that's just the current repository but with a different

dev/codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ coverage:
1616
- cmd/frontend/graphqlbackend/batches.go
1717
- internal/usagestats/batches.go
1818
- enterprise/cmd/frontend/internal/batches
19-
- enterprise/internal/batches
19+
- internal/batches
2020
- client/web/src/enterprise/batches
2121
insights:
2222
informational: true

doc/dev/background-information/backgroundroutine.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ They are defined in the [`goroutine`](https://sourcegraph.com/github.com/sourceg
77
Examples:
88

99
- [`worker.NewWorker`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+worker.NewWorker&patternType=literal), for example, produces a background routine, which in this case is a background worker.
10-
- [`batches.newSpecExpireWorker`](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/enterprise/internal/batches/background/spec_expire.go?subtree=true#L13-27) returns a [`goroutine.PeriodicGoroutine`](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@b946a20362ee7dfedb3b1fbc7f8bb002135d7283/-/blob/internal/goroutine/periodic.go?subtree=true#L14:78), which means it's invoked periodically.
10+
- [`batches.newSpecExpireWorker`](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/batches/background/spec_expire.go?subtree=true#L13-27) returns a [`goroutine.PeriodicGoroutine`](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@b946a20362ee7dfedb3b1fbc7f8bb002135d7283/-/blob/internal/goroutine/periodic.go?subtree=true#L14:78), which means it's invoked periodically.
1111
- [out-of-band migrations](oobmigrations.md) are implemented as background routines.
1212
- [`HardDeleter`](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@b946a20362ee7dfedb3b1fbc7f8bb002135d7283/-/blob/enterprise/cmd/frontend/internal/codeintel/background/janitor/hard_delete.go?subtree=true#L33) is a periodic background routine that periodically hard-deletes soft-deleted upload records.
1313

enterprise/cmd/frontend/internal/batches/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)