Closed Bug 2090042 Opened 14 days ago Closed 7 days ago

Add mach commands for the desktop-theme skills' token, contrast and pixel-diff scripts

Categories

(Developer Infrastructure :: General, task)

task

Tracking

(firefox162 fixed)

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: dao, Assigned: dao)

References

(Blocks 2 open bugs)

Details

Attachments

(3 external files)

Following up on Tim's comment on https://phabricator.services.mozilla.com/D325615: some of the scripts bug 2071613 bundled with the desktop-theme skills answer questions engineers ask without an agent. Move them out of .claude/skills/ and give each a mach command, with the skills calling the commands:

  • desktop-theme-tokens/scripts/token-resolve.py: what a design token resolves to per platform, theme and forced-colors state, and which resolved values a .tokens.json edit changes. It could sit beside ./mach buildtokens.
  • desktop-theme-colors/scripts/contrast.py and pair-walk.py: WCAG contrast and system-color pair checks for a selector across states, in a running build. They launch Firefox through desktop-theme-probing/scripts/probelib.py, which moves with them.
  • desktop-theme-screenshots/scripts/pixel-diff.py: whether two screenshots differ, and where.

Which of the skills' other scripts could back CI checks is a separate question.

Depends on: 2071613
See Also: 2071613 →

A move with only the import paths fixed. The dashed names take underscores so the mach command in the next patch can import them; screen-grab.py moves too, since probelib.run_steps() runs it from its own directory.

The skills cite the old paths until the last patch of this bug points them at ./mach theme.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED

tokens passes its arguments through because token names start with --; the other subcommands parse with the script's own parser, so --help lists its flags. contrast's and pairs' --context becomes --realm, the skills' word for chrome versus content, because mach passes its own context to every handler. pixel-diff's exception handler moved into run() so an error under mach still exits 2 rather than 1, which means the captures differ.

firefox-probe.py's --context becomes --realm too, to match contrast and pairs.

Blocks: 2090765
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d06b063e93e5 https://hg.mozilla.org/integration/autoland/rev/26b922d5507b Move the desktop-theme skills' token, contrast and pixel-diff scripts into toolkit/themes/tools. r=desktop-theme-reviewers,tgiles
Keywords: leave-open
Pushed by abutkovits@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e69e981e826a https://hg.mozilla.org/integration/autoland/rev/818e9d60469d Revert "Bug 2090042 - Move the desktop-theme skills' token, contrast and pixel-diff scripts into toolkit/themes/tools. r=desktop-theme-reviewers,tgiles" for causing failures at system-color-pairs.md.
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f20a06ec2136 https://hg.mozilla.org/integration/autoland/rev/a2b9a219e7d9 Move the desktop-theme skills' token, contrast and pixel-diff scripts into toolkit/themes/tools. r=desktop-theme-reviewers,tgiles
Flags: needinfo?(dao+bmo)
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b379684cef5d https://hg.mozilla.org/integration/autoland/rev/ec0ea19774b4 Add `./mach theme` to run the token, contrast and pixel-diff tools. r=desktop-theme-reviewers,mach-reviewers,tgiles,ahochheiden https://github.com/mozilla-firefox/firefox/commit/617af0daa85e https://hg.mozilla.org/integration/autoland/rev/1cac99acfe53 Point the desktop-theme skills at `./mach theme`. r=tgiles
Keywords: leave-open
Status: ASSIGNED → RESOLVED
Closed: 7 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: