Pin source links to immutable revision

This commit is contained in:
snw 2026-09-23 23:52:44 +00:00
parent e8830e846a
commit 6e647fed4b

View file

@ -3,6 +3,7 @@ import os
from importlib.resources import files from importlib.resources import files
REPOSITORY = "https://git.snw.su/snw/FletAppDemo" REPOSITORY = "https://git.snw.su/snw/FletAppDemo"
DEFAULT_REVISION = "e8830e846a40a6b4484b4c07d7ec752ca0faca87"
def _manifest() -> dict[str, dict[str, str | int]]: def _manifest() -> dict[str, dict[str, str | int]]:
@ -15,6 +16,5 @@ SOURCE_MANIFEST = _manifest()
def source_url(example_id: str) -> str: def source_url(example_id: str) -> str:
anchor = SOURCE_MANIFEST[example_id] anchor = SOURCE_MANIFEST[example_id]
revision = os.getenv("FLET_GALLERY_REVISION", "main") revision = os.getenv("FLET_GALLERY_REVISION", DEFAULT_REVISION)
return f"{REPOSITORY}/src/commit/{revision}/{anchor['path']}#L{anchor['line']}" return f"{REPOSITORY}/src/commit/{revision}/{anchor['path']}#L{anchor['line']}"