Skip to content

Package repos: programmatically enforce that there can only be one JVM/npm code host

Created by: olafurpg

Related to https://github.com/sourcegraph/sourcegraph/issues/32499 and https://github.com/sourcegraph/sourcegraph/issues/32461

We currently document that there can only be on JVM/npm code host per instance but we don't enforce this limitation programmatically. It looks like there is already some related according to @mrnugget https://github.com/sourcegraph/sourcegraph/blob/014e8742fead279871c69cca9cbf2e8deec59564/internal/database/external_services.go#L377

Another way to accomplish this is to add a DB constraint. If we go the db constraint route, we should remember to ignore soft deleted external services.