ci: validate dash-app manifests in Android build - #163
Conversation
| if (!ROOT_KEYS.has(key)) errors.push(`${folder}: unknown property "${key}"`); | ||
| } | ||
| if (!Number.isInteger(m.manifestVersion) || m.manifestVersion !== 1) { | ||
| errors.push(`${folder}: manifestVersion must be 1`); |
There was a problem hiding this comment.
Why does manifest version has to be 1? If we later increase version, do we have to update that in this script too?
There was a problem hiding this comment.
Good catch — fixed in 5b8f289. Now reads \schema.properties.manifestVersion.const\ from the schema at runtime instead of hardcoding.
There was a problem hiding this comment.
I just updated this from a hard-coded value to a constant. Good catch.
| for (const key of Object.keys(m.perf)) { | ||
| if (!PERF_KEYS.has(key)) errors.push(`${folder}/perf: unknown property "${key}"`); | ||
| } | ||
| if (m.perf.gate !== undefined && !GATE_VALUES.has(m.perf.gate)) { |
There was a problem hiding this comment.
What is this perf gate thing?
There was a problem hiding this comment.
The perf block validates the optional perf-gate field that ships in #161 (the performance harness). That PR adds perf to the schema and dash-apps/README.md documents the gate values. The validator is forward-compatible - it was written against the contract that #161 establishes, so it works correctly once that PR merges.
Adds
scripts/validate-manifests.js- validates everydash-apps/web-*/manifest.jsonagainstdocs/dashapp-manifest.schema.json.Runs as a pre-build step in the Android CI workflow (which fires on every PR), catching what currently goes unnoticed:
"settngs"silently ignored by Android'signoreUnknownKeys = truesettingsentries - a misspelled setting name passes throughid/folder mismatch - logcat warning nobody seesweb-*directory with nomanifest.jsoniOS workflows are intentionally excluded as those checks would be redundant to these.
No npm dependencies. Extracts settings enum and id regex from the schema file at runtime to keep a single source of truth.
Dependencies: none (self-contained)