half-orm-dev 0.17.0a3__tar.gz → 0.17.0a5__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 (65) hide show
  1. {half_orm_dev-0.17.0a3/half_orm_dev.egg-info → half_orm_dev-0.17.0a5}/PKG-INFO +1 -1
  2. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/release_manager.py +50 -5
  3. half_orm_dev-0.17.0a5/half_orm_dev/version.txt +1 -0
  4. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5/half_orm_dev.egg-info}/PKG-INFO +1 -1
  5. half_orm_dev-0.17.0a3/half_orm_dev/version.txt +0 -1
  6. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/AUTHORS +0 -0
  7. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/LICENSE +0 -0
  8. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/README.md +0 -0
  9. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/__init__.py +0 -0
  10. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/cli/__init__.py +0 -0
  11. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/cli/commands/__init__.py +0 -0
  12. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/cli/commands/apply.py +0 -0
  13. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/cli/commands/check.py +0 -0
  14. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/cli/commands/clone.py +0 -0
  15. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/cli/commands/init.py +0 -0
  16. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/cli/commands/new.py +0 -0
  17. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/cli/commands/patch.py +0 -0
  18. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/cli/commands/release.py +0 -0
  19. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/cli/commands/restore.py +0 -0
  20. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/cli/commands/sync.py +0 -0
  21. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/cli/commands/todo.py +0 -0
  22. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/cli/commands/undo.py +0 -0
  23. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/cli/commands/update.py +0 -0
  24. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/cli/commands/upgrade.py +0 -0
  25. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/cli/main.py +0 -0
  26. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/cli_extension.py +0 -0
  27. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/database.py +0 -0
  28. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/decorators.py +0 -0
  29. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/hgit.py +0 -0
  30. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/hop.py +0 -0
  31. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/manifest.py +0 -0
  32. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/modules.py +0 -0
  33. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/patch.py +0 -0
  34. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/patch_manager.py +0 -0
  35. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/patch_validator.py +0 -0
  36. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/patches/0/1/0/00_half_orm_meta.database.sql +0 -0
  37. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/patches/0/1/0/01_alter_half_orm_meta.hop_release.sql +0 -0
  38. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/patches/0/1/0/02_half_orm_meta.view.hop_penultimate_release.sql +0 -0
  39. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/patches/log +0 -0
  40. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/patches/sql/half_orm_meta.sql +0 -0
  41. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/repo.py +0 -0
  42. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/templates/.gitignore +0 -0
  43. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/templates/MANIFEST.in +0 -0
  44. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/templates/Pipfile +0 -0
  45. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/templates/README +0 -0
  46. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/templates/conftest_template +0 -0
  47. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/templates/git-hooks/pre-commit +0 -0
  48. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/templates/git-hooks/prepare-commit-msg +0 -0
  49. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/templates/init_module_template +0 -0
  50. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/templates/module_template_1 +0 -0
  51. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/templates/module_template_2 +0 -0
  52. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/templates/module_template_3 +0 -0
  53. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/templates/relation_test +0 -0
  54. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/templates/setup.py +0 -0
  55. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/templates/sql_adapter +0 -0
  56. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/templates/warning +0 -0
  57. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev/utils.py +0 -0
  58. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev.egg-info/SOURCES.txt +0 -0
  59. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev.egg-info/dependency_links.txt +0 -0
  60. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev.egg-info/requires.txt +0 -0
  61. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/half_orm_dev.egg-info/top_level.txt +0 -0
  62. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/setup.cfg +0 -0
  63. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/setup.py +0 -0
  64. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/tests/__init__.py +0 -0
  65. {half_orm_dev-0.17.0a3 → half_orm_dev-0.17.0a5}/tests/conftest.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: half_orm_dev
3
- Version: 0.17.0a3
3
+ Version: 0.17.0a5
4
4
  Summary: half_orm development Framework.
5
5
  Home-page: https://github.com/collorg/halfORM_dev
6
6
  Author: Joël Maïzi
@@ -650,6 +650,35 @@ class ReleaseManager:
650
650
 
651
651
  return patch_ids
652
652
 
653
+ def _apply_release_patches(self, version: str) -> None:
654
+ """
655
+ Apply all patches for a release version to the database.
656
+
657
+ Restores database from baseline and applies patches in order:
658
+ 1. All RC patches (rc1, rc2, etc.)
659
+ 2. Stage patches
660
+
661
+ Args:
662
+ version: Release version (e.g., "0.1.0")
663
+
664
+ Raises:
665
+ ReleaseManagerError: If patch application fails
666
+ """
667
+ # Restore database from baseline
668
+ self._repo.restore_database_from_schema()
669
+
670
+ # Apply all RC patches in order
671
+ rc_files = self.get_rc_files(version)
672
+ for rc_file in rc_files:
673
+ rc_patches = self.read_release_patches(rc_file.name)
674
+ for patch_id in rc_patches:
675
+ self._repo.patch_manager.apply_patch_files(patch_id, self._repo.model)
676
+
677
+ # Apply stage patches
678
+ stage_patches = self.read_release_patches(f"{version}-stage.txt")
679
+ for patch_id in stage_patches:
680
+ self._repo.patch_manager.apply_patch_files(patch_id, self._repo.model)
681
+
653
682
  def get_all_release_context_patches(self) -> List[str]:
654
683
  """
655
684
  Récupère TOUS les patches du contexte de la prochaine release.
@@ -2394,7 +2423,7 @@ class ReleaseManager:
2394
2423
  self._repo.hgit.merge(
2395
2424
  patch_branch,
2396
2425
  no_ff=True,
2397
- message=f"[HOP] Merge patch {patch_id} into release {version}"
2426
+ message=f"[HOP] Merge patch #{patch_id} into release %{version}"
2398
2427
  )
2399
2428
  except Exception as e:
2400
2429
  # Merge conflict - stay on release branch for resolution
@@ -2419,7 +2448,7 @@ class ReleaseManager:
2419
2448
  # 7. Commit stage file update (on ho-prod)
2420
2449
  self._repo.hgit.checkout("ho-prod")
2421
2450
  self._repo.hgit.add(str(stage_file))
2422
- self._repo.hgit.commit("-m", f"[HOP] Add patch {patch_id} to release {version} stage")
2451
+ self._repo.hgit.commit("-m", f"[HOP] Add patch #{patch_id} to release %{version} stage. Closes #{patch_id}")
2423
2452
  self._repo.hgit.push_branch("ho-prod")
2424
2453
 
2425
2454
  # 1. Delete patch branch
@@ -2520,10 +2549,13 @@ class ReleaseManager:
2520
2549
  rc_tag = f"v{version}-rc{rc_number}" # Use v prefix and rc1 for first RC
2521
2550
 
2522
2551
  try:
2523
- # Checkout release branch
2552
+ # 1. Apply patches to database (for validation)
2553
+ self._apply_release_patches(version)
2554
+
2555
+ # 2. Checkout release branch
2524
2556
  self._repo.hgit.checkout(release_branch)
2525
2557
 
2526
- # Create RC tag on release branch
2558
+ # 3. Create RC tag on release branch
2527
2559
  self._repo.hgit.create_tag(rc_tag, f"Release Candidate {version}")
2528
2560
 
2529
2561
  # Push tag
@@ -2630,7 +2662,20 @@ class ReleaseManager:
2630
2662
  "ho-prod has been restored to its previous state."
2631
2663
  )
2632
2664
 
2633
- # 3. Rename rc file to prod
2665
+ # 3. Apply patches and generate schema
2666
+ self._apply_release_patches(version)
2667
+
2668
+ # Generate schema dump for this version
2669
+ from pathlib import Path
2670
+ model_dir = Path(self._repo.base_dir) / "model"
2671
+ self._repo.database._generate_schema_sql(version, model_dir)
2672
+
2673
+ # 3.5. Commit schema files
2674
+ self._repo.hgit.add(str(model_dir / f"schema-{version}.sql"))
2675
+ self._repo.hgit.add(str(model_dir / f"metadata-{version}.sql"))
2676
+ self._repo.hgit.add(str(model_dir / "schema.sql")) # symlink
2677
+
2678
+ # 4. Rename stage file to prod
2634
2679
  prod_file = self._releases_dir / f"{version}.txt"
2635
2680
  stage_file.rename(prod_file)
2636
2681
  self._repo.hgit.add(str(stage_file)) # Old path
@@ -0,0 +1 @@
1
+ 0.17.0-a5
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: half_orm_dev
3
- Version: 0.17.0a3
3
+ Version: 0.17.0a5
4
4
  Summary: half_orm development Framework.
5
5
  Home-page: https://github.com/collorg/halfORM_dev
6
6
  Author: Joël Maïzi
@@ -1 +0,0 @@
1
- 0.17.0-a3
File without changes
File without changes