MonkeyCanCode opened a new pull request, #148:
URL: https://github.com/apache/polaris-tools/pull/148

   So currently we have two projects under this repo which are using Makefile. 
Reading makefile is never fun and a bit more tedious when we have multiple of 
them. The problems may be a bit more worse as we add more Makefile (e.g. one 
per project...so we will have five instead of two for current repo).
   
   Also, for the current existed Makefile, they all have their own 
"pre-requisite" which will prevent other targets to fail (e.g. most of the 
targets in benchmarks will need `application.conf` and most of the targets in 
console will need `make install`...which is doing npm install to install 
dependencies). These can be fix on the individual Makefile or do what I did in 
this PR to chain these relations on the top level Makefile (so other Makefiles 
stay the same).
   
   Here is the sample output:
   ```
   ➜  polaris-tools git:(top_level_makefile) ✗ make
   
   Usage:
     make <target>
   
   General
     help                                      Display this help
   
   Benchmarks
     benchmarks-create-dataset-simulation      Run create dataset simulation
     benchmarks-read-simulation                Run read simulation
     benchmarks-read-update-simulation         Run read/update simulation
     benchmarks-create-commits-simulation      Run create commits simulation
     benchmarks-weighted-workload-simulation   Run weighted workload simulation
     benchmarks-reports-list                   List benchmark reports
     benchmarks-reports-clean                  Clean benchmark reports
   
   Console
     console-build-docker                      Build docker image for console 
project
     console-install                           Install dependencies for console 
project
     console-build                             Build console project
     console-lint                              Lint the console project
     console-lint-fix                          Fix linting issues in the 
console project
     console-format-check                      Check formatting in the console 
project
     console-format-fix                        Fix formatting in the console 
project
     console-dev                               Run the console project in 
development mode
   ```
   
   For benchmarks (newly added pre-requisite for checking if config is there):
   ```shell
   # new behavior
   ➜  polaris-tools git:(top_level_makefile) ✗ make 
benchmarks-create-dataset-simulation
   ERROR: benchmarks/application.conf is missing
   make: *** [benchmarks-pre-requisite] Error 1
   
   # original behavior
   ➜  benchmarks git:(top_level_makefile) ✗ make create-dataset-simulation
   ./gradlew gatlingRun --simulation 
org.apache.polaris.benchmarks.simulations.CreateTreeDataset \
         -Dconfig.file=./application.conf
   
   > Task :gatlingRun
   21:27:18.847 [ERROR] i.g.a.Gatling$ - Run crashed
   java.io.FileNotFoundException: ./application.conf (No such file or directory)
           at java.base/java.io.FileInputStream.open0(Native Method)
           at java.base/java.io.FileInputStream.open(FileInputStream.java:213)
           at java.base/java.io.FileInputStream.<init>(FileInputStream.java:152)
           at 
com.typesafe.config.impl.Parseable$ParseableFile.reader(Parseable.java:629)
           at com.typesafe.config.impl.Parseable.reader(Parseable.java:99)
           at 
com.typesafe.config.impl.Parseable.rawParseValue(Parseable.java:233)
           at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:180)
   ```
   
   For console (auto make install for deps installation):
   ```shell
   # new behavior
   ➜  polaris-tools git:(top_level_makefile) ✗ make console-lint
   --- Install dependencies for console project ---
   npm install
   
   added 337 packages, and audited 338 packages in 3s
   
   80 packages are looking for funding
     run `npm fund` for details
   
   found 0 vulnerabilities
   --- Dependencies for console project completed ---
   --- Linting the console project ---
   npm run format:check
   
   > [email protected] format:check
   > prettier --check "src/**/*.{ts,tsx,js,jsx,json,css,md}"
   
   Checking formatting...
   All matched files use Prettier code style!
   npm run lint
   
   > [email protected] lint
   > eslint .
   
   --- Console project linted ---
   
   # original behavior
   ➜  console git:(top_level_makefile) ✗ make lint
   npm run format:check
   
   > [email protected] format:check
   > prettier --check "src/**/*.{ts,tsx,js,jsx,json,css,md}"
   
   sh: prettier: command not found
   make: *** [format-check] Error 127
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to