Skip to content

Commit 660d307

Browse files
committed
Make registry data source revision deterministic
1 parent a8917a0 commit 660d307

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

‎scripts/generate-registry-data.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,30 @@ def merge_heads(repo_root: Path) -> list[str]:
106106
return [line.strip() for line in result.stdout.splitlines() if line.strip()]
107107

108108

109+
def git_head_revision(repo_root: Path) -> str | None:
110+
try:
111+
result = subprocess.run(
112+
["git", "rev-parse", "HEAD"],
113+
cwd=repo_root,
114+
check=True,
115+
stdout=subprocess.PIPE,
116+
stderr=subprocess.DEVNULL,
117+
text=True,
118+
)
119+
except (OSError, subprocess.CalledProcessError):
120+
return None
121+
return result.stdout.strip() or None
122+
123+
109124
def git_revision(path: Path) -> str | None:
110125
repo_root = git_repo_root(path)
111126
if repo_root is None:
112127
return None
113128

129+
revision = git_head_revision(repo_root)
130+
if revision:
131+
return revision
132+
114133
revision = git_log_revision(path, repo_root)
115134
if revision:
116135
return revision

‎src/data/registry-packages.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"publish_dry_run_command": "cd proposals/evolving-dob/evolving-dob-profile-v1 && cellc publish --dry-run",
9797
"registry_path": "proposals/evolving-dob/evolving-dob-profile-v1/registry.json",
9898
"repository": "https://github.com/CellScript-Labs/dob-evo",
99-
"source_revision": "0419bbfb451f73ecf226fd82852adb68c646cbcd",
99+
"source_revision": "432b273239ac463cb842bd1ccab5ed4697c0b7b4",
100100
"status": "active",
101101
"verify_command": "cd proposals/evolving-dob/evolving-dob-profile-v1 && cellc registry verify --live --json",
102102
"versions": [

0 commit comments

Comments
 (0)