Page MenuHomePhabricator

[Cashtab] Use monorepo dependencies instead of npm
ClosedPublic

Authored by bytesofman on May 7 2024, 21:01.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC051a73779c58: [Cashtab] Use monorepo dependencies instead of npm
Summary

T3548

All monorepo apps with monorepo deps should use the relative install instead of version pinning npm. In this way, we can be sure that upgrades to the libraries are not breaking apps -- and we do not have to do hard-to-remember maintenance diffs to keep all apps on the right version of dependencies all the time.

Test Plan

./contrib/teamcity/build-configurations.py cashtab-tests

Edit cashtab.Dockerfile so that line 52 reads ARG NGINX_CONF=nginx-preview.conf
docker build -f cashtab.Dockerfile -t cashtab_local .
docker run --rm -p 8080:80 --name cashtab cashtab_local

Navigate to localhost:8080 and Cashtab is built and working

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cashtab-use-monorepo-deps
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 28930
Build 57397: Build Diffcashtab-tests
Build 57396: arc lint + arc unit

Event Timeline

Tail of the build log:

Installing mock-chronik-client dependencies...
/work/modules/mock-chronik-client /work/abc-ci-builds/cashtab-tests

added 236 packages, and audited 237 packages in 2s

35 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
/work/cashtab /work/modules/mock-chronik-client /work/abc-ci-builds/cashtab-tests

added 1635 packages, and audited 1640 packages in 29s

261 packages are looking for funding
  run `npm fund` for details

2 moderate severity vulnerabilities

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> cashtab@2.38.5 build
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

Module not found: Error: Can't resolve 'chronik-client' in '/work/cashtab/src'


Build cashtab-tests failed with exit code 1

update testing CI to prepare local dependencies

Add upgraded Dockerfile to manage local deps

bytesofman published this revision for review.May 7 2024, 22:05
Fabien added a subscriber: Fabien.

Very nice !

For the sake of avoiding breaking production, I would suggest you don't remove the cashtab/Dockerfile yet. This is the right move but it buys you time to update the CI to the new one and make sure everything is working before you actually remove the file, so you always have a backup.

cashtab/package.json
36 ↗(On Diff #47671)

Macro likestamp:

This revision is now accepted and ready to land.May 8 2024, 08:06

For the sake of avoiding breaking production, I would suggest you don't remove the cashtab/Dockerfile yet. This is the right move but it buys you time to update the CI to the new one and make sure everything is working before you actually remove the file, so you always have a backup.

The problem is that the current Dockerfile is guaranteed to fail every time now that dependencies aren't coming from npm. May need to go through a few iterations for CI deployment to work, but can always revert this if needed.

re-add legacy Dockerfile for now