Skip to content

feat(ci): Fail frontend checks when vendored JS changes without its README - #8120

Open
geographybuff wants to merge 3 commits into
freelawproject:mainfrom
geographybuff:8062-vendored-js-readme-check
Open

geographybuff wants to merge 3 commits into
freelawproject:mainfrom
geographybuff:8062-vendored-js-readme-check

Conversation

@geographybuff

@geographybuff geographybuff commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Fixes

Fixes: #8062

Summary

This PR adds the check the issue describes, then renames flatpickr's files and records it in the README. The commits follow the order the issue suggests, so CI shows the check working:

  1. The check (f1c2b00).
    • check_vendored_js_readme in .github/scripts/frontend_checks.py fails the job (FAIL) when upstream files in js/third_party/ or js/alpine/ change but that directory's README.md doesn't.
    • Changes under js/alpine/components/ and js/alpine/composables/ are ignored. Each directory needs its own README change.
    • main() now also records the old side of an R line in --name-status, so moving a file into or out of a vendored directory counts. It also runs this check when no template or CSS file changed; until now it returned early in that case. Copies (C) leave their source untouched, so only their new path counts.
    • frontend-lint.yml now also triggers on js/third_party/** and js/alpine/**.
    • Tests: 11 new tests in test_frontend_checks.py, three of them through main() with real --name-status input. pytest .github/scripts passes 27 tests. Ruff (v0.14.11) check and format are clean. Pyrefly reports the same two existing errors in these files before and after.
  2. The flatpickr rename (pushed next). flatpickr@4.6.13(.min).js and plugins/confirmDate@4.6.13(.min).js drop the version from their names, and the three require_script call sites are updated (corpus_search/date_selector ×2, docket_filter ×1). This commit should make the frontend checks fail.
  3. The README section (pushed after that). A flatpickr section in js/third_party/README.md, following the htmx one, makes the check pass again.

On the README's sources: I compared the vendored files with jsDelivr's flatpickr@4.6.13 copies.

  • flatpickr.min.js is byte-identical.
  • The two unminified files match the CDN copies after running Prettier 2 with cl/.prettierrc.js (apart from whitespace on two blank lines), so they were reformatted, not modified. The README says so.
  • confirmDate.min.js differs only in jsDelivr's "Minified by jsDelivr using Terser v5.x" comment.

The flatpickr stylesheet in css/third_party/ is out of scope, so it isn't touched.

Documentation

Once merged, the following documentation needs to be updated:

  • None. The README change is part of this PR.

Deployment

This PR should:

  • skip-deploy (skips everything below)
    • skip-web-deploy
    • skip-celery-deploy
    • skip-cronjob-deploy
    • skip-daemon-deploy

The renamed static files and the two templates are served by the web tier, so only web needs to deploy.

AI Disclosure

  • No AI tools were used to create the content of this PR.
  • Parts of this PR were created with the help of an AI tool, and I have carefully reviewed all of its content and take full responsibility for it.

AI model used: Claude Opus 5.5 (via Claude Code). It wrote the check, the tests and the README section, and ran the tests.

🤖 Generated with Claude Code

geographybuff and others added 3 commits October 8, 2026 12:28
…EADME

Adds check_vendored_js_readme to .github/scripts/frontend_checks.py. When
upstream files in js/third_party/ or js/alpine/ change and that
directory's README.md doesn't, the job fails with FAIL severity. Our own
code in js/alpine/components/ and js/alpine/composables/ is ignored.

main() now also records the old side of a rename, so moving a file into
or out of a vendored directory counts, and runs this check even when no
template or CSS file changed. frontend-lint.yml now triggers on the two
vendored directories.

Refs freelawproject#8062

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Renames flatpickr@4.6.13(.min).js and plugins/confirmDate@4.6.13(.min).js
to flatpickr(.min).js and plugins/confirmDate(.min).js, matching the
other third-party files, and updates the three require_script call sites
so a future upgrade doesn't have to touch them.

js/third_party/README.md is not updated in this commit, so the new
vendored-JS check should fail here.

Refs freelawproject#8062

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rty README

Adds a flatpickr section to js/third_party/README.md, following the htmx
one, with the version and the CDN URL of each vendored file. This makes
the vendored-JS check pass again.

Fixes freelawproject#8062

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@geographybuff
geographybuff marked this pull request as ready for review October 8, 2026 12:34

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@geographybuff

Copy link
Copy Markdown
Contributor Author

Pushed the second commit (c0e6f6b): the flatpickr rename and the three call-site updates, with no README change. The Frontend Checks job should now fail on check_vendored_js_readme. The README section follows in the next commit.

@geographybuff

Copy link
Copy Markdown
Contributor Author

The second commit failed Frontend Checks as expected (run 37778321331): check_vendored_js_readme reported that js/third_party/ changed without its README. Pushed the third commit (b22fb8b), which adds the flatpickr section to js/third_party/README.md, so the check should pass now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: O 🍊

Development

Successfully merging this pull request may close these issues.

CI: fail when vendored JS changes without a README update

2 participants