Add configurable limits for number of builds allowed under a namespace

We also support that limit being increased automatically once a successful billing charge has gone through
This commit is contained in:
Joseph Schorr 2018-02-20 13:58:14 -05:00
parent 62971b7f20
commit 9a452ace11
10 changed files with 125 additions and 33 deletions

View file

@ -45,7 +45,6 @@ INTERNAL_ONLY_PROPERTIES = {
'SYSTEM_SERVICE_BLACKLIST',
'JWTPROXY_SIGNER',
'SECURITY_SCANNER_INDEXING_MIN_ID',
'MAX_BUILD_QUEUE_RATE_SECS',
'STATIC_SITE_BUCKET',
'LABEL_KEY_RESERVED_PREFIXES',
'TEAM_SYNC_WORKER_FREQUENCY',
@ -65,13 +64,14 @@ INTERNAL_ONLY_PROPERTIES = {
'MAIL_FAIL_SILENTLY',
'LOCAL_OAUTH_HANDLER',
'USE_CDN',
'MAX_BUILD_QUEUE_RATE_ITEMS',
'ANALYTICS_TYPE',
'EXCEPTION_LOG_TYPE',
'SENTRY_DSN',
'SENTRY_PUBLIC_DSN',
'BILLED_NAMESPACE_MAXIMUM_BUILD_COUNT',
'SECURITY_SCANNER_ENDPOINT_BATCH',
'SECURITY_SCANNER_API_TIMEOUT_SECONDS',
'SECURITY_SCANNER_API_TIMEOUT_POST_SECONDS',
@ -699,6 +699,11 @@ CONFIG_SCHEMA = {
'description': 'Whether to support Dockerfile build. Defaults to True',
'x-example': True,
},
'DEFAULT_NAMESPACE_MAXIMUM_BUILD_COUNT': {
'type': ['number', 'null'],
'description': 'If not None, the default maximum number of builds that can be queued in a namespace.',
'x-example': 20,
},
# Login
'FEATURE_GITHUB_LOGIN': {