Image: the stylesheet stage copies all of src, so a translation-only commit rebuilds the CSS #1142

Closed
opened 2026-10-31 03:04:19 +00:00 by tiagoagueda · 0 comments
Owner

What exists today

docker/Dockerfile:32-33 copies assets and the whole of src into the styles stage before npm run build:css at :38. Tailwind only needs what assets/css/app.css scans: @source "../../src/postulo" (:96) with @source not for src/postulo/locale and src/postulo/plugins/*/locale (:135-136), the document themes (:117) and static/css (:126). The excluded catalogues still sit in the copied tree, so a change to any .po file changes the layer's key and the CSS is rebuilt.

Correction to the candidate: Python and template changes are scanned too (@source covers every file under src/postulo), so they must rebuild it; only the locale directories can be left out. The win is small, and smaller still once #1033 item 4 moves this stage to $BUILDPLATFORM (the 38 s becomes a few seconds).

What would change

Copy what Tailwind reads and leave the catalogues out: COPY --exclude=src/postulo/locale --exclude=src/postulo/plugins/*/locale src ./src (the --exclude flag of the Dockerfile frontend; check that the BuildKit on the runner supports it, or pin the frontend with a # syntax=docker/dockerfile:1 line). The @source not lines stay, so a local npm run build:css behaves the same.

What it saves or protects

small: npm run build:css (38 s of arm64 under QEMU per #1033's table, seconds natively) skipped on catalogue-only commits: 59 of the 707 commits on main since 2026-09-30 that touched src changed only .po files or locale/

Accessibility

none

Decisions

  • Own pull request, or with #1033 item 4? Recommended: land it in the same pull request as #1033 item 4, since both edit the styles stage; file it as its own issue so it is not lost, and link the two.

Found by the efficiency and reliability audit of 2026-10-30 (finding I6; index postulo/postulo#1108). Checked against main at daee30b15 (2026-10-30).

## What exists today `docker/Dockerfile:32-33` copies `assets` and the whole of `src` into the `styles` stage before `npm run build:css` at `:38`. Tailwind only needs what `assets/css/app.css` scans: `@source "../../src/postulo"` (`:96`) with `@source not` for `src/postulo/locale` and `src/postulo/plugins/*/locale` (`:135-136`), the document themes (`:117`) and `static/css` (`:126`). The excluded catalogues still sit in the copied tree, so a change to any `.po` file changes the layer's key and the CSS is rebuilt. Correction to the candidate: Python and template changes are scanned too (`@source` covers every file under `src/postulo`), so they must rebuild it; only the locale directories can be left out. The win is small, and smaller still once #1033 item 4 moves this stage to `$BUILDPLATFORM` (the 38 s becomes a few seconds). ## What would change Copy what Tailwind reads and leave the catalogues out: `COPY --exclude=src/postulo/locale --exclude=src/postulo/plugins/*/locale src ./src` (the `--exclude` flag of the Dockerfile frontend; check that the BuildKit on the runner supports it, or pin the frontend with a `# syntax=docker/dockerfile:1` line). The `@source not` lines stay, so a local `npm run build:css` behaves the same. ## What it saves or protects small: `npm run build:css` (38 s of arm64 under QEMU per #1033's table, seconds natively) skipped on catalogue-only commits: 59 of the 707 commits on main since 2026-09-30 that touched `src` changed only `.po` files or `locale/` ## Accessibility none ## Decisions - **Own pull request, or with #1033 item 4?** Recommended: land it in the same pull request as #1033 item 4, since both edit the `styles` stage; file it as its own issue so it is not lost, and link the two. --- Found by the efficiency and reliability audit of 2026-10-30 (finding I6; index postulo/postulo#1108). Checked against `main` at `daee30b15` (2026-10-30).
tiagoagueda added this to the 0.6.0 milestone 2026-10-31 03:04:19 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo#1142
No description provided.