109 lines
9.5 KiB
YAML
109 lines
9.5 KiB
YAML
name: Metadata integrity checks
|
|
on:
|
|
push:
|
|
branches: [main, 'codex/**']
|
|
jobs:
|
|
metadata:
|
|
runs-on: ces-control
|
|
env:
|
|
ARCHIVE_SHA: ${{ github.sha }}
|
|
PYTHONDONTWRITEBYTECODE: '1'
|
|
steps:
|
|
- name: Verify metadata storage and query commands
|
|
run: |
|
|
python3 -B - <<'PY'
|
|
import gzip, io, json, os, pathlib, re, subprocess, tarfile, tempfile, urllib.request
|
|
sha = os.environ['ARCHIVE_SHA']
|
|
if not re.fullmatch(r'[0-9a-fA-F]{40,64}', sha):
|
|
raise SystemExit('Invalid source commit')
|
|
# Public repository archive: no owner credentials or runner SSH keys.
|
|
url = 'https://gitea.entroia.com/Zayden-Jung/paper-atlas/archive/' + sha + '.tar.gz'
|
|
with urllib.request.urlopen(url, timeout=60) as response:
|
|
archive = response.read(16*1024*1024+1)
|
|
if len(archive)>16*1024*1024:
|
|
raise SystemExit('Unexpectedly large source archive')
|
|
with tempfile.TemporaryDirectory(prefix='paper-atlas-ci-') as tmp:
|
|
root = pathlib.Path(tmp)
|
|
with tarfile.open(fileobj=io.BytesIO(archive), mode='r:gz') as tar:
|
|
tar.extractall(root, filter='data')
|
|
candidates = list(root.glob('*/pyproject.toml'))
|
|
if len(candidates)!=1:
|
|
raise SystemExit('Unexpected repository archive layout')
|
|
src = candidates[0].parent
|
|
# Build and installation checks run only on the approved remote runner.
|
|
venv = root / 'venv'
|
|
subprocess.run(['python3','-B','-m','venv','--system-site-packages',str(venv)],check=True)
|
|
python = str(venv / 'bin/python')
|
|
subprocess.run([python,'-B','-m','pip','install','--only-binary=:all:','--no-compile','psycopg[binary]==3.3.8'],check=True)
|
|
testenv = os.environ.copy()
|
|
service_file = pathlib.Path('/etc/paper-atlas/pg_service.conf')
|
|
if service_file.is_file():
|
|
testenv.update(PGSERVICEFILE=str(service_file),PAPER_ATLAS_TEST_PG_SERVICE='foundry-research')
|
|
subprocess.run([python,'-B','-m','unittest','discover','-s','tests','-t','.','-v'],cwd=src,env=testenv,check=True)
|
|
wheels = root / 'wheels'
|
|
subprocess.run([python,'-B','-m','pip','wheel','--no-deps','--wheel-dir',str(wheels),str(src)],check=True)
|
|
wheel, = wheels.glob('paper_atlas-*.whl')
|
|
subprocess.run([python,'-B','-m','pip','install','--no-deps',str(wheel)],check=True)
|
|
outside = root / 'outside-checkout'
|
|
outside.mkdir()
|
|
subprocess.run([str(venv/'bin/paper-atlas'),'--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','collect','cvf','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','collect','www-archive','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','collect','aamas-proceedings','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','collect','neurips-program','--help'],cwd=outside,check=True)
|
|
neurips_snapshots = root/'neurips2026-program-snapshots'
|
|
neurips_snapshots.mkdir()
|
|
(neurips_snapshots/'program-json.response').write_bytes(gzip.decompress((src/'tests/fixtures/neurips2026-program.json.gz').read_bytes()))
|
|
(neurips_snapshots/'receipts.json').write_bytes((src/'tests/fixtures/neurips2026-receipts.json').read_bytes())
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','collect','neurips-program','--snapshots',str(neurips_snapshots),'--out',str(root/'installed-neurips2026-program')],cwd=outside,check=True)
|
|
neurips_report = json.loads((root/'installed-neurips2026-program/neurips-program-2026.json').read_text())
|
|
assert neurips_report['records'] == 9004 and len(neurips_report['held_presentations']) == 139
|
|
assert len(neurips_report['exact_duplicate_event_rows']) == 1 and neurips_report['folded_extra_presentation_rows'] == 132
|
|
assert not neurips_report['database_written'] and not neurips_report['pdfs_downloaded']
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','collect','dblp-family','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','collect','aamas-proceedings','--year','2025','--snapshots',str(src/'tests/fixtures/aamas2025'),'--out',str(root/'installed-aamas2025')],cwd=outside,check=True)
|
|
aamas2026 = json.loads(gzip.decompress((src/'tests/fixtures/aamas2026-fixture.json.gz').read_bytes()))
|
|
aamas2026_snapshots = root/'aamas2026-snapshots'
|
|
aamas2026_snapshots.mkdir()
|
|
(aamas2026_snapshots/'contents.html').write_text(aamas2026['contents'])
|
|
(aamas2026_snapshots/'receipts.json').write_text(json.dumps(aamas2026['receipts']))
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','collect','aamas-proceedings','--year','2026','--snapshots',str(aamas2026_snapshots),'--out',str(root/'installed-aamas2026')],cwd=outside,check=True)
|
|
aamas2026_report = json.loads((root/'installed-aamas2026/aamas-proceedings-2026.json').read_text())
|
|
assert aamas2026_report['records'] == 639 and len(aamas2026_report['held_publications']) == 1
|
|
assert aamas2026_report['status_counts'] == {'accepted': 638, 'withdrawn': 1}
|
|
assert not aamas2026_report['database_written'] and not aamas2026_report['pdfs_downloaded']
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','collect','iclr-archive','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','collect','acl','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','collect','springer-selected','--help'],cwd=outside,check=True)
|
|
springer = json.loads(gzip.decompress((src/'tests/fixtures/springer-aistats1993-fixture.json.gz').read_bytes()))
|
|
for group in ('toc','chapters'):
|
|
folder = root/'springer-snapshots'/group
|
|
folder.mkdir(parents=True)
|
|
for name, content in springer[group].items():
|
|
(folder/name).write_text(content)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','collect','springer-selected','--toc-snapshots',str(root/'springer-snapshots/toc'),'--chapter-snapshots',str(root/'springer-snapshots/chapters'),'--out',str(root/'installed-springer')],cwd=outside,check=True)
|
|
springer_report = json.loads((root/'installed-springer/collection-report.json').read_bytes())
|
|
assert springer_report['records'] == 49 and not springer_report['database_written']
|
|
springer_manifest, = springer_report['files']
|
|
assert springer_manifest['status'] == 'partial' and springer_manifest['missing_abstract_count'] == 0
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','maintain','postgres','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','maintain','edition-tracks','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','maintain','joint-editions','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','maintain','event-identity','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','import','records','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','import','arxiv','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','maintain','backfill','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','audit','public-openreview','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','coverage','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','audit','histories','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','audit','source-identities','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','curate','identifiers','--help'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-c','from paper_atlas.postgres.writer import PostgresStore, WriteConnection'],cwd=outside,check=True)
|
|
smoke = "from paper_atlas.db.store import Store; from paper_atlas.config import DEFAULT_REGISTRY; import json; assert {'COLM','MM','MLSys'} <= {v['acronym'] for v in json.loads(DEFAULT_REGISTRY.read_text())['venues']}; s=Store('installed.sqlite'); s.conn.close()"
|
|
subprocess.run([python,'-I','-B','-c',smoke],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','query','--db','installed.sqlite','--stats'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','annotate','init','--db','installed.sqlite'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','annotate','list','--db','installed.sqlite','--paper','1'],cwd=outside,check=True)
|
|
subprocess.run([python,'-I','-B','-m','paper_atlas','audit','histories','--db','installed.sqlite','--examples','0'],cwd=outside,check=True)
|
|
PY
|