Show which exercises differ from their last published release.
Deploy Development / deploy (push) Successful in 53s
Test Suite / pytest-backend (push) Failing after 30s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 17s
Test Suite / k6 /health Baseline (push) Successful in 35s
Test Suite / playwright-tests (push) Failing after 7m42s
Deploy Development / deploy (push) Successful in 53s
Test Suite / pytest-backend (push) Failing after 30s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 17s
Test Suite / k6 /health Baseline (push) Successful in 35s
Test Suite / playwright-tests (push) Failing after 7m42s
The release tab names the changed areas, and an admin list collects those exercises so a new release stays a deliberate publication. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
4b33b17b2d
commit
4ad62b6e38
14 files changed
+305
-6
No files matched your search
@@ -410,6 +410,71 @@ def _duration_note(exercise: dict) -> Optional[str]:
|
||||
return None
|
||||
|
||||
|
||||
def _manifest_part_text(manifest: dict, role: str) -> str:
|
||||
parts = ((manifest.get("exercise") or {}).get("parts") or [])
|
||||
return "\n".join((part.get("text") or "").strip() for part in parts if part.get("role") == role).strip()
|
||||
|
||||
|
||||
def _instruction_texts(exercise: dict, variants: list[dict]) -> list[str]:
|
||||
texts = []
|
||||
base = plaintext(exercise.get("execution"))
|
||||
if variants:
|
||||
for variant in variants:
|
||||
extra = plaintext(variant.get("execution_changes"))
|
||||
combined = "\n".join(piece for piece in (base, extra) if piece)
|
||||
if combined:
|
||||
texts.append(combined)
|
||||
elif base:
|
||||
texts.append(base)
|
||||
return texts
|
||||
|
||||
|
||||
def changed_areas(exercise: dict, variants: list[dict], media: list[dict], manifest: dict) -> list[str]:
|
||||
"""Benannte Abweichungen der Arbeitsfassung vom gespeicherten Release-Manifest."""
|
||||
body = manifest.get("exercise") or {}
|
||||
areas: list[str] = []
|
||||
if (exercise.get("title") or "") != (body.get("title") or ""):
|
||||
areas.append("Titel")
|
||||
if (plaintext(exercise.get("summary")) or "") != (body.get("summary") or ""):
|
||||
areas.append("Kurztext")
|
||||
for role, label, current in (
|
||||
("goal", "Ziel", plaintext(exercise.get("goal"))),
|
||||
("preparation", "Vorbereitung", plaintext(exercise.get("preparation"))),
|
||||
("trainer_notes", "Trainerhinweise", plaintext(exercise.get("trainer_notes"))),
|
||||
("equipment", "Material", plaintext(_equipment_text(exercise))),
|
||||
("duration_note", "Dauer", plaintext(_duration_note(exercise))),
|
||||
):
|
||||
if (current or "") != _manifest_part_text(manifest, role):
|
||||
areas.append(label)
|
||||
released_instructions = sorted(
|
||||
(part.get("text") or "").strip()
|
||||
for part in (body.get("parts") or [])
|
||||
if part.get("role") == "instructions" and (part.get("text") or "").strip()
|
||||
)
|
||||
if sorted(_instruction_texts(exercise, variants)) != released_instructions:
|
||||
areas.append("Durchführung")
|
||||
released_variants = list(body.get("variants") or [])
|
||||
if variants:
|
||||
current_variants = sorted((str(item.get("public_id")), item.get("variant_name") or "") for item in variants)
|
||||
released_pairs = sorted((str(item.get("id")), item.get("label") or "") for item in released_variants)
|
||||
if current_variants != released_pairs:
|
||||
areas.append("Varianten")
|
||||
elif len(released_variants) != 1:
|
||||
areas.append("Varianten")
|
||||
current_by_id = {str(item.get("public_id")): item.get("sha256") or "" for item in media}
|
||||
released_by_id = {str(item.get("id")): item.get("sha256") or "" for item in (body.get("assets") or [])}
|
||||
media_changed = set(current_by_id) != set(released_by_id)
|
||||
if not media_changed:
|
||||
for key, digest in current_by_id.items():
|
||||
released_digest = released_by_id.get(key) or ""
|
||||
if digest and released_digest and digest != released_digest:
|
||||
media_changed = True
|
||||
break
|
||||
if media_changed:
|
||||
areas.append("Medien")
|
||||
return areas
|
||||
|
||||
|
||||
def _equipment_text(exercise: dict) -> Optional[str]:
|
||||
raw = exercise.get("equipment")
|
||||
if isinstance(raw, str):
|
||||
|
||||
Reference in new issue
Block a user