Check in CI that every design token resolves to a valid value
Categories
(Toolkit :: Themes, task)
Tracking
()
People
(Reporter: dao, Assigned: dao)
References
(Blocks 2 open bugs)
Details
Attachments
(3 external files)
Nothing in CI resolves the design tokens, so a token that resolves to an invalid value, a reference cycle or more than the reference depth limit lands unnoticed. browser_parsable_css.js does not catch these: a custom property accepts almost any value at parse time, and the value only turns invalid when styles are computed. Before bug 2084656, --button-text-color-menu-{hover,active,disabled,selected} resolved to light-dark(inherit, currentColor) under Nova, which is invalid, and nothing flagged it.
toolkit/themes/tools/token_resolve.py (bug 2090042) already resolves every token in every environment the generated sheets query, from the checked-in dist/ sheets, with the standard library only, in about a quarter of a second. This bug:
- adds a
--checkmode that resolves every token in every environment and exits 1 on an invalid value, a cycle or the depth limit; values that resolve empty (e.g.unset) are reported but do not fail - adds tests for
token_resolve.py, which has none, including the pre-bug 2084656 button tokens as a regression case - runs
--checkin thedesign-tokens-testssource-test aftertry-runner.js, whose freshness check makes sure thedist/sheets match the.tokens.jsonsources, and addstoolkit/themes/tools/**to the task's run-on-changes paths
Component token sheets are out of scope here.
| Assignee | ||
Comment 1•12 days ago
|
||
| Assignee | ||
Comment 2•12 days ago
|
||
Updated•8 days ago
|
Updated•8 days ago
|
| Assignee | ||
Comment 3•3 days ago
|
||
Description
•