diff --git a/CHANGELOG-v3-conf.md b/CHANGELOG-v3-conf.md new file mode 100644 index 0000000000..dfac106f9e --- /dev/null +++ b/CHANGELOG-v3-conf.md @@ -0,0 +1 @@ +- Add `v3` to the types service, and at it to the Services page. No change to environment required. diff --git a/context/app/api/client.py b/context/app/api/client.py index 338706c8d8..0d82edaa0b 100644 --- a/context/app/api/client.py +++ b/context/app/api/client.py @@ -179,7 +179,9 @@ def get_vitessce_conf_cells_and_lifted_uuid(self, entity, marker=None, wrap_erro else: try: def get_assay(name): - type_client = TypeClient(current_app.config["TYPE_SERVICE_ENDPOINT"]) + type_client = TypeClient( + current_app.config["TYPE_SERVICE_ENDPOINT"] + + current_app.config["TYPE_SERVICE_PATH"]) return type_client.getAssayType(name) Builder = get_view_config_builder(entity=entity, get_assay=get_assay) builder = Builder(entity, self.groups_token, current_app.config["ASSETS_ENDPOINT"]) diff --git a/context/app/default_config.py b/context/app/default_config.py index e3596499ae..6a348e7e6e 100644 --- a/context/app/default_config.py +++ b/context/app/default_config.py @@ -1,6 +1,12 @@ from datetime import timedelta +# By keeping this in code rather than configuration, +# we can atomically release changes that uses new service features, +# rather than requiring backward compatibility from new API versions. +version = 'v3' + + class DefaultConfig(object): # This should be updated when app.conf is updated: # Test runs will only see this config and not app.conf. @@ -12,7 +18,10 @@ class DefaultConfig(object): PERMANENT_SESSION_LIFETIME = timedelta(minutes=60) SESSION_COOKIE_SAMESITE = 'Lax' - PORTAL_INDEX_PATH = '/v3/portal/search' + # These app-wide configurations do not vary between environments: + + TYPE_SERVICE_PATH = f'/{version}' + PORTAL_INDEX_PATH = f'/{version}/portal/search' CCF_INDEX_PATH = '/entities/search' # Everything else should be overridden in app.conf: @@ -23,6 +32,7 @@ class DefaultConfig(object): GATEWAY_ENDPOINT = 'should-be-overridden' ELASTICSEARCH_ENDPOINT = 'should-be-overridden' + TYPE_SERVICE_ENDPOINT = 'should-be-overridden' ASSETS_ENDPOINT = 'should-be-overridden' XMODALITY_ENDPOINT = 'should-be-overridden' WORKSPACES_ENDPOINT = 'should-be-overridden' diff --git a/context/app/static/js/components/ServiceStatusTable/ServiceStatusTable.jsx b/context/app/static/js/components/ServiceStatusTable/ServiceStatusTable.jsx index da0551ddbb..e3326e61a7 100644 --- a/context/app/static/js/components/ServiceStatusTable/ServiceStatusTable.jsx +++ b/context/app/static/js/components/ServiceStatusTable/ServiceStatusTable.jsx @@ -38,6 +38,7 @@ function ServiceStatusTable({ entityEndpoint, gatewayEndpoint, workspacesEndpoint, + typeServiceEndpoint, }) { const gatewayStatus = useGatewayStatus(`${gatewayEndpoint}/status.json`); @@ -85,6 +86,13 @@ function ServiceStatusTable({ response: gatewayStatus.search_api, noteFunction: (api) => `ES: ${api.elasticsearch_connection}; ES Status: ${api.elasticsearch_status}`, }), + buildServiceStatus({ + apiName: 'type-api', + githubUrl: 'https://github.com/dbmi-pitt/search-adaptor', + endpointUrl: typeServiceEndpoint, + response: gatewayStatus.search_api, + noteFunction: () => 'Included in search-api for historical reasons.', + }), buildServiceStatus({ apiName: 'uuid-api', response: gatewayStatus.uuid_api, diff --git a/context/app/utils.py b/context/app/utils.py index a8fbc15e06..88eb6b3dbb 100644 --- a/context/app/utils.py +++ b/context/app/utils.py @@ -26,6 +26,8 @@ def get_default_flask_data(): 'gatewayEndpoint': current_app.config['GATEWAY_ENDPOINT'], 'elasticsearchEndpoint': current_app.config['ELASTICSEARCH_ENDPOINT'] + current_app.config['PORTAL_INDEX_PATH'], + 'typeServiceEndpoint': current_app.config['TYPE_SERVICE_ENDPOINT'] + + current_app.config['TYPE_SERVICE_PATH'], 'assetsEndpoint': current_app.config['ASSETS_ENDPOINT'], 'entityEndpoint': current_app.config['ENTITY_API_BASE'], 'xmodalityEndpoint': current_app.config['XMODALITY_ENDPOINT'],