Tinder / bazel-diff

Performs Bazel Target Diffing between two revisions in Git, allowing for Test Target Selection and Selective Building
Other
397 stars 59 forks source link

feature: Allow user to provide their own content hash to minimise IO operation #129

Closed fa93hws closed 2 years ago

fa93hws commented 2 years ago

closing #107

User now can provide an optional argument --contentHashFilepath. It is required to be a json format file with the following shape:

{
  "web/src/pages/login/button/button.tsx": "891ad1e682a7e6538603291963d62740f8fce4244771f66b1f977ad546e88868",
  "foo-services/src/java/com/xx/foo.java": "c09a57550d151625ea9d8d9ffb0344f16f243c74fb4770dcee6a530a14cb5cb5"
}

File path in the file will be relative path from workpsace.

During content hashing phase, if the file is in the map, no IO work will be performed, content hash from the JSON file will be used instead. Otherwise, the existing solution will apply.

N.B. Most of the LOC comes from unit test