mangrovedao/mangrove.js

Heroku auto deployment from GitHub is broken due to submodules

espendk opened this issue · 2 comments

Describe the bug
Heroku auto deployments from GitHub are failing with the following message:

Error HH404: File foundry_lib/forge-std/src/Test.sol, imported from contracts/test/lib/Test2.sol

This is due to the introduction of submodules which are not supported by Heroku's GitHub integration:

billede
https://devcenter.heroku.com/articles/github-integration

To Reproduce
Steps to reproduce the behavior:

  1. Go to the Greedy Taker bot on Heroku
  2. On the Deploy tab, manually trigger a deployment:
    billede

Alternatively:

  1. Merge a commit to master on GitHub
  2. Wait for CI to successfully complete
  3. Observe that the triggered auto deployments on Heroku fail.

Expected behavior
Deployment should succeed.

Additional context
Git submodules were introduced along with Foundry: https://github.com/mangrovedao/mangrove/pull/541

We've implemented a temporary workaround in #564:

This workaround introduces a Heroku-specific build script to each package and using these builds in the heroku-postbuild script in the root package.json. This allows the package builds to be tailored to Heroku.

For most packages, the Heroku build is simply an alias for the normal build.
The following modifications have been made to the build:

  • mangrove-solidity: Don't build anything.
  • mangrove.js: Don't create hardhatAddresses.json as this requires unavailable artifacts from mangrove-solidity. This is not a problem, as tests aren't run on Heroku.

NB: This is not a sustainable solution as it add maintenance overhead and relies on quirks of our current setup (eg Mangrove ABI files being committed to the mangrove.js package source).

@adhusson found this npm package which might be helpful: https://github.com/foundry-rs/hardhat/tree/develop/packages/easy-foundryup
There's currently no documentation though...