Fix Pipeline settings path validation for external node module paths.

Review Request #14816 — Created Feb. 12, 2026 and updated — Latest diff uploaded

Information

Djblets
release-5.x

Reviewers

We recently changed the way that we check whether babel, lessc, rollup
and uglifyjs binaries exist in the node modules path when building
Pipeline settings. We used to hard-code paths like
<node_modules_path>/.bin/rollup and check for their existence, but now
we use the npm exec command.

However, we invoke the command from the current working directory, when we
should actually be invoking it from the parent directory of the given node
modules path. This was made evident when trying to build Power Pack or run
its unit tests. Power Pack relies on the binaries in Review Board's node
modules, but npm exec was being run from Power Pack's node modules
directory.

This change fixes this so that the binaries are actually checked for in
the node modules paths, instead of the current working directory. And
we now include the consuming application's node modules path when
building the static media for an extension. If the binary is found,
then we use that path when running the binary with npm exec.

We also add handling for when node_modules_path is an empty string.
This can happen if we didn't find any node modules directories, which
should be an error state. When validate_paths=False and we have an
empty node_modules_path, we use the current working directory as
the path.

And finally this updates the docstring to (I hope) clarify the
validate_paths argument and when it should be set to False, and
clarifies the expectations of node_modules_path when
validate_paths=False.

  • Ran unit tests.
  • Was able to run Power Pack unit tests without hitting the
    ImproperlyConfigured error for rollup.
  • Was able to build a Power Pack package against a development server
    of Review Board without hitting the ImproperlyConfigured error for
    rollup.
  • Set node_modules_path with validate_paths=True to an empty string,
    a real path valid path and a non-existent one separated by a colon,
    a real path valid path, and a non-existent path.
  • Ran the dev server, previously saw an error about the rollup command
    failing but its gone away with this fix.

Commits

Files