Skip to content

Stop committing the built widget assets - #475

Merged
FlorentinD merged 5 commits into
mainfrom
untrack-widget-assets
Oct 9, 2026
Merged

FlorentinD merged 5 commits into
mainfrom
untrack-widget-assets

Conversation

@FlorentinD

Copy link
Copy Markdown
Collaborator

What

The widget's build outputs — widget.js, index.html, nvl_entrypoint/style.css and streamlit_v2/graph.js — are vite build products that were checked into git and rewritten on every JS change (~16 MB per change), so PRs carried huge diffs and CI had to enforce they stayed in sync (nvl-entrypoint-test.yml).

This untracks them. They are now:

  • built by just js-build locally,
  • built in CI by a shared composite action before anything that imports the package, and
  • still shipped in the wheel and sdist.

Changes

  • .gitignore the build outputs; git rm --cached them
  • New .github/actions/build-js composite action, wired into release.yml, unit-tests.yml (plus a js-applet/** trigger path), gds-integration-tests.yml, snowflake-integration-tests.yml and render-docs.yml; deleted nvl-entrypoint-test.yml
  • Drop the Streamlit stylesheet copy (byte-identical to the widget's): streamlit.py reads the widget's copy and the build script deletes the emitted duplicate
  • Fail fast when the assets are missing: pytest_configure guard, widget.py import guard, just py-test chains js-build, CONTRIBUTING note

Verification

  • uv build → wheel and sdist contain all four assets (no MANIFEST.in needed)
  • Fresh venv: install the wheel offline, import neo4j_viz/nvl/streamlit, construct the widget
  • just py-test → 323 passed, 11 skipped; just py-style clean
  • Missing assets make pytest exit with a hint to run just js-build

Note: this only stops the repo from growing; the existing history is untouched (rewriting it would be a public-history rewrite).

widget.js, index.html, graph.js and style.css are vite build outputs that were checked in and rewritten on every JS change, so each PR carried ~16 MB of churn and CI had to enforce they stayed in sync (nvl-entrypoint-test.yml). Untrack them: they are now built by `just js-build` and by a shared CI action before anything that imports the package, while still shipping in the wheel and sdist.

Also drop the Streamlit stylesheet, which was byte-identical to the widget's, and read the widget's copy instead.

Importing the widget (or running pytest) without the assets now fails with a hint to run `just js-build`.
@FlorentinD
FlorentinD requested a review from a team as a code owner October 9, 2026 15:12
The whole nvl_entrypoint/ and streamlit_v2/ directories are build output, so ignore them wholesale in python-wrapper/.gitignore (next to the existing resource ignores) instead of listing each file.
setuptools silently omits missing package data, so a forgotten JS build would publish a wheel without the widget. Verify the built wheel and sdist contain all four assets before uploading to PyPI.
Also import the built wheel in a clean env, reusing the widget's own asset guard (which checks widget.js and style.css) as an end-to-end check that the published wheel is usable.
Drop the separate wheel/sdist asset checker and keep only the one-liner that imports the built wheel, which reuses the widget's own asset guard.
@FlorentinD
FlorentinD merged commit 8b2ffac into main Oct 9, 2026
14 checks passed
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.

1 participant