superset-showtime 0.5.3__tar.gz → 0.5.4__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.

Potentially problematic release.


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

Files changed (33) hide show
  1. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/PKG-INFO +1 -1
  2. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/showtime/__init__.py +1 -1
  3. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/showtime/core/pull_request.py +12 -6
  4. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/tests/unit/test_label_transitions.py +34 -1
  5. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/tests/unit/test_pull_request.py +6 -6
  6. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/.claude/settings.local.json +0 -0
  7. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/.gitignore +0 -0
  8. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/.pre-commit-config.yaml +0 -0
  9. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/CLAUDE.md +0 -0
  10. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/Makefile +0 -0
  11. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/README.md +0 -0
  12. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/dev-setup.sh +0 -0
  13. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/pypi-push.sh +0 -0
  14. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/pyproject.toml +0 -0
  15. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/requirements-dev.txt +0 -0
  16. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/requirements.txt +0 -0
  17. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/showtime/__main__.py +0 -0
  18. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/showtime/cli.py +0 -0
  19. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/showtime/core/__init__.py +0 -0
  20. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/showtime/core/aws.py +0 -0
  21. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/showtime/core/emojis.py +0 -0
  22. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/showtime/core/github.py +0 -0
  23. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/showtime/core/github_messages.py +0 -0
  24. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/showtime/core/label_colors.py +0 -0
  25. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/showtime/core/show.py +0 -0
  26. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/showtime/data/ecs-task-definition.json +0 -0
  27. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/tests/__init__.py +0 -0
  28. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/tests/unit/__init__.py +0 -0
  29. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/tests/unit/test_sha_specific_logic.py +0 -0
  30. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/tests/unit/test_show.py +0 -0
  31. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/uv.lock +0 -0
  32. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/workflows-reference/showtime-cleanup.yml +0 -0
  33. {superset_showtime-0.5.3 → superset_showtime-0.5.4}/workflows-reference/showtime-trigger.yml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: superset-showtime
3
- Version: 0.5.3
3
+ Version: 0.5.4
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/
@@ -4,7 +4,7 @@
4
4
  Circus tent emoji state tracking for Apache Superset ephemeral environments.
5
5
  """
6
6
 
7
- __version__ = "0.5.3"
7
+ __version__ = "0.5.4"
8
8
  __author__ = "Maxime Beauchemin"
9
9
  __email__ = "maximebeauchemin@gmail.com"
10
10
 
@@ -395,6 +395,9 @@ class PullRequest:
395
395
 
396
396
  def _determine_action(self, target_sha: str) -> str:
397
397
  """Determine what sync action is needed based on target SHA state"""
398
+ # CRITICAL: Get fresh labels before any decisions
399
+ self.refresh_labels()
400
+
398
401
  target_sha_short = target_sha[:7] # Ensure we're working with short SHA
399
402
 
400
403
  # Get the specific show for the target SHA
@@ -435,20 +438,20 @@ class PullRequest:
435
438
 
436
439
  def _atomic_claim(self, target_sha: str, action: str, dry_run: bool = False) -> bool:
437
440
  """Atomically claim this PR for the current job based on target SHA state"""
441
+ # CRITICAL: Get fresh labels before any decisions
442
+ self.refresh_labels()
443
+
438
444
  target_sha_short = target_sha[:7]
439
445
  target_show = self.get_show_by_sha(target_sha_short)
440
446
 
441
- # 1. Validate current state allows this action for target SHA
447
+ # 1. Validate current state allows this action for target SHA
442
448
  if action in ["create_environment", "rolling_update", "auto_sync"]:
443
449
  if target_show and target_show.status in [
444
450
  "building",
445
451
  "built",
446
- "deploying",
452
+ "deploying",
447
453
  ]:
448
- return False # Target SHA already in progress
449
-
450
- # Allow actions on failed, running, or non-existent target SHAs
451
- return True
454
+ return False # Target SHA already in progress - ONLY conflict case returns
452
455
 
453
456
  if dry_run:
454
457
  print(f"🎪 [DRY-RUN] Would atomically claim PR for {action}")
@@ -645,6 +648,9 @@ class PullRequest:
645
648
  Returns:
646
649
  Number of environments stopped
647
650
  """
651
+ # CRITICAL: Refresh to get current shows including newly created one
652
+ self.refresh_labels()
653
+
648
654
  stopped_count = 0
649
655
 
650
656
  for show in self.shows:
@@ -281,4 +281,37 @@ def test_status_label_identification_edge_cases():
281
281
 
282
282
  # Should not match other SHAs or malformed labels
283
283
  assert "🎪 def456a 🚦 running" not in sha_status_labels
284
- assert "🎪 abc123f🚦building" not in sha_status_labels
284
+ assert "🎪 abc123f🚦building" not in sha_status_labels
285
+
286
+
287
+ @patch('showtime.core.pull_request.get_github')
288
+ def test_atomic_claim_actually_creates_labels(mock_get_github):
289
+ """Test that atomic claim ACTUALLY creates labels, not just claims success"""
290
+ mock_github = Mock()
291
+ mock_github.get_labels.return_value = ["🎪 ⚡ showtime-trigger-start", "bug"]
292
+ mock_get_github.return_value = mock_github
293
+
294
+ pr = PullRequest(1234, ["🎪 ⚡ showtime-trigger-start", "bug"])
295
+
296
+ # Mock show creation
297
+ with patch.object(pr, '_create_new_show') as mock_create:
298
+ mock_show = Show(pr_number=1234, sha="abc123f", status="building")
299
+ mock_create.return_value = mock_show
300
+
301
+ result = pr._atomic_claim("abc123f", "create_environment", dry_run=False)
302
+
303
+ assert result is True
304
+
305
+ # The CRITICAL assertions - verify actual label operations happened
306
+ mock_github.remove_label.assert_called() # Should remove triggers
307
+ mock_github.add_label.assert_called() # Should add building labels
308
+
309
+ # Verify trigger was removed
310
+ trigger_removes = [call for call in mock_github.remove_label.call_args_list
311
+ if "showtime-trigger-start" in str(call)]
312
+ assert len(trigger_removes) > 0, "Trigger label should be removed"
313
+
314
+ # Verify building labels were added
315
+ building_adds = [call for call in mock_github.add_label.call_args_list
316
+ if "🚦 building" in str(call)]
317
+ assert len(building_adds) > 0, "Building status label should be added"
@@ -106,17 +106,17 @@ def test_pullrequest_determine_action():
106
106
  pr_start = PullRequest(1234, ["🎪 ⚡ showtime-trigger-start"])
107
107
  assert pr_start._determine_action("abc123f") == "create_environment"
108
108
 
109
- # Start trigger, same SHA - no action
109
+ # Start trigger, same SHA - force rebuild with trigger
110
110
  pr_same = PullRequest(
111
111
  1234, ["🎪 ⚡ showtime-trigger-start", "🎪 abc123f 🚦 running", "🎪 🎯 abc123f"]
112
112
  )
113
- assert pr_same._determine_action("abc123f") == "no_action"
113
+ assert pr_same._determine_action("abc123f") == "create_environment"
114
114
 
115
- # Start trigger, different SHA - rolling update
115
+ # Start trigger, different SHA - create new environment (SHA-specific logic)
116
116
  pr_update = PullRequest(
117
117
  1234, ["🎪 ⚡ showtime-trigger-start", "🎪 abc123f 🚦 running", "🎪 🎯 abc123f"]
118
118
  )
119
- assert pr_update._determine_action("def456a") == "rolling_update"
119
+ assert pr_update._determine_action("def456a") == "create_environment"
120
120
 
121
121
  # Stop trigger - destroy
122
122
  pr_stop = PullRequest(
@@ -124,9 +124,9 @@ def test_pullrequest_determine_action():
124
124
  )
125
125
  assert pr_stop._determine_action("def456a") == "destroy_environment"
126
126
 
127
- # No triggers, but environment needs update - auto sync
127
+ # No triggers, but different SHA - create new environment (SHA-specific)
128
128
  pr_auto = PullRequest(1234, ["🎪 abc123f 🚦 running", "🎪 🎯 abc123f"])
129
- assert pr_auto._determine_action("def456a") == "auto_sync"
129
+ assert pr_auto._determine_action("def456a") == "create_environment"
130
130
 
131
131
  # Failed environment, no triggers - create new (retry logic)
132
132
  pr_failed = PullRequest(1234, ["🎪 abc123f 🚦 failed", "🎪 🎯 abc123f"])