chore: Move cmd/frontend/envvar to internal/envvar
Created by: efritz
Move from cmd/frontend to internal as it's shared code that's unspecific to the frontend.
$ ./depgraph lint NoReachingIntoCommands
(NoReachingIntoCommands) cmd/frontend/envvar: imported past command boundary by 9 packages:
- cmd/repo-updater/shared
- enterprise/internal/batches/resolvers
- enterprise/internal/insights/background
- internal/conf
- internal/database
- internal/hubspot/hubspotutil
- internal/profiler
- internal/repos
- internal/usagestats
Merge request reports
Activity
Created by: sourcegraph-bot
Notifying subscribers in CODENOTIFY files for diff b28a9dec05bbe3aeba0df3ca2b849714a2d0d013...85344d1b2a5203a53122a6fc741b078f0f2d613f.
Notify File(s) @LawnGnome enterprise/internal/batches/resolvers/resolver.go
internal/database/external_services.go
internal/database/external_services_test.go@asdine internal/database/external_services.go
internal/database/external_services_test.go@eseliger enterprise/internal/batches/resolvers/resolver.go
internal/database/external_services.go
internal/database/external_services_test.go@felixfbecker enterprise/internal/insights/background/historical_enqueuer.go @keegancsmith cmd/frontend/graphqlbackend/search_alert.go
cmd/frontend/graphqlbackend/search_contexts.go
cmd/frontend/graphqlbackend/search_contexts_test.go
cmd/frontend/graphqlbackend/search_results.go
cmd/frontend/graphqlbackend/search_results_test.go
cmd/frontend/internal/search/repos/repos.go
cmd/frontend/internal/search/repos/repos_test.go
cmd/frontend/internal/search/searchcontexts/search_contexts.go
cmd/frontend/internal/search/searchcontexts/search_contexts_test.go
internal/conf/auth.go
internal/conf/auth_test.go@rvantonder cmd/frontend/graphqlbackend/search_alert.go
cmd/frontend/graphqlbackend/search_contexts.go
cmd/frontend/graphqlbackend/search_contexts_test.go
cmd/frontend/graphqlbackend/search_results.go
cmd/frontend/graphqlbackend/search_results_test.go@slimsag enterprise/internal/insights/background/historical_enqueuer.go @unknwon enterprise/cmd/frontend/auth/githuboauth/provider.go
enterprise/cmd/frontend/auth/githuboauth/provider_test.go
enterprise/cmd/frontend/internal/licensing/enforcement/users.go
enterprise/cmd/frontend/internal/licensing/enforcement/users_test.go
enterprise/cmd/frontend/internal/licensing/init/init.goCreated by: keegancsmith
I'm not sure how envvar ended not being in
./cmd/frontend/internal/envvar
, but this dangerous because that pkg is supposed to only contain envvars related to frontend. EG we only setSOURCEGRAPHDOTCOM_MODE
on the frontend container. If other binaries try to use it they will always get false. See how tiny this pkg is, its a bit weird that it is now internal/envvar.Created by: efritz
@keegancsmith Even weirder that other things import it. My grand cleanup will unfold in two parts:
(1) Move code from cmd/X into internal when it's used outside of cmd/X (2) Move code in internal/Y into cmd/X/internal/Y if it's only used by cmd/X
This may move this package back into the frontend, but it's easier to concentrate on the pass level rather than the individual violation level (which requires more thought and knowledge about the code itself instead of just dealing with opaque imports).