https://pantsbuild.org/ logo
#general
Title
# general
a

ambitious-actor-36781

10/28/2021, 1:34 AM
so, my
./pants --changed-since=origin/master list
no longer works... on CI. locally works fine:
Copy code
╰─➤  git --version
git version 2.30.2

╰─➤  ./pants --changed-since=origin/master list      
14:33:17.78 [INFO] Initializing scheduler...
but on ci... fails:
Copy code
$ git --version
git version 2.20.1

$ ./pants -ldebug --changed-since=$CHANGED_SINCE list
01:32:16.80 [DEBUG] Detected git repository at /builds/infloai/repo on branch None
01:32:16.80 [DEBUG] Executing: git --git-dir=/builds/infloai/repo/.git --work-tree=/builds/infloai/repo diff --name-only HEAD -- /builds/infloai/repo
01:32:16.83 [DEBUG] Executing: git --git-dir=/builds/infloai/repo/.git --work-tree=/builds/infloai/repo diff --name-only origin/master...HEAD -- /builds/infloai/repo
01:32:16.84 [ERROR] git --git-dir=/builds/infloai/repo/.git --work-tree=/builds/infloai/repo diff --name-only origin/master...HEAD -- /builds/infloai/repo failed with exit code 128
(Use --print-stacktrace for more error details and/or --no-process-execution-local-cleanup to inspect chroots. See <https://www.pantsbuild.org/v2.7/docs/troubleshooting> for common issues. Consider reaching out for help: <https://www.pantsbuild.org/v2.7/docs/getting-help.>)
h

hundreds-father-404

10/28/2021, 1:35 AM
What happens if you run this command directly in CI?
Copy code
git --git-dir=/builds/infloai/repo/.git --work-tree=/builds/infloai/repo diff --name-only origin/master...HEAD -- /builds/infloai/repo
a

ambitious-actor-36781

10/28/2021, 1:36 AM
Copy code
$ git --git-dir=/builds/infloai/repo/.git --work-tree=/builds/infloai/repo diff --name-only origin/master...HEAD -- /builds/infloai/repo
fatal: bad revision 'origin/master...HEAD'
h

hundreds-father-404

10/28/2021, 1:37 AM
Hm, getting that working will be the root of it. Pants is simply shelling out to Git, so if the underlying Git process isn't working, Pants won't
a

ambitious-actor-36781

10/28/2021, 1:41 AM
hmm
b

busy-vase-39202

10/28/2021, 1:48 AM
Is it possible that
master
is now
main
these days, like many other repos?
a

ambitious-actor-36781

10/28/2021, 1:48 AM
f***ing gitlab-ci. literal pain in the ass.
nope, the
origin/master
is from
$CI_DEFAULT_BRANCH
so it exists.
b

busy-vase-39202

10/28/2021, 1:49 AM
what does
git branch -a
get you?
a

ambitious-actor-36781

10/28/2021, 1:51 AM
Copy code
$ git branch --all
* (HEAD detached at cc39b80)
b

busy-vase-39202

10/28/2021, 1:52 AM
Is that in CI?
a

ambitious-actor-36781

10/28/2021, 1:56 AM
yeah
ah, solved it. have to change the git-clone-depth to 0
👍 1
h

hundreds-father-404

10/28/2021, 3:31 AM
What changed from before? It sounded like it had been working previously iiuc
a

ambitious-actor-36781

10/28/2021, 10:36 PM
I have no idea tbh. I suspect it's something weird like the depth wasn't deep enough to pick up
master
7 Views