Skip to content

Stop shipping the JavaScript build configuration in packages - #10403

Merged
asheshv merged 1 commit into
pgadmin-org:masterfrom
dpage:strip-build-files
Sep 9, 2026
Merged

Stop shipping the JavaScript build configuration in packages#10403
asheshv merged 1 commit into
pgadmin-org:masterfrom
dpage:strip-build-files

Conversation

@dpage

@dpage dpage commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

The Windows installer and the pip wheel both ship web/yarn.lock, web/package.json and the rest of the JavaScript build configuration into the installed tree, none of which is used at runtime, since only the webpack output under pgadmin/static/js/generated is. As node_modules is stripped, the lockfile that remains describes packages that are not actually present, so vulnerability scanners run against an installation report the whole build-time dependency tree, devDependencies included. That produces findings nobody can act on, and they recur on every release however current the pinned versions happen to be. The report that prompted this flagged postcss and tar against C:\PostgreSQL\18\pgAdmin 4\web\yarn.lock, where postcss is only ever invoked by postcss-loader at bundle time and tar only arrives transitively through cacache and node-gyp.

The Linux, macOS and Docker builds already removed these files, so this only brings Windows and pip into line with them:

  • Make.bat removed node_modules and the .yarn cache but left yarn.lock, package.json, jest.config.js, babel.*, webpack.* and the lint/editor configuration behind.
  • pkg/pip/build.sh assembles the wheel from git ls-files, so it shipped the same files; the new cleanup runs before syft, so the SBOM now describes what actually ships rather than the build tree.
  • webpack.* is added to the Linux and macOS lists, which Docker already dropped, so all four packagers now strip an identical set.

pkg/src/build.sh deliberately keeps yarn.lock, since the source tarball genuinely is source.

I verified this rather than assuming it: I assembled a web tree with the cleanup applied, started pgAdmin from it, and both /misc/ping and /browser/ return 200 with every generated bundle served, so nothing removed here is load-bearing at runtime. The Windows and macOS packagers I have not been able to exercise end to end locally, so those paths would benefit from a check on the build machines.

Summary by CodeRabbit

  • Build and Packaging
    • Reduced packaged application contents by removing JavaScript build-time configuration, dependency, and tooling files from Windows, Linux, macOS, and pip distributions.
    • Ensured generated bundles exclude unnecessary development artifacts, including Yarn, Webpack, Babel, Jest, and ESLint files.

The Windows installer and the pip wheel were both shipping web/yarn.lock,
web/package.json and the rest of the JavaScript build configuration into
the installed tree, even though none of it is used at runtime: only the
webpack output under pgadmin/static/js/generated is. Because node_modules
is stripped, the lockfile that remains describes packages that are not
present, so vulnerability scanners run against an installation report the
whole build-time dependency tree, devDependencies included, as findings
that cannot be acted on and will recur on every release no matter how
current the versions are.

The Linux, macOS and Docker builds already removed these files, so this
brings Windows and pip into line with them, and adds webpack.* to the
Linux and macOS lists so that all of the packagers now strip the same
set. For pip the cleanup runs before syft, so the SBOM describes what
actually ships.

Verified by assembling a web tree with the cleanup applied and starting
pgAdmin from it: /misc/ping and /browser/ both return 200 and every
generated bundle is served.
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: cda4ca51-c72d-4909-bb71-a4c9865a8042

📥 Commits

Reviewing files that changed from the base of the PR and between 9d0a61a and 788f38d.

📒 Files selected for processing (4)
  • Make.bat
  • pkg/linux/build-functions.sh
  • pkg/mac/build-functions.sh
  • pkg/pip/build.sh

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Walkthrough

Build scripts for Windows, Linux, macOS, and pip packages now remove JavaScript dependency metadata and build configuration files from staged or packaged web directories.

Changes

Build artifact cleanup

Layer / File(s) Summary
Remove JavaScript build files from packages
Make.bat, pkg/linux/build-functions.sh, pkg/mac/build-functions.sh, pkg/pip/build.sh
Packaging and runtime cleanup removes Yarn, Webpack, Babel, Jest, ESLint, editor, and related JavaScript build files. Cleanup occurs before SBOM generation in the pip build.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 788f3

Packaged installations will omit JavaScript build configuration and dependency metadata while retaining generated runtime bundles. The supplied runtime checks show core application access continues to work, and no merge-blocking risk is identified.

Suggested reviewers: asheshv

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: removing JavaScript build configuration files from packaged installations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@asheshv asheshv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@asheshv
asheshv merged commit 6c70d7c into pgadmin-org:master Sep 9, 2026
34 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.

2 participants