Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,42 @@ tag = False
[bumpversion:file:.osparc/flaskapi/metadata.yml]
search = {current_version}
replace = {new_version}
semver-only = true
Comment thread
JavierGOrdonnez marked this conversation as resolved.

[bumpversion:file:.osparc/node/metadata.yml]
search = {current_version}
replace = {new_version}
semver-only = true

[bumpversion:file:.osparc/proxy-sumo-read/metadata.yml]
search = {current_version}
replace = {new_version}
semver-only = true

[bumpversion:file:.osparc/proxy-sumo-write/metadata.yml]
search = {current_version}
replace = {new_version}
semver-only = true

[bumpversion:file:.osparc/proxy-uq-read/metadata.yml]
search = {current_version}
replace = {new_version}
semver-only = true

[bumpversion:file:.osparc/proxy-uq-write/metadata.yml]
search = {current_version}
replace = {new_version}
semver-only = true

[bumpversion:file:.osparc/proxy-moga-read/metadata.yml]
search = {current_version}
replace = {new_version}
semver-only = true

[bumpversion:file:.osparc/proxy-moga-write/metadata.yml]
search = {current_version}
replace = {new_version}
semver-only = true

[bumpversion:file:Makefile]
search = {current_version}
Expand Down
2 changes: 1 addition & 1 deletion .osparc/flaskapi/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
key: simcore/services/dynamic/mmux-vite-backend
name: MMUX Backend
version: 1.6.3.dev2
version: 1.6.3
description: Python (Flask) and Dakota meta-modeling functionality in an interactive, user-friendly, guided step-by-step way
integration-version: 2.0.0
type: dynamic
Expand Down
2 changes: 1 addition & 1 deletion .osparc/node/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
key: simcore/services/dynamic/mmux-vite-web
name: MMUX Frontend
version: 1.6.3.dev2
version: 1.6.3
description: Vite (React + NodeJS + TypeScript) frontend for meta-modeling functionality in an interactive, user-friendly, guided step-by-step way
integration-version: 2.0.0
type: dynamic
Expand Down
2 changes: 1 addition & 1 deletion .osparc/proxy-moga-read/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Multi Objective Genetic Algorithm (Preview)
description: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/refs/heads/main/app/full/services/simcore_services_dynamic_mmux-vite-app-moga-read.md
icon: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/icons/s4l/simcore_services_dynamic_mmux-vite-app-moga.png
thumbnail: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/thumbnails/s4l/simcore_services_dynamic_mmux-vite-app-moga.png
version: 1.6.3.dev2
version: 1.6.3
integration-version: 2.0.0
type: dynamic
authors:
Expand Down
2 changes: 1 addition & 1 deletion .osparc/proxy-moga-write/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Multi Objective Genetic Algorithm
description: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/refs/heads/main/app/full/services/simcore_services_dynamic_mmux-vite-app-moga-write.md
icon: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/icons/s4l/simcore_services_dynamic_mmux-vite-app-moga.png
thumbnail: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/thumbnails/s4l/simcore_services_dynamic_mmux-vite-app-moga.png
version: 1.6.3.dev2
version: 1.6.3
integration-version: 2.0.0
type: dynamic
authors:
Expand Down
2 changes: 1 addition & 1 deletion .osparc/proxy-sumo-read/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Response Surface Modeling (Preview)
description: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/refs/heads/main/app/full/services/simcore_services_dynamic_model_intelligence_response_surface_modeling.md
icon: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/icons/s4l/simcore_services_dynamic_mmux-vite-app-sumo.png
thumbnail: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/thumbnails/s4l/simcore_services_dynamic_mmux-vite-app-sumo.png
version: 1.6.3.dev2
version: 1.6.3
integration-version: 2.0.0
type: dynamic
authors:
Expand Down
2 changes: 1 addition & 1 deletion .osparc/proxy-sumo-write/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Response Surface Modeling
description: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/refs/heads/main/app/full/services/simcore_services_dynamic_mmux-vite-app-sumo-write.md
icon: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/icons/s4l/simcore_services_dynamic_mmux-vite-app-sumo.png
thumbnail: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/thumbnails/s4l/simcore_services_dynamic_mmux-vite-app-sumo.png
version: 1.6.3.dev2
version: 1.6.3
integration-version: 2.0.0
type: dynamic
authors:
Expand Down
2 changes: 1 addition & 1 deletion .osparc/proxy-uq-read/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Uncertainty Quantification (Preview)
description: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/refs/heads/main/app/full/services/simcore_services_dynamic_mmux-vite-app-uq-read.md
icon: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/icons/s4l/simcore_services_dynamic_mmux-vite-app-uq.png
thumbnail: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/thumbnails/s4l/simcore_services_dynamic_mmux-vite-app-uq.png
version: 1.6.3.dev2
version: 1.6.3
integration-version: 2.0.0
type: dynamic
authors:
Expand Down
2 changes: 1 addition & 1 deletion .osparc/proxy-uq-write/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Uncertainty Quantification
description: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/refs/heads/main/app/full/services/simcore_services_dynamic_mmux-vite-app-uq-write.md
icon: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/icons/s4l/simcore_services_dynamic_mmux-vite-app-uq.png
thumbnail: https://raw.githubusercontent.com/ZurichMedTech/s4l-assets/main/app/thumbnails/s4l/simcore_services_dynamic_mmux-vite-app-uq.png
version: 1.6.3.dev2
version: 1.6.3
integration-version: 2.0.0
type: dynamic
authors:
Expand Down
2 changes: 1 addition & 1 deletion SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ V1: Caddy `:8888` → `/flask/*` to backend `:5000`, else → web `:8080`
V2: backend healthy ⟺ `GET /flask/deployment/health` → 200 ; web healthy ⟺ `GET /` → 200
V3: proxy `depends_on` backend & web healthy before serving
V4: `SERVICE_MODE` ∈ {UQ,SUMO,MOGA} ∧ `PERMISSIONS` ∈ {READ-ONLY,WRITE} ∧ `DEPLOYMENT_MODE` ∈ {LOCAL,OSPARC} ; other → backend errors
V5: ∀ version bump → all 8 `.osparc/*/metadata.yml` + `Makefile` + 2 compose files + `flaskapi/pyproject.toml` updated together (per `.bumpversion.cfg`, 12 file entries)
V5: ∀ version bump → all 8 `.osparc/*/metadata.yml` + `Makefile` + 2 compose files + `flaskapi/pyproject.toml` updated together (per `.bumpversion.cfg`, 12 file entries); `semver-only` entries (the oSPARC `metadata.yml` files, whose schema validates strict semver) carry the `.devN`-stripped BASE, every other entry the full version (#695)
V6: `OSPARC_API_{BASE_URL,KEY,SECRET}` ! set ∀ deployment, else backend ⊥ reach oSPARC
V7: `docker-compose.yml` ! regenerated by `ooil compose`; manual edits lost on rebuild
V8: `.env` ∉ git (holds oSPARC secrets)
Expand Down
39 changes: 29 additions & 10 deletions scripts/auto_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
highest tag), commits the stable version, tags `vX.Y.Z` and creates the
GitHub release.

Fanout entries flagged `semver-only = true` in `.bumpversion.cfg` (the
`.osparc/*/metadata.yml` services) carry the semver BASE on both channels:
the oSPARC metadata schema validates versions as strict semver and rejects
PEP440 `.devN` (issue #695); compose image tags keep the full dev version.

Subcommands print the resulting version on stdout; failures exit 1 with an
actionable message on stderr.
"""
Expand Down Expand Up @@ -72,13 +77,21 @@ def parse_form(version: str, *, source: str = "current version") -> tuple[str, i
return match["base"], None if dev is None else int(dev)


def versioned_files(parser: configparser.RawConfigParser) -> list[tuple[str, str, str]]:
def versioned_files(parser: configparser.RawConfigParser) -> list[tuple[str, str, str, bool]]:
"""(path, search-template, replace-template, semver-only) per fanout entry.

`semver-only = true` marks files whose version field must carry the semver
BASE (`.devN` stripped) because their schema validates strict semver —
oSPARC `metadata.yml` (MetadataConfig) is the case that forced #695; the
compose image tags and pyproject keep the full dev version.
"""
files = []
for section in parser.sections():
if not section.startswith("bumpversion:file:"):
continue
path = section.removeprefix("bumpversion:file:")
files.append((path, parser[section]["search"], parser[section]["replace"]))
semver_only = parser[section].get("semver-only", "false").strip().lower() == "true"
files.append((path, parser[section]["search"], parser[section]["replace"], semver_only))
if not files:
raise SystemExit(f"no [bumpversion:file:*] sections found in {CONFIG_FILE}")
return files
Expand Down Expand Up @@ -167,7 +180,7 @@ def dev_tags() -> list[str]:


def apply_version(parser: configparser.RawConfigParser, current: str, target: str) -> int:
parse_form(target, source="--to target")
target_base, _ = parse_form(target, source="--to target")
changed = 0
# bump2version owns `current_version` in the config itself, so it never
# appears as a [bumpversion:file:*] entry; rewrite it explicitly.
Expand All @@ -184,9 +197,12 @@ def apply_version(parser: configparser.RawConfigParser, current: str, target: st
if updated_config != config_text:
CONFIG_FILE.write_text(updated_config)
changed += 1
for path_text, search_tpl, replace_tpl in versioned_files(parser):
for path_text, search_tpl, replace_tpl, semver_only in versioned_files(parser):
search = search_tpl.replace("{current_version}", current)
replace = replace_tpl.replace("{new_version}", target)
# semver-only files (oSPARC metadata.yml) never see the .devN suffix,
# so a dev stamp self-heals any such file left stamped with the dev
# version by the pre-#695 flow.
replace = replace_tpl.replace("{new_version}", target_base if semver_only else target)
Comment thread
JavierGOrdonnez marked this conversation as resolved.
Outdated
path = Path(path_text)
if not path.is_file():
raise SystemExit(f"versioned file missing: {path}")
Expand All @@ -209,8 +225,9 @@ def apply_version(parser: configparser.RawConfigParser, current: str, target: st


# Field-scoped version sites per file type (§V5 gate): EVERY match must
# carry exactly the current version, so a stale sibling (e.g. one compose
# image left behind while its siblings were rewritten) fails the check.
# carry exactly the expected version (full current, or the semver BASE for
# `semver-only` files), so a stale sibling (e.g. one compose image left
# behind while its siblings were rewritten) fails the check.
# File types without an entry fail closed rather than pass unchecked.
FANOUT_FIELDS = (
(re.compile(r"\.osparc/.*/metadata\.yml$"), re.compile(r"^version:\s*(\S+)\s*$", re.MULTILINE)),
Expand All @@ -225,8 +242,10 @@ def apply_version(parser: configparser.RawConfigParser, current: str, target: st

def check_fanout(current: str) -> None:
parser = config_from_text(read_config_text())
base, _ = parse_form(current)
stale = []
for path_text, _, _ in versioned_files(parser):
for path_text, _, _, semver_only in versioned_files(parser):
expected = base if semver_only else current
path = Path(path_text)
if not path.is_file():
stale.append(f"{path_text} (missing)")
Expand All @@ -238,8 +257,8 @@ def check_fanout(current: str) -> None:
"scripts/auto_version.py so the §V5 gate can validate it"
)
values = field.findall(path.read_text())
if not values or any(value != current for value in values):
stale.append(f"{path_text} (fields: {sorted(set(values)) or 'none'})")
if not values or any(value != expected for value in values):
stale.append(f"{path_text} (fields: {sorted(set(values)) or 'none'}, expected {expected!r})")
if stale:
raise SystemExit(
f"version fanout drift (§V5): {'. '.join(stale)}. Expected "
Expand Down
Loading