feat: ship lean runtime bundles and attributable update progress
This commit is contained in:
@@ -40,7 +40,7 @@ def extract_archive(bundle, root):
|
||||
with bundle.open(entry, 'r') as source, open(filesystem_path(target), 'wb') as destination:
|
||||
shutil.copyfileobj(source, destination)
|
||||
|
||||
for kind, root_key in [('portable', 'portableRoot'), ('source', 'sourceRoot')]:
|
||||
for kind, root_key in [('portable', 'portableRoot'), ('source', 'sourceRoot')] + ([('evidence', 'evidenceRoot')] if 'evidenceRoot' in release else []):
|
||||
root = Path(release[root_key]).resolve()
|
||||
archive = Path(release[kind]['path']).resolve()
|
||||
assert root.is_relative_to(release_dir) and archive.is_relative_to(release_dir)
|
||||
@@ -49,7 +49,12 @@ for kind, root_key in [('portable', 'portableRoot'), ('source', 'sourceRoot')]:
|
||||
assert hashlib.sha256(archive_bytes).hexdigest() == release[kind]['sha256']
|
||||
manifest = json.loads((root / 'MANIFEST.json').read_text(encoding='utf-8'))
|
||||
version = version or manifest['version']
|
||||
assert manifest['version'] == version and manifest['kind'] == kind
|
||||
if kind == 'evidence':
|
||||
assert manifest['app'] == 'agent-workbench-evidence'
|
||||
assert manifest['sourceCommit'] == release['documentation']['sourceCommit']
|
||||
assert hashlib.sha256((root / 'MANIFEST.json').read_bytes()).hexdigest() == release['documentation']['evidenceManifestSha256']
|
||||
else:
|
||||
assert manifest['version'] == version and manifest['kind'] == kind
|
||||
expected = {entry['path']: entry for entry in manifest['files']}
|
||||
assert len(expected) == len(manifest['files'])
|
||||
with zipfile.ZipFile(archive) as bundle:
|
||||
|
||||
Reference in New Issue
Block a user