Files
paperclip/scripts
Nicky Leach 713b3b08f0 chore(qa): add no-sudo headless Chromium provisioning script (#8349)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Visual QA and screenshot-based review depend on a working headless
browser in agent sandboxes.
> - Playwright can provide the Chromium binary, but some sandboxes lack
the host shared libraries that Chromium needs to launch.
> - Those sandboxes often do not have sudo, so `playwright install-deps`
cannot install system packages.
> - This pull request adds a user-space provisioning script for the
Chromium runtime dependency closure.
> - The benefit is that QA can bootstrap a render-capable Chromium
environment without requiring root access or changing app runtime code.

## Linked Issues or Issue Description

No public issue exists for this exact QA provisioning gap.

Problem: in no-sudo Linux sandboxes, Playwright's bundled Chromium may
fail to launch because the host is missing required shared libraries
such as libatk, libcups, libgbm, libpango, and libasound.

Expected behavior: QA agents should be able to provision a local prefix
that lets Playwright launch bundled Chromium headlessly and render text
without root access.

Related public PR: #7301 covers broader runtime tooling/dependency
setup, but this PR is a focused userspace script for the no-sudo
Chromium dependency case.

## What Changed

- Added `scripts/qa/provision-headless-chromium.sh`.
- The script downloads the dependency closure for Playwright's Ubuntu
24.04 Chromium runtime packages with `apt-get download`, extracts the
`.deb` files into a user-space prefix, and emits an env file that sets
`LD_LIBRARY_PATH` and `FONTCONFIG_FILE`.
- The script also configures extracted fonts and an isolated font cache
so headless rendering paints text.

## Verification

- Ran `bash -n scripts/qa/provision-headless-chromium.sh`.
- The handoff verification states the script was run from a clean prefix
on Ubuntu 24.04 arm64 as a non-root user, then Chromium 145 launched
headless and rendered text at 1440x900 and 390x844 in light and dark
mode.

## Risks

Low risk. This adds a standalone QA utility script and does not modify
application runtime, package manifests, CI configuration, migrations, or
production code.

## Model Used

OpenAI GPT-5 Codex, tool-enabled coding agent with shell and GitHub CLI
access. The original script was prepared by an agent workflow; Git
Expert amended public-facing references and prepared the PR.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] If this change affects the UI, I have included before/after
screenshots
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-06-19 16:55:23 -07:00
..
2026-04-09 06:14:12 -05:00