Skip to content

verify-action-build: keep non-minified JS, diff vs approved version#777

Merged
raboof merged 1 commit intomainfrom
verify-action-build-keep-non-minified
Apr 26, 2026
Merged

verify-action-build: keep non-minified JS, diff vs approved version#777
raboof merged 1 commit intomainfrom
verify-action-build-keep-non-minified

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented Apr 26, 2026

Summary

  • For non-minified compiled JS (Deno bundle output, Dart dart compile js, esbuild readable output) the rebuild produces toolchain-version noise rather than actionable diffs — surfaced as "non-minified — rebuild differs" warnings on PRs like action-allowlist-review: bump Kesin11/actions-timeline from 3.0.0 to 3.1.0 in /.github/actions/for-dependabot-triggered-reviews #736.
  • Skip those files in the Dockerfile pre-rebuild deletion step (record paths in /kept-js.log) and diff them against the previously-approved version instead, with beautify_js() applied so the diff renders readably.
  • Minified bundles still take the full delete-and-rebuild path, so hand-written or unbuilt JS in dist/ is still caught.

Test plan

🤖 Generated with Claude Code

A clean rebuild of non-minified bundles (Deno's `deno task bundle`,
Dart's `dart compile js`, esbuild non-minified output) tends to differ
from the committed `dist/` only in toolchain-version noise — esbuild,
ncc and webpack boilerplate evolve between versions and the diff isn't
actionable for review. Until now those files showed up as
"non-minified — rebuild differs" warnings that reviewers couldn't act
on; surfaced again on PR #736 against `Kesin11/actions-timeline`.

Treat them differently: in the pre-rebuild deletion step the Dockerfile
now skips files that look non-minified (<10 lines, or average line
length >500 chars — same heuristic as `is_minified()` in `diff_js.py`)
and records each kept path in `/kept-js.log`. The rebuild comparison
short-circuits these files with a yellow note pointing at the
approved-vs-new diff, and `diff_approved_vs_new()` now diffs them
against the previously-approved version (overriding its `dist/`
exclusion) with `beautify_js()` applied so huge bundles render
readably. Reviewers see real source changes between versions instead of
toolchain artifacts.

Minified bundles still take the full delete-and-rebuild path, so
hand-written or unbuilt JS in `dist/` is still caught.

Tests: `test_keeps_non_minified_compiled_js` guards the Dockerfile
heuristic; `TestDiffJsKeptFiles` covers the `kept_files` short-circuit
in `diff_js`. README updated to describe the behaviour.

Generated-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@raboof raboof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds reasonable

@raboof raboof merged commit f46dddd into main Apr 26, 2026
8 checks passed
@raboof raboof deleted the verify-action-build-keep-non-minified branch April 26, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants