Skip to content

Commit 5edab10

Browse files
authored
Merge pull request #643 from MDA2AV/simplify-round-meta
Simplify rounds metadata to avoid so many conflicts
2 parents 8e3f2f9 + e0a09d4 commit 5edab10

3 files changed

Lines changed: 18 additions & 9 deletions

File tree

scripts/archive.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ print(max(ids) if ids else 0)
4444

4545
DATE=$(date +%Y-%m-%d)
4646

47-
# Read system info from current.json (written by benchmark.sh --save)
47+
# Read system info from current.json (written by benchmark.sh --save).
48+
# commit is intentionally NOT in current.json anymore (it churned per PR
49+
# and dominated merge conflicts); always derive it from git directly.
4850
CURRENT_JSON="$SITE_DATA/current.json"
51+
COMMIT=$(git -C "$ROOT_DIR" rev-parse --short HEAD 2>/dev/null || echo "unknown")
4952
if [ -f "$CURRENT_JSON" ]; then
5053
CPU=$(python3 -c "import json; print(json.load(open('$CURRENT_JSON')).get('cpu','unknown'))")
5154
CORES=$(python3 -c "import json; print(json.load(open('$CURRENT_JSON')).get('cores','unknown'))")
@@ -58,7 +61,6 @@ print(max(ids) if ids else 0)
5861
KERNEL=$(python3 -c "import json; print(json.load(open('$CURRENT_JSON')).get('kernel','unknown'))")
5962
DOCKER=$(python3 -c "import json; print(json.load(open('$CURRENT_JSON')).get('docker','unknown'))")
6063
DOCKER_RUNTIME=$(python3 -c "import json; print(json.load(open('$CURRENT_JSON')).get('docker_runtime','unknown'))")
61-
COMMIT=$(python3 -c "import json; print(json.load(open('$CURRENT_JSON')).get('commit','unknown'))")
6264
else
6365
echo "Warning: site/data/current.json not found — run benchmark.sh --save first"
6466
CPU=$(lscpu 2>/dev/null | awk -F: '/Model name/ {gsub(/^[ \t]+/, "", $2); print $2; exit}')
@@ -76,7 +78,6 @@ print(max(ids) if ids else 0)
7678
KERNEL=$(uname -r)
7779
DOCKER=$(docker version --format '{{.Server.Version}}' 2>/dev/null || echo "unknown")
7880
DOCKER_RUNTIME=$(docker info --format '{{.DefaultRuntime}}' 2>/dev/null || echo "unknown")
79-
COMMIT=$(git -C "$ROOT_DIR" rev-parse --short HEAD 2>/dev/null || echo "unknown")
8081
fi
8182

8283
# Bundle all result data into one JSON

scripts/rebuild_site_data.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import os
2020
import subprocess
2121
import sys
22-
from datetime import date
2322
from pathlib import Path
2423

2524

@@ -211,7 +210,6 @@ def sysctl(key: str) -> str | None:
211210
kernel = run(["uname", "-r"])
212211
docker_ver = run(["docker", "version", "--format", "{{.Server.Version}}"])
213212
docker_runtime = run(["docker", "info", "--format", "{{.DefaultRuntime}}"])
214-
commit = run(["git", "-C", str(root), "rev-parse", "--short", "HEAD"])
215213

216214
lo_mtu = None
217215
try:
@@ -225,8 +223,12 @@ def sysctl(key: str) -> str | None:
225223
except Exception:
226224
pass
227225

226+
# date and commit were intentionally dropped — they churned on every
227+
# /benchmark --save run and were the dominant source of merge conflicts
228+
# between concurrent PRs. archive.sh re-derives commit from git directly
229+
# at archive time; the displayed badge for the "current" round is hidden
230+
# in round-selector.html when the field is absent.
228231
out: dict = {
229-
"date": date.today().isoformat(),
230232
"cpu": cpu,
231233
"cores": cores,
232234
"threads": threads,
@@ -237,7 +239,6 @@ def sysctl(key: str) -> str | None:
237239
"docker": docker_ver,
238240
"docker_runtime": docker_runtime,
239241
"governor": governor,
240-
"commit": commit,
241242
}
242243
if ram_speed != "unknown":
243244
out["ram_speed"] = ram_speed

site/layouts/shortcodes/round-selector.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,15 @@
109109
return;
110110
}
111111

112-
// Always visible: commit + CPU
113-
commitEl.innerHTML = iconGit + ' <code style="font-size:0.75rem;background:rgba(124,58,237,0.08);padding:0.1rem 0.35rem;border-radius:3px;">' + meta.commit + '</code>';
112+
// Always visible: CPU. Commit is shown for archived rounds only — the
113+
// "current" round no longer carries a commit field (it churned per PR
114+
// and was the dominant source of merge conflicts).
115+
if (meta.commit) {
116+
commitEl.innerHTML = iconGit + ' <code style="font-size:0.75rem;background:rgba(124,58,237,0.08);padding:0.1rem 0.35rem;border-radius:3px;">' + meta.commit + '</code>';
117+
commitEl.style.display = '';
118+
} else {
119+
commitEl.style.display = 'none';
120+
}
114121
var ramInfo = meta.cores + 'C/' + (meta.threads || meta.cores) + 'T';
115122
ramInfo += ', ' + meta.ram + ' RAM';
116123
if (meta.ram_speed) ramInfo += ' @ ' + meta.ram_speed;

0 commit comments

Comments
 (0)