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

Add --fineGrainedHashExternalRepos #174

Closed tgeng closed 1 year ago

tgeng commented 1 year ago

Hi friends at Tinder! First thank you for making this awesome project! I work for Pinterest and we are evaluating adopting this over our in-house solution.

One issue I am seeing is that bazel-diff seems to treat the entire external repo as one opaque blob. For example, if one uses this with maven_install, any single third party dependency change ends up trigger a global rebuild.

This PR adds a flag that makes bazel-diff generate fine-grained hash for the explicitly mentioned external repos. This way, bazel-diff is smarter when handling external repos like @maven in a monorepo setting.

Usage: pass --fineGrainedHashExternalRepos maven1,maven2 to generate-hashes command and fine-grained hashes are generated for targets in the listed external repos.

Note: This is still a draft and hence I have not added any tests to this yet. I would like to get some input on this approach before that. I have tested this with a mono repo with >4M lines of Java code and it seems to be working as expected.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

tinder-maxwellelliott commented 1 year ago

@tgeng I am sorry, I am now realizing that fineGrainedHashExternalRepos matches the existing arg style. Can you go back to that?

tgeng commented 1 year ago

@tgeng I am sorry, I am now realizing that fineGrainedHashExternalRepos matches the existing arg style. Can you go back to that?

Np! Pushed another patch.

tinder-maxwellelliott commented 1 year ago

@tgeng Thank you!

tgeng commented 1 year ago

Thanks for the quick response! When can I expect another release? (I can build our own, but we still want to make it clean by using the official build eventually 😉 )

tinder-maxwellelliott commented 1 year ago

Thanks for the quick response! When can I expect another release? (I can build our own, but we still want to make it clean by using the official build eventually 😉 )

I will upload it now!