Don't build Djblets static media when building packages.

Review Request #12961 — Created April 17, 2023 and submitted

Information

Review Board
release-6.x

Reviewers

Review Board includes the Djblets Pipeline bundle definitions as part of
its own definitions. This allows us to easily iterate on and build all
the Djblets static media files without making the process a completely
separate step during development. It also allows us to map bundle names
to built files, which is important in production.

Historically, the Review Board packages have contained the Djblets
static media, due to the inclusion of these bundles. This adds to the
size of the builds and the build times themselves, but goes unused in
production. When creating/updating a site, the static/djblets/
directory actually comes from the Djblets package and not Review
Board's.

So there's no reason to include them in the packages. But worse, with
the modern Babel/Rollup/TypeScript support, building Review Board
packages now fails when building against a Djblets package (such as in
CI). This is because the config files and node_modules needed by
Djblets aren't available without a Djblets source tree.

We now leave out the Djblets bundles when we're forcing static media to
build for packages (via ./setup.py bdist_wheel or
./contrib/internal/build-media.py). It's still included in all other
cases, ensuring nothing breaks when running Review Board.

Tested building packages and checking which bundles were built and
included.

Tested a site against packaged versions of Review Board and Djblets
and verified it ran.

Deployed a package built with this change to reviews.reviewboard.org
and verified nothing broke.

Summary ID
Don't build Djblets static media when building packages.
Review Board includes the Djblets Pipeline bundle definitions as part of its own definitions. This allows us to easily iterate on and build all the Djblets static media files without making the process a completely separate step during development. It also allows us to map bundle names to built files, which is important in production. Historically, the Review Board packages have contained the Djblets static media, due to the inclusion of these bundles. This adds to the size of the builds and the build times themselves, but goes unused in production. When creating/updating a site, the `static/djblets/` directory actually comes from the Djblets package and not Review Board's. So there's no reason to include them in the packages. But worse, with the modern Babel/Rollup/TypeScript support, building Review Board packages now fails when building against a Djblets package (such as in CI). This is because the config files and `node_modules` needed by Djblets aren't available without a Djblets source tree. We now leave out the Djblets bundles when we're forcing static media to build for packages (via `./setup.py bdist_wheel` or `./contrib/internal/build-media.py`). It's still included in all other cases, ensuring nothing breaks when running Review Board.
7175f352f6c8efa0f4fd2373ca01493887d5cf53
maubin
  1. Ship It!
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-6.x (0793182)