a8n: Introduce an enterprise version of repo-updater
Created by: mrnugget
Last week @tsenart and I decided that the process that updates changesets from code hosts (i.e. GitHub pull requests) should live in repo-updater
, since that is where we already have a lot of the code that interacts with code hosts and because repo-updater
acts as a "singleton" (no replicas) which makes it easy to start a single, long-running goroutine.
But since A8N needs to live in ./enterprise
and we cannot mix OSS and enterprise code in repo-updater
, we took a shortcut last week before release and moved the code from repo-updater
to ./enterprise/cmd/frontend
.
Now, with more time available, we want to do the proper thing and create an enterprise version of repo-updater
that can then include the A8N code.
This PR here is the first step. It copies what frontend
and management-console
do and creates a shared
pkg for repo-updater
. It also declares repo-updater
to be an enterprise command that can be built from ./enterprise/cmd/repo-updater
.
There's not a lot of code here (the first commit moves the old main()
function to the new shared.Main()
), it's mainly adjusting scripts.
My main question: did I miss anything? Since I've never done this before, hopefully one of you can tell me :)
Random not-so-fun-but-enterprise fact: a8n enterprise
could be shortened to a8n e8e
Merge request reports
Activity
Created by: codecov[bot]
Codecov Report
Merging #5714 into master will increase coverage by
<.01%
. The diff coverage isn/a
.@@ Coverage Diff @@ ## master #5714 +/- ## ========================================== + Coverage 39.27% 39.27% +<.01% ========================================== Files 1145 1145 Lines 55754 55748 -6 Branches 5609 5608 -1 ========================================== - Hits 21895 21893 -2 + Misses 31797 31793 -4 Partials 2062 2062
Impacted Files Coverage Δ web/src/repo/commits/RepositoryCommitsPage.tsx 0% <0%> (ø)
web/src/search/results/SearchResultsInfoBar.tsx 66.66% <0%> (ø)
web/src/savedSearches/SavedSearchListPage.tsx 0% <0%> (ø)
shared/src/e2e/driver.ts 0% <0%> (ø)
web/src/repo/commits/GitCommitNodeByline.tsx 100% <0%> (ø)
web/src/repo/GitRef.tsx 0% <0%> (ø)
cmd/frontend/graphqlbackend/repository.go 22.81% <0%> (+0.97%)
Created by: mrnugget
How do you plan on including the enterprise bits?
My current idea is to add something like a callback to
shared.Main()
, so you can do something like this:shared.Main(func (db *sql.DB, syncer *repos.Syncer) { a8nSyncer := NewA8NSyncer(db) go a8nSyncer.Run() })
Open for suggestions though, since I haven't explored possible solution a lot yet