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

Documentation does not say what generated hashes actually represent #166

Closed keithl-stripe closed 1 year ago

keithl-stripe commented 1 year ago

The bazel-diff generate-hashes -h output mentions that it produces one hash per Bazel target:

Usage: bazel-diff generate-hashes [-hkvV] -b=<bazelPath>
                                  [--contentHashPath=<contentHashPath>]
                                  [-s=<seedFilepaths>] -w=<workspacePath>
                                  [-co=<bazelCommandOptions>]...
                                  [-so=<bazelStartupOptions>]... <outputPath>
Writes to a file the SHA256 hashes for each Bazel Target in the provided
workspace.

However it does not say what these hashes represent. I get the impression they are supposed to be analogous to Bazel's action cache key, but more conservative. It was especially unclear to me whether these hashes include information about transitive dependencies. My experimentation suggests that they do; that if any transitive dep of a target changes, its hash will change.

Regardless of whether my interpretation above is correct, a sentence or two in the help (and in the README) would go a long way to communicating what these hashes can be used for. Basically it should answer "What changes will result in a different hash?"