diff --git a/schemas/install-manifest.schema.json b/schemas/install-manifest.schema.json index 16fc1efb..b5dbf3fb 100644 --- a/schemas/install-manifest.schema.json +++ b/schemas/install-manifest.schema.json @@ -592,6 +592,153 @@ "minLength": 1 }, "uniqueItems": true + }, + "absent_claims": { + "description": "Cores that want this destination and have nothing held, after the cores served here: a narrowing that keeps none of those takes the first named one as a file left out, as a pack built for it lists it.", + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "name", + "system", + "required", + "reason", + "cores" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "system": { + "type": "string" + }, + "required": { + "type": "boolean" + }, + "reason": { + "enum": [ + "hash_mismatch", + "not_found", + "external", + "user_provided", + "no_platform_slug" + ] + }, + "cores": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + ] + }, + "regions": { + "description": "The regions the emulator code selects the file for. Absent when it never competes.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "argentina", + "asia", + "asia-ntsc", + "asia-pal", + "australia", + "brazil", + "canada", + "china", + "denmark", + "europe", + "finland", + "france", + "germany", + "greece", + "hong-kong", + "india", + "italy", + "japan", + "latin-america", + "mexico", + "netherlands", + "new-zealand", + "north-america", + "norway", + "oceania", + "poland", + "portugal", + "russia", + "singapore", + "south-korea", + "spain", + "sweden", + "taiwan", + "uk", + "world" + ] + }, + "minItems": 1, + "maxItems": 1000, + "uniqueItems": true + }, + "region_groups": { + "description": "Groups the file competes in as a core extra, whatever systems are chosen.", + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "minItems": 1, + "maxItems": 1000, + "uniqueItems": true + }, + "region_system_groups": { + "description": "Groups the file competes in as the platform's own declaration: present only when that system is kept.", + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "minItems": 1, + "maxItems": 1000, + "uniqueItems": true + }, + "systems": { + "description": "Every platform system that declares the file, for the installer's --system.", + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "minItems": 1, + "maxItems": 1000, + "uniqueItems": true + }, + "priority": { + "description": "The rank the code searches the file at, lower first: a world file withdraws an unmatched regional one only when it ranks no worse.", + "type": "integer" + }, + "declared_in": { + "description": "The platform systems declaring the file, when fewer than `systems`, which also names the systems whose cores read it there.", + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "uniqueItems": true + } + } + } } }, "oneOf": [ diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index 14fedc5e..bc7dc260 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -3584,5 +3584,19 @@ class AFileToSourceIsAFileNotAName(unittest.TestCase): self.assertEqual(_first_hash({}), "") + +class GeneratedArtifactsMeetTheirSchemas(unittest.TestCase): + """A manifest field added without its schema passed every local test + and failed the site deploy, which is the first run of the full check.""" + + @unittest.skipUnless(HAS_JSONSCHEMA, "needs jsonschema") + def test_the_full_schema_check_passes(self): + proc = subprocess.run( + [sys.executable, "scripts/validate_schemas.py"], cwd=ROOT, + capture_output=True, text=True, timeout=600, + ) + self.assertEqual(proc.returncode, 0, proc.stdout + proc.stderr) + + if __name__ == "__main__": unittest.main()