Integrate existing Metrika counter with private behavioral goals
Build and deploy / deploy (push) Successful in 38s

This commit is contained in:
huncode committed 2026-10-27 03:59:37 +03:00
1 parent 8c58a54f5b
commit 0458a99d3a
19 files changed
+355 -3

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import re,json,hashlib
from pathlib import Path
old=Path('/tmp/progcode-v2-frozen-53f217e5370e');new=Path('/Users/gavrilovdev/tmp/progcode.ru/web/out')
pages=sorted(p.relative_to(old) for p in old.rglob('*.html'))
assert set(pages)==set(p.relative_to(new) for p in new.rglob('*.html'))
def body(path):
s=path.read_text();s=re.search(r'<body[^>]*>([\s\S]*)</body>',s).group(1)
return re.sub(r'<script\b[^>]*>[\s\S]*?</script>','',s)
for p in pages:assert body(old/p)==body(new/p),str(p)
assets=[p.relative_to(old) for p in old.rglob('*') if p.is_file() and (p.suffix=='.css' or 'visuals' in p.parts)]
for p in assets:assert (old/p).read_bytes()==(new/p).read_bytes(),str(p)
h=hashlib.sha256();files=sorted(p.relative_to(new) for p in new.rglob('*') if p.is_file())
for p in files:h.update(str(p).encode());h.update((new/p).read_bytes())
report=dict(htmlBodiesCompared=len(pages),htmlBodiesByteIdenticalExcludingScripts=True,routeSetIdentical=True,cssAndMediaByteIdentical=len(assets),sourceHash=json.loads((new/'build-identity.json').read_text())['sourceHash'],buildFiles=len(files),buildHash=h.hexdigest(),baselineSource='53f217e5370ecafe41a0afcfe51fe80f2e443f04637adbe0d4f7476babe9beeb')
print(json.dumps(report,indent=2))