superset-showtime 0.5.8__py3-none-any.whl → 0.5.10__py3-none-any.whl

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.

Potentially problematic release.


This version of superset-showtime might be problematic. Click here for more details.

showtime/__init__.py CHANGED
@@ -4,7 +4,7 @@
4
4
  Circus tent emoji state tracking for Apache Superset ephemeral environments.
5
5
  """
6
6
 
7
- __version__ = "0.5.8"
7
+ __version__ = "0.5.10"
8
8
  __author__ = "Maxime Beauchemin"
9
9
  __email__ = "maximebeauchemin@gmail.com"
10
10
 
showtime/cli.py CHANGED
@@ -815,6 +815,31 @@ def cleanup(
815
815
  p(f"❌ Cleanup failed: {e}")
816
816
 
817
817
 
818
+ @app.command()
819
+ def git_check() -> None:
820
+ """🔍 Test Git SHA validation locally"""
821
+ from rich import print as p
822
+
823
+ from .core.git_validation import REQUIRED_SHA, validate_required_sha
824
+
825
+ p("🔍 [bold blue]Testing Git SHA Validation[/bold blue]")
826
+ p(f"Required SHA: [cyan]{REQUIRED_SHA}[/cyan]")
827
+
828
+ try:
829
+ is_valid, error_msg = validate_required_sha()
830
+
831
+ if is_valid:
832
+ p(
833
+ "✅ [bold green]Validation PASSED[/bold green] - Required commit found in Git history"
834
+ )
835
+ else:
836
+ p("❌ [bold red]Validation FAILED[/bold red]")
837
+ p(f"Error: {error_msg}")
838
+
839
+ except Exception as e:
840
+ p(f"❌ [bold red]Validation ERROR[/bold red]: {e}")
841
+
842
+
818
843
  def main() -> None:
819
844
  """Main entry point for the CLI"""
820
845
  app()
@@ -16,7 +16,8 @@ except ImportError:
16
16
 
17
17
 
18
18
  # Hard-coded required SHA - update this when needed
19
- REQUIRED_SHA = "277f03c2075a74fbafb55531054fb5083debe5cc" # Placeholder SHA for testing
19
+ # https://github.com/apache/superset/commit/47414e18d4c2980d0cc4718b3e704845f7dfd356
20
+ REQUIRED_SHA = "47414e18d4c2980d0cc4718b3e704845f7dfd356"
20
21
 
21
22
 
22
23
  class GitValidationError(Exception):
@@ -49,6 +50,7 @@ def is_git_repository(path: str = ".") -> bool:
49
50
  def validate_required_sha(required_sha: Optional[str] = None) -> Tuple[bool, Optional[str]]:
50
51
  """
51
52
  Validate that the required SHA exists in the current Git repository.
53
+ Tries to fetch the SHA from origin if validation fails in a shallow clone.
52
54
 
53
55
  Args:
54
56
  required_sha: SHA to validate (default: REQUIRED_SHA constant)
@@ -68,28 +70,40 @@ def validate_required_sha(required_sha: Optional[str] = None) -> Tuple[bool, Opt
68
70
  try:
69
71
  repo = Repo(".")
70
72
 
71
- # Check if SHA exists in repository
73
+ # First attempt: Search for SHA in git log (has to work in shallow clones where merge_base fails)
74
+ is_valid, error = _validate_sha_in_log(repo, sha_to_check)
75
+ if is_valid:
76
+ return True, None
77
+
78
+ # If validation failed, check if we're in a shallow clone and try fetching
72
79
  try:
73
- commit = repo.commit(sha_to_check)
74
-
75
- # Check if SHA is reachable from current HEAD
76
- # This ensures the required commit is in our branch history
77
- try:
78
- repo.merge_base(commit, repo.head.commit)
79
- return True, None
80
- except Exception:
81
- # SHA exists but not in current branch history
82
- return False, (
83
- f"Required commit {sha_to_check} exists but is not reachable from current HEAD. "
84
- f"Please ensure your branch includes the required commit."
85
- )
80
+ is_shallow = repo.git.rev_parse("--is-shallow-repository") == "true"
81
+ if is_shallow:
82
+ try:
83
+ print(f"🌊 Shallow clone detected, attempting to fetch {sha_to_check[:7]}...")
84
+ repo.git.fetch("origin", sha_to_check)
85
+
86
+ # Retry validation after fetch
87
+ is_valid_after_fetch, error_after_fetch = _validate_sha_in_log(
88
+ repo, sha_to_check
89
+ )
90
+ if is_valid_after_fetch:
91
+ print(f" Successfully fetched and validated {sha_to_check[:7]}")
92
+ return True, None
93
+ else:
94
+ return False, error_after_fetch
95
+
96
+ except Exception as fetch_error:
97
+ return False, (
98
+ f"Required commit {sha_to_check} not found in shallow clone. "
99
+ f"Failed to fetch from origin: {fetch_error}"
100
+ )
101
+ else:
102
+ return False, error
86
103
 
87
104
  except Exception:
88
- # SHA doesn't exist in repository
89
- return False, (
90
- f"Required commit {sha_to_check} not found in repository. "
91
- f"Please update to a branch that includes this commit."
92
- )
105
+ # If shallow check fails, return original error
106
+ return False, error
93
107
 
94
108
  except InvalidGitRepositoryError:
95
109
  return False, "Current directory is not a Git repository"
@@ -97,6 +111,21 @@ def validate_required_sha(required_sha: Optional[str] = None) -> Tuple[bool, Opt
97
111
  return False, f"Git validation error: {e}"
98
112
 
99
113
 
114
+ def _validate_sha_in_log(repo: "Repo", sha_to_check: str) -> Tuple[bool, Optional[str]]:
115
+ """Helper function to validate SHA exists in git log output."""
116
+ try:
117
+ log_output = repo.git.log("--oneline", "--all")
118
+ if sha_to_check in log_output or sha_to_check[:7] in log_output:
119
+ return True, None
120
+ else:
121
+ return False, (
122
+ f"Required commit {sha_to_check} not found in Git history. "
123
+ f"Please update to a branch that includes this commit."
124
+ )
125
+ except Exception as e:
126
+ return False, f"Git log search failed: {e}"
127
+
128
+
100
129
  def get_validation_error_message(required_sha: Optional[str] = None) -> str:
101
130
  """
102
131
  Get a user-friendly error message for SHA validation failure.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: superset-showtime
3
- Version: 0.5.8
3
+ Version: 0.5.10
4
4
  Summary: 🎪 Apache Superset ephemeral environment management with circus tent emoji state tracking
5
5
  Project-URL: Homepage, https://github.com/apache/superset-showtime
6
6
  Project-URL: Documentation, https://superset-showtime.readthedocs.io/
@@ -1,17 +1,17 @@
1
- showtime/__init__.py,sha256=BG1XZS3HxkBt1uX9xaRqgw4rRho6Q6Yy3aTxcQxcPeA,448
1
+ showtime/__init__.py,sha256=r5Mw0YBgwzRCe1nzqQk2iWxvfq0ZlUB73ibq-4NfFKk,449
2
2
  showtime/__main__.py,sha256=EVaDaTX69yIhCzChg99vqvFSCN4ELstEt7Mpb9FMZX8,109
3
- showtime/cli.py,sha256=eWu6MBPo0ERc_3rYRGwg_95ZZN8uqlqORBiRAbvbCpg,30933
3
+ showtime/cli.py,sha256=8vIJT5TiqXuHDGxRBg6jV3oNv5nKrmDOs5OgltycPeI,31664
4
4
  showtime/core/__init__.py,sha256=54hbdFNGrzuNMBdraezfjT8Zi6g221pKlJ9mREnKwCw,34
5
5
  showtime/core/aws.py,sha256=uTjJAvEBQMyTccS93WZeNPhfeKQhJgOQQ0BJdnQjvCU,35007
6
6
  showtime/core/emojis.py,sha256=MHEDuPIdfNiop4zbNLuviz3eY05QiftYSHHCVbkfKhw,2129
7
- showtime/core/git_validation.py,sha256=h4MZPIaJB1KN6aO5sXf5j4IKOu5__nmZZSDRjWRoEpA,4127
7
+ showtime/core/git_validation.py,sha256=W8I9dOZiai-oDJz8LQCEyQ-94CHjfwhE4th83Vu2nQs,5450
8
8
  showtime/core/github.py,sha256=uETvKDO2Yhpqg3fxLtrKaCuZR3b-1LVmgnf5aLcqrAQ,9988
9
9
  showtime/core/github_messages.py,sha256=MfgwCukrEsWWesMsuL8saciDgP4nS-gijzu8DXr-Alg,7450
10
10
  showtime/core/label_colors.py,sha256=efhbFnz_3nqEnEqmgyF6_hZbxtCu_fmb68BIIUpSsnk,3895
11
11
  showtime/core/pull_request.py,sha256=vKlPPlIeSNT_WmlZkOekLH_tGYm4pyJUZFHQC9dVCKY,27756
12
12
  showtime/core/show.py,sha256=FpxDm52LASCJvf8UF998AtNiVzfdYIwNEsPAsOAAwL0,9701
13
13
  showtime/data/ecs-task-definition.json,sha256=Y8ZbAAXdIDMnM-8zzfdUTlwp5RpWSyhe1gtfygKkqW8,2343
14
- superset_showtime-0.5.8.dist-info/METADATA,sha256=pQD1Wr9BmGSgYwSyr17GwYpsh7QGUyFNKDmioltw08M,12052
15
- superset_showtime-0.5.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
- superset_showtime-0.5.8.dist-info/entry_points.txt,sha256=rDW7oZ57mqyBUS4N_3_R7bZNGVHB-104jwmY-hHC_ck,85
17
- superset_showtime-0.5.8.dist-info/RECORD,,
14
+ superset_showtime-0.5.10.dist-info/METADATA,sha256=xLlmWh1tonx0z3rMEEFPlRKDOmf_i8GGS5p-mFacfbc,12053
15
+ superset_showtime-0.5.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
+ superset_showtime-0.5.10.dist-info/entry_points.txt,sha256=rDW7oZ57mqyBUS4N_3_R7bZNGVHB-104jwmY-hHC_ck,85
17
+ superset_showtime-0.5.10.dist-info/RECORD,,