sourcegraph/schema/go-modules.schema.json
Tomás Senart 8854605846
extsvc: Change default rate limits of npm and Go external services (#34042)
This commit changes the default rate limit configs of npm and Go
external services to be unlimited by default, and for a higher default
of 16 req/s to be filled in when auto-completing in the Monaco editor of
the UI.

Unlike the GitHub or GitLab APIs, neither the public npm registry nor
the public Go modules proxy (i.e proxy.golang.org) document an enforced
req/s rate limit. For private registries / proxies, site-admins can
manually configure their desired rate limits.

The request pattern for npm and Go sources is also different than GitHub
and GitLab sources in that they execute a lot more individual requests
since there are no batch endpoints used (except for multiple versions of
a single package). This means we need a far higher rate limit in order
for these external services to sync in a reasonable amount of time,
as well as leave some quota for lazy-syncing individual packages via
dependencies search.
2022-04-19 11:50:46 +00:00

53 lines
1.9 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "go-modules.schema.json#",
"title": "GoModulesConnection",
"description": "Configuration for a connection to Go module proxies",
"allowComments": true,
"type": "object",
"additionalProperties": false,
"required": ["urls"],
"properties": {
"urls": {
"description": "The list of Go module proxy URLs to fetch modules from. 404 Not found or 410 Gone responses will result in the next URL to be attempted.",
"type": "array",
"items": {
"type": "string"
},
"default": ["https://proxy.golang.org"],
"examples": [["https://athens.mycorp.org", "https://proxy.golang.org"]]
},
"rateLimit": {
"description": "Rate limit applied when making background API requests to the configured Go module proxies.",
"title": "GoRateLimit",
"type": "object",
"required": ["enabled", "requestsPerHour"],
"properties": {
"enabled": {
"description": "true if rate limiting is enabled.",
"type": "boolean",
"default": true
},
"requestsPerHour": {
"description": "Requests per hour permitted. This is an average, calculated per second. Internally, the burst limit is set to 100, which implies that for a requests per hour limit as low as 1, users will continue to be able to send a maximum of 100 requests immediately, provided that the complexity cost of each request is 1.",
"type": "number",
"default": 57600,
"minimum": 0
}
},
"default": {
"enabled": true,
"requestsPerHour": 57600
}
},
"dependencies": {
"description": "An array of strings specifying Go modules to mirror in Sourcegraph.",
"type": "array",
"items": {
"type": "string"
},
"examples": [["cloud.google.com/go/kms@v1.1.0"]]
}
}
}