|
7 | 7 | from aiohttp.client import ClientSession |
8 | 8 | from aiohttp.client_exceptions import ClientConnectionError, ClientError |
9 | 9 | from common_library.json_serialization import json_dumps |
| 10 | +from packaging.version import Version |
10 | 11 | from servicelib.aiohttp.client_session import get_client_session |
11 | 12 | from tenacity.asyncio import AsyncRetrying |
12 | 13 | from tenacity.before import before_log |
@@ -93,6 +94,11 @@ async def create_cached_indexes(app: web.Application) -> None: |
93 | 94 | app[APP_FRONTEND_CACHED_INDEXES_KEY] = cached_indexes |
94 | 95 |
|
95 | 96 |
|
| 97 | +def _get_release_notes_vtag(vtag: str) -> str: |
| 98 | + version = Version(vtag) |
| 99 | + return f"v{version.major}.{version.minor}.0" |
| 100 | + |
| 101 | + |
96 | 102 | async def create_and_cache_statics_json(app: web.Application) -> None: |
97 | 103 | # NOTE: in devel model, the folder might be under construction |
98 | 104 | # (qx-compile takes time), therefore we create statics.json |
@@ -132,7 +138,8 @@ async def create_and_cache_statics_json(app: web.Application) -> None: |
132 | 138 | ): |
133 | 139 | # template URL should be somethign like: |
134 | 140 | # https://github.com/ITISFoundation/osparc-issues/blob/master/release-notes/osparc/{vtag}.md |
135 | | - data["vcsReleaseUrl"] = template_url.format(vtag=vtag) |
| 141 | + release_vtag = _get_release_notes_vtag(vtag) |
| 142 | + data["vcsReleaseUrl"] = template_url.format(vtag=release_vtag) |
136 | 143 |
|
137 | 144 | data_json = json_dumps(data) |
138 | 145 | _logger.debug("Front-end statics.json: %s", data_json) |
|
0 commit comments