@@ -27,31 +27,6 @@ def __init__(self, base_url: str) -> None:
2727 if not self .shared_secret :
2828 raise RuntimeError ("LAUNCHPAD_RPC_SHARED_SECRET must be provided or set as environment variable" )
2929
30- def assemble_size_analysis (
31- self ,
32- org : str | int ,
33- project : str | int ,
34- artifact_id : str | int ,
35- checksum : str ,
36- chunks : list [str ],
37- ) -> Dict [str , Any ]:
38- """Call the assemble size analysis endpoint."""
39- # Validate hex strings
40- if not re .match (r"^[a-fA-F0-9]+$" , checksum ):
41- raise ValueError ("Invalid checksum format" )
42- for chunk in chunks :
43- if not re .match (r"^[a-fA-F0-9]+$" , chunk ):
44- raise ValueError ("Invalid chunk format" )
45-
46- data = {
47- "checksum" : checksum ,
48- "chunks" : chunks ,
49- "assemble_type" : "size_analysis" ,
50- }
51-
52- endpoint = f"/api/0/internal/{ org } /{ project } /files/preprodartifacts/{ artifact_id } /assemble-generic/"
53- return self ._make_json_request ("POST" , endpoint , data , operation = "Assemble request" )
54-
5530 def download_artifact (self , org : str , project : str , artifact_id : str ) -> Dict [str , Any ]:
5631 """Download preprod artifact."""
5732 endpoint = f"/api/0/internal/{ org } /{ project } /files/preprodartifacts/{ artifact_id } /"
@@ -136,7 +111,7 @@ def upload_size_analysis_file(
136111 for attempt in range (max_retries ):
137112 logger .debug (f"Assembly attempt { attempt + 1 } /{ max_retries } " )
138113
139- result = self .assemble_size_analysis (
114+ result = self ._assemble_size_analysis (
140115 org = org ,
141116 project = project ,
142117 artifact_id = artifact_id ,
@@ -285,6 +260,31 @@ def _upload_chunk(self, org: str, chunk: Dict[str, Any]) -> bool:
285260 logger .error (f"Chunk upload error: { e } " )
286261 return False
287262
263+ def _assemble_size_analysis (
264+ self ,
265+ org : str | int ,
266+ project : str | int ,
267+ artifact_id : str | int ,
268+ checksum : str ,
269+ chunks : list [str ],
270+ ) -> Dict [str , Any ]:
271+ """Call the assemble size analysis endpoint."""
272+ # Validate hex strings
273+ if not re .match (r"^[a-fA-F0-9]+$" , checksum ):
274+ raise ValueError ("Invalid checksum format" )
275+ for chunk in chunks :
276+ if not re .match (r"^[a-fA-F0-9]+$" , chunk ):
277+ raise ValueError ("Invalid chunk format" )
278+
279+ data = {
280+ "checksum" : checksum ,
281+ "chunks" : chunks ,
282+ "assemble_type" : "size_analysis" ,
283+ }
284+
285+ endpoint = f"/api/0/internal/{ org } /{ project } /files/preprodartifacts/{ artifact_id } /assemble-generic/"
286+ return self ._make_json_request ("POST" , endpoint , data , operation = "Assemble request" )
287+
288288 def _create_multipart_body (self , boundary : str , filename : str , data : bytes ) -> bytes :
289289 """Create multipart/form-data body."""
290290 lines = [
0 commit comments