@@ -107,24 +107,11 @@ async def teardown(self) -> None:
107107 async def scale (self , services : Dict [str , int ]) -> None :
108108 await self ._execute_operation (_SCALE_OP , data = services )
109109
110- # Pipeline operations
111-
112110 async def start_stage (
113111 self ,
114112 stage : Union [PipelineStage , str ],
115113 profile : Optional [str ] = None ,
116114 ) -> None :
117- """Start a pipeline stage.
118-
119- Args:
120- stage: The pipeline stage to start ('prepare', 'test', or 'run').
121- profile: Optional profile name. If provided, starts the stage with
122- that profile. Required for first run after deploy.
123-
124- Raises:
125- ValidationError: If the workspace is not running or parameters are invalid.
126- NotFoundError: If the workspace is not found.
127- """
128115 if isinstance (stage , PipelineStage ):
129116 stage = stage .value
130117
@@ -137,15 +124,6 @@ async def start_stage(
137124 await self ._execute_operation (_START_PIPELINE_STAGE_OP , stage = stage )
138125
139126 async def stop_stage (self , stage : Union [PipelineStage , str ]) -> None :
140- """Stop a pipeline stage.
141-
142- Args:
143- stage: The pipeline stage to stop ('prepare', 'test', or 'run').
144-
145- Raises:
146- ValidationError: If the workspace is not running or parameters are invalid.
147- NotFoundError: If the workspace is not found.
148- """
149127 if isinstance (stage , PipelineStage ):
150128 stage = stage .value
151129
@@ -154,18 +132,6 @@ async def stop_stage(self, stage: Union[PipelineStage, str]) -> None:
154132 async def get_stage_status (
155133 self , stage : Union [PipelineStage , str ]
156134 ) -> PipelineStatusList :
157- """Get the status of a pipeline stage.
158-
159- Args:
160- stage: The pipeline stage to get status for ('prepare', 'test', or 'run').
161-
162- Returns:
163- List of PipelineStatus objects, one per replica/server.
164-
165- Raises:
166- ValidationError: If the workspace is not running or parameters are invalid.
167- NotFoundError: If the workspace is not found.
168- """
169135 if isinstance (stage , PipelineStage ):
170136 stage = stage .value
171137
@@ -179,22 +145,6 @@ async def wait_for_stage(
179145 poll_interval : float = 5.0 ,
180146 server : Optional [str ] = None ,
181147 ) -> PipelineStatusList :
182- """Wait for a pipeline stage to complete (success or failure).
183-
184- Args:
185- stage: The pipeline stage to wait for.
186- timeout: Maximum time to wait in seconds (default: 300).
187- poll_interval: Time between status checks in seconds (default: 5).
188- server: Optional server name to filter by. If None, waits for all
189- servers that have steps defined for this stage.
190-
191- Returns:
192- Final PipelineStatusList when stage completes.
193-
194- Raises:
195- TimeoutError: If the stage doesn't complete within the timeout.
196- ValidationError: If the workspace is not running.
197- """
198148 if poll_interval <= 0 :
199149 raise ValueError ("poll_interval must be greater than 0" )
200150
@@ -204,26 +154,17 @@ async def wait_for_stage(
204154 while elapsed < timeout :
205155 status_list = await self .get_stage_status (stage )
206156
207- # Filter to relevant servers for THIS stage
208- # A server is relevant for this stage if:
209- # - It has steps defined (meaning it participates in this stage)
210- # - OR it's not in 'waiting' state (meaning it has started)
211157 relevant_statuses = []
212158 for s in status_list :
213159 if server is not None :
214- # Filter by specific server
215160 if s .server == server :
216161 relevant_statuses .append (s )
217162 else :
218- # Include servers that have steps for this stage
219- # Servers with no steps and waiting state don't participate in this stage
220163 if s .steps :
221164 relevant_statuses .append (s )
222165 elif s .state != PipelineState .WAITING :
223- # Started but no steps visible yet
224166 relevant_statuses .append (s )
225167
226- # If no relevant statuses yet, keep waiting
227168 if not relevant_statuses :
228169 log .debug (
229170 "Pipeline stage '%s': no servers with steps yet, waiting..." ,
@@ -233,7 +174,6 @@ async def wait_for_stage(
233174 elapsed += poll_interval
234175 continue
235176
236- # Check if all relevant servers have completed
237177 all_completed = all (
238178 s .state
239179 in (PipelineState .SUCCESS , PipelineState .FAILURE , PipelineState .ABORTED )
@@ -244,7 +184,6 @@ async def wait_for_stage(
244184 log .debug ("Pipeline stage '%s' completed." , stage_name )
245185 return PipelineStatusList (root = relevant_statuses )
246186
247- # Log current state
248187 states = [f"{ s .server } ={ s .state .value } " for s in relevant_statuses ]
249188 log .debug (
250189 "Pipeline stage '%s' status: %s (elapsed: %.1fs)" ,
0 commit comments