@@ -121,23 +121,7 @@ def v2_full_package_names(channel: str, dataset_version: str) -> tuple[str, str]
121121 return (f"{ V2_FULL_PACKAGE_BASENAME } -{ dataset_version } .zip" , f"{ V2_FULL_PACKAGE_BASENAME } -{ channel } .zip" )
122122
123123
124- def _app_version_from_hash (app_hash : str ) -> str :
125- """Derive a stable, content-addressed version identifier from an app's fingerprint hash.
126-
127- Using the content hash means the same app content always produces the same
128- versioned filename, so unchanged apps never need to be rebuilt or re-uploaded.
129- """
130- return app_hash [:16 ]
131-
132-
133- def v2_app_package_names (app_version : str ) -> tuple [str , str ]:
134- """Return (versioned_zip_name, latest_zip_name) for a single app.
135-
136- ``app_version`` should be a per-app content-derived identifier, not the
137- global publish timestamp, so that only actually-changed apps get new
138- versioned packages.
139- """
140- return (f"{ app_version } .zip" , "latest.zip" )
124+ APP_PACKAGE_NAME = "latest.zip"
141125
142126
143127def sha256_file (path : Path ) -> str :
@@ -197,30 +181,19 @@ def current_app_fingerprint(app_dir: Path) -> str:
197181 return digest .hexdigest ()
198182
199183
200- def build_app_package_entry (app_name : str , app_version : str ) -> dict :
201- versioned_name , latest_name = v2_app_package_names (app_version )
202- app_base = f"apps/{ app_name } "
203- return {
204- "versioned" : f"{ app_base } /{ versioned_name } " ,
205- "latest" : f"{ app_base } /{ latest_name } " ,
206- }
184+ def build_app_package_entry (app_name : str ) -> dict :
185+ return {"latest" : f"apps/{ app_name } /{ APP_PACKAGE_NAME } " }
207186
208187
209- def build_app_checksum_entry (app_name : str , app_version : str ) -> dict :
210- package_entry = build_app_package_entry (app_name , app_version )
211- return {
212- "versioned" : f"{ package_entry ['versioned' ]} .sha256" ,
213- "latest" : f"{ package_entry ['latest' ]} .sha256" ,
214- }
188+ def build_app_checksum_entry (app_name : str ) -> dict :
189+ return {"latest" : f"apps/{ app_name } /{ APP_PACKAGE_NAME } .sha256" }
215190
216191
217192def build_apps_index (dataset_version : str , channel : str , generated_at : str ) -> dict :
218193 apps = []
219194 for app_dir in sorted (path for path in APPS_DIR .iterdir () if path .is_dir ()):
220195 variables = load_variables_json (app_dir )
221196 app_name = app_dir .name
222- app_hash = current_app_fingerprint (app_dir )
223- app_version = _app_version_from_hash (app_hash )
224197 apps .append (
225198 {
226199 "app" : app_name ,
@@ -229,9 +202,9 @@ def build_apps_index(dataset_version: str, channel: str, generated_at: str) -> d
229202 "release" : variables .get ("release" ),
230203 "versions" : summarize_versions (variables .get ("edition" , [])),
231204 "path" : f"apps/{ app_name } " ,
232- "hash" : app_hash ,
233- "package" : build_app_package_entry (app_name , app_version ),
234- "checksum" : build_app_checksum_entry (app_name , app_version ),
205+ "hash" : current_app_fingerprint ( app_dir ) ,
206+ "package" : build_app_package_entry (app_name ),
207+ "checksum" : build_app_checksum_entry (app_name ),
235208 }
236209 )
237210
@@ -450,7 +423,7 @@ def validate_library_artifacts(output_dir: Path, manifest: dict, changed_app_nam
450423 continue
451424 package = entry .get ("package" ) or {}
452425 checksum = entry .get ("checksum" ) or {}
453- for path in (package .get ("versioned" ), package . get ( " latest" ), checksum . get ( "versioned " ), checksum .get ("latest" )):
426+ for path in (package .get ("latest" ), checksum .get ("latest" )):
454427 if not path or not (output_dir / path ).exists ():
455428 raise SystemExit (f"missing app package artifact: { entry .get ('app' )} -> { path } " )
456429
@@ -610,25 +583,16 @@ def build_v2_appstore_artifacts(
610583 if app_name not in changed_app_names :
611584 continue
612585
613- # Look up the app's content-derived version identifier from the index.
614- app_entry = next ((e for e in apps_index ["apps" ] if e ["app" ] == app_name ), None )
615- if app_entry is None :
616- continue
617- app_version = _app_version_from_hash (app_entry ["hash" ])
618- app_versioned_name , app_latest_name = v2_app_package_names (app_version )
619-
620586 app_output_dir = apps_packages_dir / app_name
621587 app_output_dir .mkdir (parents = True , exist_ok = True )
622588
623589 with tempfile .TemporaryDirectory () as tmp_dir_name :
624590 tmp_dir = Path (tmp_dir_name )
625591 app_package_root = tmp_dir / app_name
626592 shutil .copytree (app_dir , app_package_root )
627- create_zip_from_directory (app_package_root , app_output_dir / app_versioned_name )
593+ create_zip_from_directory (app_package_root , app_output_dir / APP_PACKAGE_NAME )
628594
629- shutil .copy2 (app_output_dir / app_versioned_name , app_output_dir / app_latest_name )
630- write_checksum_file (app_output_dir / app_versioned_name )
631- write_checksum_file (app_output_dir / app_latest_name )
595+ write_checksum_file (app_output_dir / APP_PACKAGE_NAME )
632596
633597 # ── library – write index, delta, manifest ───────────────
634598 write_json (library_dir / apps_index_name , apps_index )
0 commit comments