rough-vase-8355311/16/2022, 11:35 PM
? Might be a bit scope creepy but very useful for CI + there's already subsystem logic for Git. One use case I have in mind is raising a CI lint error if a Docker image target changes but its version number hasn't changed.
happy-kitchen-8948211/17/2022, 12:16 AM
rough-vase-8355311/17/2022, 12:21 AM
+ some scripting.
gsw master && ./pants peek
main_tag=$(./pants peek --git-ref=main :tgt | jq ..) head_tag=$(./pants peek :tgt | jq ..)
. But much less trivial.
happy-kitchen-8948211/17/2022, 2:47 AM
rough-vase-8355311/17/2022, 2:49 AM
happy-kitchen-8948211/17/2022, 2:49 AM
rough-vase-8355311/17/2022, 2:50 AM
happy-kitchen-8948211/17/2022, 2:54 AM
rough-vase-8355311/17/2022, 2:56 AM
has all the same technical challenges and more? It has to read the merge base git ref and then compute some logical diff between that and the worktree
would be the same thing minus the logical diff. Unless I'm way off about how
./pants peek --git-ref=main
happy-kitchen-8948211/17/2022, 3:00 AM
only looks at which paths have changed, but not their content.
rough-vase-8355311/17/2022, 3:05 AM
I'm a bit confused here. Are you saying it doesn't even look at the contents of BUILD files?only looks at which paths have changed, but not their content.
commit f070e507e8b4bb2d4f44549d00be9f5936d1bd50 Author: Navneeth Jayendran <email@example.com> Date: Wed Nov 16 19:04:40 2022 -0800 Update message diff --git a/README.md b/README.md index 716ed14..dd880bc 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ # Hello world + +Add some more content commit 2d244ca0497b53065235b6f3efa0a9410a3de3e8 Author: Navneeth Jayendran <firstname.lastname@example.org> Date: Wed Nov 16 19:04:23 2022 -0800 Initial commit diff --git a/BUILD.pants b/BUILD.pants new file mode 100644 index 0000000..2666440 --- /dev/null +++ b/BUILD.pants @@ -0,0 +1,4 @@ +file( + name="README", + source="README.md" +) diff --git a/README.md b/README.md new file mode 100644 index 0000000..716ed14 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Hello world diff --git a/pants.toml b/pants.toml new file mode 100644 index 0000000..8d269d8 --- /dev/null +++ b/pants.toml @@ -0,0 +1,2 @@ +[GLOBAL] +pants_version = "2.14.0"
, it shows that
./pants list --changed-since HEAD~
changes. The only change since previous commit was to modify README file contents
happy-kitchen-8948211/17/2022, 3:15 AM
behaves as if you had hand-edited all the files that have changed since the gitref
rough-vase-8355311/17/2022, 3:20 AM
curved-television-656811/17/2022, 2:13 PM
works as follows
• The previous revision is checked out, then we run. This gives us the hashmap representation for the entire Bazel graph, then we write this JSON to a file.
• Next we checkout the initial revision, then we runand write that JSON to a file. Now we have our final hashmap representation for the Bazel graph.
• We runon the starting and final JSON hash filepaths to get our impacted set of targets. This impacted set of targets is written to a file.