Fix an infinite loop if rollup config can't be found.

Review Request #12956 — Created April 14, 2023 and submitted

Information

Djblets
release-4.x

Reviewers

The code to try to find the rollup configuration file iterates up
the directory tree until either the config is found or we hit the root.
Unfortunately, this was comparing a Path object (for the current path)
against str (for the root), which always evaluates to False. The
result was that if there's no rollup config, we'd end up infinitely
looping comparing Path('/') to /. This change fixes that.

Tried to load an extension which defined an index.ts file in its
bundles but did not have a rollup.config.js file. Saw that we no
longer hit the infinite loop.

Summary ID
Fix an infinite loop if rollup config can't be found.
The code to try to find the rollup configuration file iterates up the directory tree until either the config is found or we hit the root. Unfortunately, this was comparing a `Path` object (for the current path) against `str` (for the root), which always evaluates to `False`. The result was that if there's no rollup config, we'd end up infinitely looping comparing `Path('/')` to `/`. This change fixes that. Testing Done: Tried to load an extension which defined an `index.ts` file in its bundles but did not have a `rollup.config.js` file. Saw that we no longer hit the infinite loop.
d7fe1766dcb6a92ab2b8a5942dc2a43160715219
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.x (37dfaca)
Loading...