katalon-cli 0.3.1__tar.gz → 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/PKG-INFO +1 -1
  2. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/pyproject.toml +1 -1
  3. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/pyproject.toml.orig +1 -1
  4. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/src/katalon_cli/core/reindex.py +12 -4
  5. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/src/katalon_cli/core/release.py +2 -0
  6. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/src/katalon_cli/main.py +23 -1
  7. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/README.md +0 -0
  8. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/src/katalon_cli/__init__.py +0 -0
  9. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/src/katalon_cli/core/__init__.py +0 -0
  10. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/src/katalon_cli/core/backup.py +0 -0
  11. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/src/katalon_cli/core/checks.py +0 -0
  12. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/src/katalon_cli/core/compose_gen.py +0 -0
  13. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/src/katalon_cli/core/docker.py +0 -0
  14. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/src/katalon_cli/core/paths.py +0 -0
  15. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/src/katalon_cli/core/permissions.py +0 -0
  16. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/src/katalon_cli/core/selfupdate.py +0 -0
  17. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/src/katalon_cli/core/state.py +0 -0
  18. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/src/katalon_cli/py.typed +0 -0
  19. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/src/katalon_cli/templates/Caddyfile.j2 +0 -0
  20. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/src/katalon_cli/templates/compose.yaml.j2 +0 -0
  21. {katalon_cli-0.3.1 → katalon_cli-0.3.2}/src/katalon_cli/templates/nginx.conf.j2 +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: katalon-cli
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Installer & Updater CLI für Katalon Production-Instanzen
5
5
  Author: Karl Krägelin
6
6
  Author-email: Karl Krägelin <karlkraegelin@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "katalon-cli"
3
- version = "0.3.1"
3
+ version = "0.3.2"
4
4
  description = "Installer & Updater CLI für Katalon Production-Instanzen"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "katalon-cli"
3
- version = "0.3.1"
3
+ version = "0.3.2"
4
4
  description = "Installer & Updater CLI für Katalon Production-Instanzen"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -49,10 +49,15 @@ finally:
49
49
  _run(engine.dispose())
50
50
  """
51
51
 
52
- _BUILDING = re.compile(r"building (\d+) index docs for '(\w+)'")
53
- _BUILT = re.compile(r"(\d+)/(\d+) docs built for '(\w+)'")
54
- _INDEXED = re.compile(r"successfully indexed (\d+) records for '(\w+)'")
52
+ # Logzeilen von bulk_reindex_type_task. Katalon >= 1.42 (Alias-Swap-Rebuild) loggt
53
+ # "streaming N docs", "n/N docs" und "indexed N, removed M stale"; ältere Versionen
54
+ # "building N index docs", "n/N docs built" und "successfully indexed N records".
55
+ _BUILDING = re.compile(r"(?:building|streaming) (\d+) (?:index )?docs for '(\w+)'")
56
+ _BUILT = re.compile(r"(\d+)/(\d+) docs (?:built )?for '(\w+)'")
57
+ _INDEXED = re.compile(r"(?:successfully indexed (\d+) records|indexed (\d+), removed \d+ stale) for '(\w+)'")
55
58
  _FINISHED = re.compile(r"Task katalon\.reindex_all\[(?P<id>[0-9a-f-]+)\] (?P<state>succeeded|raised|failed)")
59
+ # Ergebnis von reindex_all ab Katalon 1.42: {..., 'types': {'object': {'indexed': 31815, ...}}}
60
+ _RESULT_INDEXED = re.compile(r"'(\w+)': \{'status': '\w+', 'indexed': (\d+)")
56
61
  _RECEIVED = re.compile(r"Task katalon\.reindex_all\[(?P<id>[0-9a-f-]+)\] received")
57
62
 
58
63
 
@@ -98,10 +103,13 @@ def parse_progress(log_text: str, task_id: str, known_totals: dict[str, int] | N
98
103
  progress.current = m[3]
99
104
  progress.built[m[3]] = int(m[1])
100
105
  elif (m := _INDEXED.search(line)):
101
- progress.indexed[m[2]] = int(m[1])
106
+ progress.indexed[m[3]] = int(m[1] or m[2])
102
107
  elif (m := _FINISHED.search(line)) and m["id"] == task_id:
103
108
  progress.finished = True
104
109
  progress.failed = m["state"] != "succeeded"
110
+ # Das Task-Ergebnis ist die verlässlichste Quelle für die Endzahlen.
111
+ for rtype, count in _RESULT_INDEXED.findall(line[m.end():]):
112
+ progress.indexed[rtype] = int(count)
105
113
  return progress
106
114
 
107
115
 
@@ -34,6 +34,8 @@ class ReleaseMetadata(BaseModel):
34
34
  version: str
35
35
  minimum_installer_version: str
36
36
  migration_required: bool
37
+ # Suchindex-Kopien der Vorversion sind veraltet (Katalon >= 1.43.2); fehlt bei älteren Releases.
38
+ reindex_required: bool = False
37
39
  breaking: bool
38
40
  compose_revision: int
39
41
  requires: ReleaseRequirements = ReleaseRequirements()
@@ -683,6 +683,9 @@ def update(
683
683
  dir: Path | None = typer.Option(None, "--dir"),
684
684
  target: str = typer.Option(None, "--target", help="Zielversion, default = latest"),
685
685
  yes: bool = typer.Option(False, "--yes", help="Ohne Rückfrage"),
686
+ reindex: bool = typer.Option(
687
+ False, "--reindex", help="Suchindex nach dem Update neu aufbauen, wenn das Release es verlangt."
688
+ ),
686
689
  ):
687
690
  """Update auf neue Version — Backup zuerst, immer."""
688
691
  dir = instance_dir_or_raise(dir)
@@ -714,6 +717,12 @@ def update(
714
717
  console.print("[red]⚠ Breaking Change in diesem Release.[/]")
715
718
  if meta.migration_required:
716
719
  console.print("[yellow]⚠ DB-Migration erforderlich.[/]")
720
+ reindex_needed = any(item.reindex_required for item in update_releases) or meta.reindex_required
721
+ if reindex_needed:
722
+ console.print(
723
+ "[yellow]⚠ Suchindex muss danach neu aufgebaut werden. Bis dahin liefern OAI und "
724
+ "Exporte langsamer (Aufbau aus der Datenbank).[/]"
725
+ )
717
726
  if meta.compose_revision != state.compose_revision:
718
727
  console.print(
719
728
  f"[yellow]⚠ compose.yaml wird neu generiert "
@@ -783,6 +792,12 @@ def update(
783
792
  console.rule("Changelog")
784
793
  console.print(notes)
785
794
 
795
+ if reindex_needed:
796
+ if reindex or (not yes and Confirm.ask("Suchindex jetzt neu aufbauen?", default=True)):
797
+ _run_reindex(dir)
798
+ else:
799
+ console.print("[yellow]⚠ Suchindex neu aufbauen:[/] [bold]katalon reindex[/]")
800
+
786
801
  _print_next_steps(dir, state.base_url)
787
802
 
788
803
 
@@ -866,7 +881,14 @@ def _run_reindex(dir: Path, wait: bool = True) -> None:
866
881
  raise typer.Exit(1) from exc
867
882
  bar.update(task, description="Reindex", total=bar.tasks[task].total, completed=bar.tasks[task].total)
868
883
  indexed = sum(final.indexed.values())
869
- console.print(f"[green]✔[/] Suchindex neu aufgebaut ({indexed} Datensätze).")
884
+ if not indexed:
885
+ console.print(
886
+ "[yellow]⚠[/] Reindex beendet, aber keine indizierten Datensätze erkannt — "
887
+ "bitte prüfen: [bold]katalon logs worker[/]"
888
+ )
889
+ return
890
+ per_type = ", ".join(f"{t} {n}" for t, n in final.indexed.items())
891
+ console.print(f"[green]✔[/] Suchindex neu aufgebaut ({indexed} Datensätze: {per_type}).")
870
892
 
871
893
 
872
894
  @app.command()
File without changes