Implement ProgCode identity and real shared reading UI kit
Build and deploy / deploy (push) Successful in 2m39s
Build and deploy / deploy (push) Successful in 2m39s
This commit is contained in:
1 parent
99c848189e
commit
12562baeb5
2040 files changed
+184656
-181
No files matched your search
BIN
Binary file not shown.
|
After Width: | Height: | Size: 73 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 61 KiB |
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"from": "/tmp/progcode-ds-frozen-f5d927948163",
|
||||
"to": "/tmp/progcode-ds-frozen-7b11bf22fd24",
|
||||
"HTMLBodyExcludingScriptsEqual": 85,
|
||||
"sameHTMLPathSet": true,
|
||||
"jsByteDigestsEqual": 16,
|
||||
"cssByteDigestsEqual": 1,
|
||||
"brand/favicon.ico": {
|
||||
"oldSHA": "2a1897ca40ca198d5495c216f10c7562ae6a29bc9977ff35fd1fe4abe8e5ea1d",
|
||||
"newSHA": "a601ebab472c9226fdc0926243ec8abbfde1750ef423a1016ee7e48b07d2f775"
|
||||
},
|
||||
"build-identity.json": {
|
||||
"oldSHA": "f77422309777e3f5d36876cf48c728bb8f41e482d3a2fd5a7f3a0d18100495b3",
|
||||
"newSHA": "c57d604d3dd7c3df96d8d9ca2ce80a32f9ede9f6ae0933387dbe2543781e4256"
|
||||
}
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"sourceHash": "7b11bf22fd246c6a6332a2d23fc011de1796bdd819ed2696fcad19c50772d9f7",
|
||||
"baselineCommit": "0458a99d3a3880a42c8d809731ce6aea09cb4342",
|
||||
"dataInputsAndPublicationReportsByteIdentical": 6,
|
||||
"oldHTMLRoutesPreserved": 81,
|
||||
"newHTMLRoutes": [
|
||||
"accessibility/index.html",
|
||||
"privacy/index.html",
|
||||
"sources/index.html",
|
||||
"ui-kit/index.html"
|
||||
],
|
||||
"canonicalLegacyArticleBodiesByteIdentical": 28,
|
||||
"bodyPaths": [
|
||||
"2017/05/03/привет-мир/index.html",
|
||||
"2017/05/04/компиляция-64-x-разрядных-программ-на-dmd-по/index.html",
|
||||
"2017/05/20/вирус-самопроизвольный-запуск-брауз/index.html",
|
||||
"2017/05/23/особенности-vibe-d/index.html",
|
||||
"2017/05/26/новый-движок-ctfe/index.html",
|
||||
"2017/06/17/пишем-аналог-функции-php-preg_match_all-на-языке-прог/index.html",
|
||||
"2017/06/24/dconf-2017-под-капотом-мусорщика-ди-дмитрий-ол/index.html",
|
||||
"2017/07/12/ошибка-php-ssl-certificate-error-unable-to-get-local-issuer-certificate/index.html",
|
||||
"2017/08/04/firefox-увеличение-ожидания-загрузки-timeout-стр/index.html",
|
||||
"2017/08/14/bitrix-api-создание-добавление-торгового-пре/index.html",
|
||||
"2017/08/15/bitrix-api-функция-для-генерации-кода-элемент/index.html",
|
||||
"2017/08/25/о-tilix-и-d-интервью-с-геральдом-нанном/index.html",
|
||||
"2018/10/19/bitrix-api-add-foto-editor/index.html",
|
||||
"2019/01/12/использование-jquery-в-webpack/index.html",
|
||||
"articles/bitrix-api-add-foto-editor/index.html",
|
||||
"articles/bitrix-api-создание-добавление-торгового-пре/index.html",
|
||||
"articles/bitrix-api-функция-для-генерации-кода-элемент/index.html",
|
||||
"articles/dconf-2017-под-капотом-мусорщика-ди-дмитрий-ол/index.html",
|
||||
"articles/firefox-увеличение-ожидания-загрузки-timeout-стр/index.html",
|
||||
"articles/вирус-самопроизвольный-запуск-брауз/index.html",
|
||||
"articles/использование-jquery-в-webpack/index.html",
|
||||
"articles/компиляция-64-x-разрядных-программ-на-dmd-по/index.html",
|
||||
"articles/новый-движок-ctfe/index.html",
|
||||
"articles/о-tilix-и-d-интервью-с-геральдом-нанном/index.html",
|
||||
"articles/особенности-vibe-d/index.html",
|
||||
"articles/ошибка-php-ssl-certificate-error-unable-to-get-local-issuer-certificate/index.html",
|
||||
"articles/пишем-аналог-функции-php-preg_match_all-на-языке-прог/index.html",
|
||||
"articles/привет-мир/index.html"
|
||||
],
|
||||
"dateElementsCompared": 146,
|
||||
"dateTextMismatches": [],
|
||||
"allDateTextAndISOEqual": true,
|
||||
"historicalMediaByteIdentical": 11,
|
||||
"media": [
|
||||
"visuals/v2/tilix-sessions.svg",
|
||||
"visuals/v2/bitrix-product-offer.svg",
|
||||
"visuals/v2/d-gc-pools.svg",
|
||||
"visuals/v2/ctfe-execution.svg",
|
||||
"visuals/v2/bitrix-file-preview.jpg",
|
||||
"visuals/v2/d-gc-reachability.svg",
|
||||
"visuals/v2/ctfe-overview.svg",
|
||||
"visuals/v2/tls-trust-chain.svg",
|
||||
"visuals/v2/bitrix-file-input.svg",
|
||||
"visuals/v2/vibed-fiber-io.svg",
|
||||
"visuals/v2/windows-browser-task.svg"
|
||||
],
|
||||
"sourceHelperIncludesFSDAndAllPublic": true,
|
||||
"wholeHTMLParityClaimed": false
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"cases":[{"id":"uikit","path":"/ui-kit/","width":390,"theme":"dark","status":200,"scroll":390,"h1":"Компоненты ProgCode.","footer":"Заметки о том, как устроен код.\nD, PHP, Bitrix и веб-разработка.\n\nВсе статьи\nИсточники и редактура\nПриватность\nДоступность и чтение\nКомпоненты ProgCode\nМатериалы 2017–2019"},{"id":"tilix","path":"/articles/о-tilix-и-d-интервью-с-геральдом-нанном/","width":1440,"theme":"light","status":200,"scroll":1440,"h1":"О Tilix и D: интервью с Геральдом Нанном","footer":"Заметки о том, как устроен код.\nD, PHP, Bitrix и веб-разработка.\n\nВсе статьи\nИсточники и редактура\nПриватность\nДоступность и чтение\nКомпоненты ProgCode\nМатериалы 2017–2019"},{"id":"accessibility","path":"/accessibility/","width":320,"theme":"dark","status":200,"scroll":320,"h1":"Настроить чтение\nпод себя.","footer":"Заметки о том, как устроен код.\nD, PHP, Bitrix и веб-разработка.\n\nВсе статьи\nИсточники и редактура\nПриватность\nДоступность и чтение\nКомпоненты ProgCode\nМатериалы 2017–2019"},{"id":"resources","path":"/resources/","width":320,"theme":"light","status":200,"scroll":320,"h1":"Сначала —\nпервоисточник.","footer":"Заметки о том, как устроен код.\nD, PHP, Bitrix и веб-разработка.\n\nВсе статьи\nИсточники и редактура\nПриватность\nДоступность и чтение\nКомпоненты ProgCode\nМатериалы 2017–2019"}],"errors":[],"external":[],"identity":{"sourceHash":"7b11bf22fd246c6a6332a2d23fc011de1796bdd819ed2696fcad19c50772d9f7","articles":14}}
|
||||
@@ -0,0 +1 @@
|
||||
async(page)=>{const base='http://127.0.0.1:55653',out={cases:[],errors:[],external:[]};page.on('pageerror',e=>out.errors.push(String(e)));page.on('request',r=>{if(!r.url().startsWith(base)&&!r.url().startsWith('data:'))out.external.push(r.url());});for(const [id,path,width,theme]of[['uikit','/ui-kit/',390,'dark'],['tilix','/articles/о-tilix-и-d-интервью-с-геральдом-нанном/',1440,'light'],['accessibility','/accessibility/',320,'dark'],['resources','/resources/',320,'light']]){await page.setViewportSize({width,height:1000});await page.emulateMedia({reducedMotion:'reduce',colorScheme:theme});const r=await page.goto(base+path,{waitUntil:'networkidle'});await page.getByLabel('Тема',{exact:true}).selectOption(theme);await page.evaluate(()=>document.fonts.ready);let data=await page.evaluate(()=>({width:innerWidth,scroll:document.documentElement.scrollWidth,h1:document.querySelector('h1').innerText,footer:document.querySelector('footer').innerText}));out.cases.push({id,path,width,theme,status:r.status(),...data});await page.screenshot({path:'/tmp/progcode-ds-cm-f6/'+id+'-'+width+'-'+theme+'-top.png'});if(id==='uikit'){await page.locator('.uikit-native').scrollIntoViewIfNeeded();await page.locator('.uikit-native img').evaluateAll(async es=>{await Promise.all(es.map(e=>e.decode()));});await page.screenshot({path:'/tmp/progcode-ds-cm-f6/uikit-native-390-dark.png'});}if(id==='accessibility'){await page.evaluate(()=>window.scrollTo({top:document.body.scrollHeight,behavior:'instant'}));await page.screenshot({path:'/tmp/progcode-ds-cm-f6/accessibility-footer-320-dark.png'});}}out.identity=await page.evaluate(async()=>await(await fetch('/build-identity.json')).json());return out;}
|
||||
@@ -0,0 +1,67 @@
|
||||
[
|
||||
{
|
||||
"file": "source-bounds-own.json",
|
||||
"bytes": 369,
|
||||
"sha256": "31550b61387d0660376d8dee0f3c46806c8f01882446ab1d21c40a5dd69a003d"
|
||||
},
|
||||
{
|
||||
"file": "verify-preservation-own.py",
|
||||
"bytes": 3033,
|
||||
"sha256": "5d24a61532b282ed03b659c6bb7fcfc5798ba8b400c9e9d59b0a3d730794b20b"
|
||||
},
|
||||
{
|
||||
"file": "fresh.js",
|
||||
"bytes": 1724,
|
||||
"sha256": "a95a493fa3934e3c28364874842bc4fd9d2912d8b3eb6385a39189d324b5d0d4"
|
||||
},
|
||||
{
|
||||
"file": "uikit-390-dark-top.png",
|
||||
"bytes": 61866,
|
||||
"sha256": "c3e021f38526387e8e637bb69e2cccfe4428a46c12021fa25577615b4d2da152"
|
||||
},
|
||||
{
|
||||
"file": "accessibility-320-dark-top.png",
|
||||
"bytes": 75196,
|
||||
"sha256": "b19ae81393a92fd2b5e504b720c48ddf69fec8c1540d2ebc44438f11d7d1a04f"
|
||||
},
|
||||
{
|
||||
"file": "resources-320-light-top.png",
|
||||
"bytes": 58115,
|
||||
"sha256": "35483142966f5125f0068e4830899acfc5684c38c250cd84aa9a0d84cc10b793"
|
||||
},
|
||||
{
|
||||
"file": "accessibility-footer-320-dark.png",
|
||||
"bytes": 61959,
|
||||
"sha256": "40fc2560bbe72bff7186cd4ecbbba90a93dff257e045949c8290e1826eda8bc8"
|
||||
},
|
||||
{
|
||||
"file": "tilix-1440-light-top.png",
|
||||
"bytes": 190534,
|
||||
"sha256": "28a87473318e4a5f7f7063c6a8b0715d4243c4198b203935fe4020b79c42bde7"
|
||||
},
|
||||
{
|
||||
"file": "bounds-own.json",
|
||||
"bytes": 611,
|
||||
"sha256": "dec3cc1af6d2d6b5e7f181cb627af2b6880d4a6e214711954058d641a08cc632"
|
||||
},
|
||||
{
|
||||
"file": "fresh-output.json",
|
||||
"bytes": 2035,
|
||||
"sha256": "49a5c3b51323a3ff8efaef73053d77170cffa3b3f315a3937fd2a5d747990990"
|
||||
},
|
||||
{
|
||||
"file": "preservation-stdout.json",
|
||||
"bytes": 3324,
|
||||
"sha256": "7e8761a2df737f690e026877395017cdbafb5c392a11d2e01ae7b3d924f67871"
|
||||
},
|
||||
{
|
||||
"file": "uikit-native-390-dark.png",
|
||||
"bytes": 61866,
|
||||
"sha256": "c3e021f38526387e8e637bb69e2cccfe4428a46c12021fa25577615b4d2da152"
|
||||
},
|
||||
{
|
||||
"file": "f6-preservation.json",
|
||||
"bytes": 3538,
|
||||
"sha256": "7410e09059366565c4d88996d5ca5b94fc906d8c8283e31f03c1ed899ce19843"
|
||||
}
|
||||
]
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"sourceHash": "7b11bf22fd246c6a6332a2d23fc011de1796bdd819ed2696fcad19c50772d9f7", "baselineCommit": "0458a99d3a3880a42c8d809731ce6aea09cb4342", "dataInputsAndPublicationReportsByteIdentical": 6, "oldHTMLRoutesPreserved": 81, "newHTMLRoutes": ["accessibility/index.html", "privacy/index.html", "sources/index.html", "ui-kit/index.html"], "canonicalLegacyArticleBodiesByteIdentical": 28, "bodyPaths": ["2017/05/03/привет-мир/index.html", "2017/05/04/компиляция-64-x-разрядных-программ-на-dmd-по/index.html", "2017/05/20/вирус-самопроизвольный-запуск-брауз/index.html", "2017/05/23/особенности-vibe-d/index.html", "2017/05/26/новый-движок-ctfe/index.html", "2017/06/17/пишем-аналог-функции-php-preg_match_all-на-языке-прог/index.html", "2017/06/24/dconf-2017-под-капотом-мусорщика-ди-дмитрий-ол/index.html", "2017/07/12/ошибка-php-ssl-certificate-error-unable-to-get-local-issuer-certificate/index.html", "2017/08/04/firefox-увеличение-ожидания-загрузки-timeout-стр/index.html", "2017/08/14/bitrix-api-создание-добавление-торгового-пре/index.html", "2017/08/15/bitrix-api-функция-для-генерации-кода-элемент/index.html", "2017/08/25/о-tilix-и-d-интервью-с-геральдом-нанном/index.html", "2018/10/19/bitrix-api-add-foto-editor/index.html", "2019/01/12/использование-jquery-в-webpack/index.html", "articles/bitrix-api-add-foto-editor/index.html", "articles/bitrix-api-создание-добавление-торгового-пре/index.html", "articles/bitrix-api-функция-для-генерации-кода-элемент/index.html", "articles/dconf-2017-под-капотом-мусорщика-ди-дмитрий-ол/index.html", "articles/firefox-увеличение-ожидания-загрузки-timeout-стр/index.html", "articles/вирус-самопроизвольный-запуск-брауз/index.html", "articles/использование-jquery-в-webpack/index.html", "articles/компиляция-64-x-разрядных-программ-на-dmd-по/index.html", "articles/новый-движок-ctfe/index.html", "articles/о-tilix-и-d-интервью-с-геральдом-нанном/index.html", "articles/особенности-vibe-d/index.html", "articles/ошибка-php-ssl-certificate-error-unable-to-get-local-issuer-certificate/index.html", "articles/пишем-аналог-функции-php-preg_match_all-на-языке-прог/index.html", "articles/привет-мир/index.html"], "dateElementsCompared": 146, "dateTextMismatches": [], "allDateTextAndISOEqual": true, "historicalMediaByteIdentical": 11, "media": ["visuals/v2/tilix-sessions.svg", "visuals/v2/bitrix-product-offer.svg", "visuals/v2/d-gc-pools.svg", "visuals/v2/ctfe-execution.svg", "visuals/v2/bitrix-file-preview.jpg", "visuals/v2/d-gc-reachability.svg", "visuals/v2/ctfe-overview.svg", "visuals/v2/tls-trust-chain.svg", "visuals/v2/bitrix-file-input.svg", "visuals/v2/vibed-fiber-io.svg", "visuals/v2/windows-browser-task.svg"], "sourceHelperIncludesFSDAndAllPublic": true, "wholeHTMLParityClaimed": false}
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 57 KiB |
+11
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"oldSource": "f5d92794816398171b68a1d374b24bd0cd9ea0f85d005c7be92369b40d314900",
|
||||
"newSource": "7b11bf22fd246c6a6332a2d23fc011de1796bdd819ed2696fcad19c50772d9f7",
|
||||
"samePathSet": true,
|
||||
"inputCount": 230,
|
||||
"onlyChangedSourceInput": [
|
||||
"public/brand/favicon.ico"
|
||||
],
|
||||
"unchangedSourceInputCount": 229,
|
||||
"actualCurrentSourceFilesMatchingNewManifest": 230
|
||||
}
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 186 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
+32
@@ -0,0 +1,32 @@
|
||||
import re,json,subprocess,argparse
|
||||
from pathlib import Path
|
||||
from html.parser import HTMLParser
|
||||
r=Path('/Users/gavrilovdev/tmp/progcode.ru');w=r/'web';base=Path('/tmp/progcode-metrika-frozen-527ea7bf774e');parser=argparse.ArgumentParser();parser.add_argument('--candidate',type=Path,default=Path('/tmp/progcode-ds-frozen-f5d927948163'));args=parser.parse_args();new=args.candidate;source=json.loads((new/'build-identity.json').read_text())['sourceHash'];out=Path('/tmp/progcode-ds-cm-f6')/source[:12];out.mkdir(parents=True,exist_ok=True)
|
||||
for name in ['articles-v2.json','articles.json','publication-report.json','archive-routes.json','shortlinks.json','figure-placements.json']:
|
||||
assert subprocess.run(['git','show','0458a99:web/data/'+name],cwd=r,capture_output=True,check=True).stdout==(w/'data'/name).read_bytes(),name
|
||||
oldpages={p.relative_to(base) for p in base.rglob('*.html')};newpages={p.relative_to(new) for p in new.rglob('*.html')};assert oldpages<=newpages
|
||||
class Times(HTMLParser):
|
||||
def __init__(self,text):super().__init__();self.current=None;self.values=[];self.feed(text)
|
||||
def handle_starttag(self,tag,attrs):
|
||||
if tag=='time':self.current=[dict(attrs).get('datetime'),'']
|
||||
def handle_data(self,text):
|
||||
if self.current is not None:self.current[1]+=text
|
||||
def handle_endtag(self,tag):
|
||||
if tag=='time' and self.current is not None:self.values.append(tuple(self.current));self.current=None
|
||||
|
||||
def inner(html):
|
||||
m=re.search(r'<div\b[^>]*class="[^"]*\barticle-content\b[^"]*"[^>]*>',html);assert m
|
||||
start=m.end();depth=1
|
||||
for tag in re.finditer(r'</?div\b[^>]*>',html[start:]):
|
||||
depth+=-1 if tag.group().startswith('</') else 1
|
||||
if depth==0:return html[start:start+tag.start()]
|
||||
raise AssertionError('Unclosed body')
|
||||
compared=[];times=0;dateMismatches=[]
|
||||
for path in sorted(oldpages):
|
||||
old=(base/path).read_text();newtext=(new/path).read_text();ot=Times(old).values;nt=Times(newtext).values;dateMismatches.extend([{'path':str(path),'old':a,'new':b} for a,b in zip(ot,nt) if a!=b]);assert len(ot)==len(nt);times+=len(ot)
|
||||
if 'class="article-shell"' in old:assert inner(old)==inner(newtext),str(path);compared.append(str(path))
|
||||
media=[]
|
||||
for p in (base/'visuals').rglob('*'):
|
||||
if p.is_file():q=p.relative_to(base);assert p.read_bytes()==(new/q).read_bytes();media.append(str(q))
|
||||
report={'sourceHash':json.loads((new/'build-identity.json').read_text())['sourceHash'],'baselineCommit':'0458a99d3a3880a42c8d809731ce6aea09cb4342','dataInputsAndPublicationReportsByteIdentical':6,'oldHTMLRoutesPreserved':len(oldpages),'newHTMLRoutes':sorted(str(p) for p in newpages-oldpages),'canonicalLegacyArticleBodiesByteIdentical':len(compared),'bodyPaths':compared,'dateElementsCompared':times,'dateTextMismatches':dateMismatches,'allDateTextAndISOEqual':not dateMismatches,'historicalMediaByteIdentical':len(media),'media':media,'sourceHelperIncludesFSDAndAllPublic':True,'wholeHTMLParityClaimed':False}
|
||||
(out/'preservation.json').write_text(json.dumps(report,ensure_ascii=False,indent=2)+'\n');print(json.dumps(report,ensure_ascii=False))
|
||||
Reference in new issue
Block a user