11import logging
2- from datetime import datetime
32from functools import cached_property
4- from typing import Any
3+ from typing import Any , Final
54
65from aiohttp import web
76from models_library .basic_types import (
@@ -85,10 +84,7 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
8584 description = "Name of the tag that makrs this release or None if undefined" ,
8685 example = "ResistanceIsFutile10" ,
8786 )
88- SIMCORE_VCS_RELEASE_DATE : datetime | None = Field (
89- default = None ,
90- description = "Release date or None if undefined. It corresponds to the tag's creation date" ,
91- )
87+
9288 SIMCORE_VCS_RELEASE_URL : AnyHttpUrl | None = Field (
9389 default = None ,
9490 description = "URL to release notes" ,
@@ -243,13 +239,18 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
243239 @root_validator ()
244240 @classmethod
245241 def build_vcs_release_url_if_unset (cls , values ):
246- vcs_release_url = values .get ("SIMCORE_VCS_RELEASE_URL" )
242+ release_url = values .get ("SIMCORE_VCS_RELEASE_URL" )
247243
248- if vcs_release_url is None and (
244+ if release_url is None and (
249245 vsc_release_tag := values .get ("SIMCORE_VCS_RELEASE_TAG" )
250246 ):
251- vcs_release_url = f"https://github.com/ITISFoundation/osparc-simcore/releases/tag/{ vsc_release_tag } "
252- values ["SIMCORE_VCS_RELEASE_URL" ] = vcs_release_url
247+ if vsc_release_tag == "latest" :
248+ release_url = (
249+ "https://github.com/ITISFoundation/osparc-simcore/commits/master/"
250+ )
251+ else :
252+ release_url = f"https://github.com/ITISFoundation/osparc-simcore/releases/tag/{ vsc_release_tag } "
253+ values ["SIMCORE_VCS_RELEASE_URL" ] = release_url
253254
254255 return values
255256
@@ -309,19 +310,15 @@ def _get_disabled_public_plugins(self) -> list[str]:
309310 # might reveal critical info on the settings of a deploy to the client.
310311 # TODO: more reliable definition of a "plugin" and whether it can be advertised or not
311312 # (extra var? e.g. Field( ... , x_advertise_plugin=True))
312- PUBLIC_PLUGIN_CANDIDATES = {
313+ public_plugin_candidates : Final = {
313314 "WEBSERVER_CLUSTERS" ,
314315 "WEBSERVER_EXPORTER" ,
315316 "WEBSERVER_META_MODELING" ,
316317 "WEBSERVER_PAYMENTS" ,
317318 "WEBSERVER_SCICRUNCH" ,
318319 "WEBSERVER_VERSION_CONTROL" ,
319320 }
320- return [
321- plugin_name
322- for plugin_name in PUBLIC_PLUGIN_CANDIDATES
323- if not self .is_enabled (plugin_name )
324- ]
321+ return [_ for _ in public_plugin_candidates if not self .is_enabled (_ )]
325322
326323 def _export_by_alias (self , ** kwargs ) -> dict [str , Any ]:
327324 # This is a small helper to assist export functions since aliases are no longer used by
@@ -337,7 +334,6 @@ def _export_by_alias(self, **kwargs) -> dict[str, Any]:
337334 "SC_VCS_REF" : "vcs_ref" ,
338335 "SC_VCS_URL" : "vcs_url" ,
339336 "SIMCORE_VCS_RELEASE_TAG" : "vcs_release_tag" ,
340- "SIMCORE_VCS_RELEASE_DATE" : "vcs_release_date" ,
341337 "SIMCORE_VCS_RELEASE_URL" : "vcs_release_url" ,
342338 "SWARM_STACK_NAME" : "stack_name" ,
343339 }
@@ -366,7 +362,6 @@ def public_dict(self) -> dict[str, Any]:
366362 "SC_VCS_REF" ,
367363 "SC_VCS_URL" ,
368364 "SIMCORE_VCS_RELEASE_TAG" ,
369- "SIMCORE_VCS_RELEASE_DATE" ,
370365 "SIMCORE_VCS_RELEASE_URL" ,
371366 },
372367 exclude_none = True ,
@@ -383,11 +378,11 @@ def to_client_statics(self) -> dict[str, Any]:
383378 "SC_VCS_REF" : True ,
384379 "SC_VCS_URL" : True ,
385380 "SIMCORE_VCS_RELEASE_TAG" : True ,
386- "SIMCORE_VCS_RELEASE_DATE" : True ,
387381 "SIMCORE_VCS_RELEASE_URL" : True ,
388382 "SWARM_STACK_NAME" : True ,
389383 "WEBSERVER_PROJECTS" : {"PROJECTS_MAX_NUM_RUNNING_DYNAMIC_NODES" },
390384 "WEBSERVER_LOGIN" : {"LOGIN_ACCOUNT_DELETION_RETENTION_DAYS" },
385+ "WEBSERVER_SESSION" : {"SESSION_COOKIE_MAX_AGE" },
391386 },
392387 exclude_none = True ,
393388 )
0 commit comments