11"""Main orchestration logic for Redis release automation."""
2-
2+ import re
33from dataclasses import dataclass
44from typing import Optional
55
1111 PackageType ,
1212 ReleaseState ,
1313 ReleaseType ,
14- WorkflowConclusion ,
1514 WorkflowRun ,
1615)
1716from .state_manager import StateManager
@@ -94,13 +93,14 @@ def _get_docker_branch(self, tag: str) -> str:
9493 Returns:
9594 Branch name to use for workflow trigger
9695 """
97- # extract major.minor version from tag
96+ # Extract major.minor version from tag
9897 # examples: "8.2.1" -> "8.2", "8.4-m01" -> "8.4"
99- if "." in tag :
100- parts = tag .split ("." )
101- if len (parts ) >= 2 :
102- major_minor = f"{ parts [0 ]} .{ parts [1 ]} "
103- return f"release/{ major_minor } "
98+ match = re .match (r"^(\d+)\.(\d+)" , tag )
99+ if match :
100+ major = match .group (1 )
101+ minor = match .group (2 )
102+ major_minor = f"{ major } .{ minor } "
103+ return f"release/{ major_minor } "
104104
105105 console .print (
106106 f"[yellow]Warning: Could not determine branch for tag '{ tag } ', using 'main'[/yellow]"
@@ -219,7 +219,7 @@ def execute_release(
219219 self ._print_completed_state_phase (
220220 phase_completed = docker_state .build_completed if docker_state else False ,
221221 workflow = docker_state .build_workflow if docker_state else None ,
222- name = "Build"
222+ name = "Build" ,
223223 )
224224
225225 state_manager .save_state (state )
@@ -236,7 +236,7 @@ def execute_release(
236236 self ._print_completed_state_phase (
237237 phase_completed = docker_state .publish_completed if docker_state else False ,
238238 workflow = docker_state .publish_workflow if docker_state else None ,
239- name = "Publish"
239+ name = "Publish" ,
240240 )
241241
242242 state_manager .save_state (state )
@@ -315,7 +315,7 @@ def _execute_build_phase(
315315 state = state ,
316316 repo = repo ,
317317 orchestrator_config = self .docker_config ,
318- timeout_minutes = 45
318+ timeout_minutes = 45 ,
319319 )
320320
321321 executor = PhaseExecutor ()
@@ -338,7 +338,7 @@ def _execute_publish_phase(
338338 state = state ,
339339 repo = repo ,
340340 orchestrator_config = self .docker_config ,
341- timeout_minutes = 30 # Publish might be faster than build
341+ timeout_minutes = 30 , # Publish might be faster than build
342342 )
343343
344344 executor = PhaseExecutor ()
0 commit comments