Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New CI pipline for fork with no changes (or any changes) fails in misc_jdk17 step #6129

Closed
nickbreen opened this issue Aug 10, 2023 · 10 comments

Comments

@nickbreen
Copy link
Contributor

Setting up a new fork with Azure Pipelines CI fails consistently with this error in the misc_jdk17 step and test-misc.sh.


ERROR: Empty diff for 600920f...600920f.
Try pulling base branch (often main or master) into compare branch (often your feature branch).
Other causes of an empty diff include:

  • The commit range is a no-op, such as a commit and its revert.
  • HEAD is a merge commit and the merge took all its changes from its second argument.
  • Your compare branch does not differ from your base branch.

https://dev.azure.com/nickbreen/checker-framework/_build/results?buildId=5&view=logs&j=03ef1a5a-d30a-57af-3a6d-62ddb34c1ad2&t=5d54b24c-372d-5954-02b2-e775bd9d239f&l=1814354

The diff is always the HEAD of the branch.

I expect that this message is the actual issue:

  • Your compare branch does not differ from your base branch.

What is surprising/confusing is that this error occurred on the master branch of the fork... there is no compare branch.

It also occurred when creating a new branch, and when synchronising the fork from upstream.

@nickbreen
Copy link
Contributor Author

As an aside, setting up a new "free" Azure account, one will need to explicitly request "parallel" jobs be enabled... initial run of the pipeline will fail with instructions.

@nickbreen
Copy link
Contributor Author

I did find this in the docs: https://checkerframework.org/manual/developer-manual.html#azure-pipelines-bug-same-commit-hash

Azure Pipelines has a bug: whenever two CI jobs would run code with the same commit hash, it re-uses a previous execution result. This is a bug because the CI job's behavior may depend on the branch name and other factors that are independent of the commit hash. This means that you may see spurious successes or failures when your branch of (say) the jdk repository has the identical commit hash to some other branch that Azure Pipelines previous ran a job for.

But I'm not entirely sure if it is the same issue.

@nickbreen
Copy link
Contributor Author

nickbreen commented Aug 10, 2023

Just confirming that a commit avoids the error, as expected
.
A minor commit (updating a javadoc) still presents the same failure.

@nickbreen
Copy link
Contributor Author

nickbreen commented Aug 13, 2023

@nickbreen
Copy link
Contributor Author

https://dev.azure.com/nickbreen/checker-framework/_build/results?buildId=16&view=logs&j=03ef1a5a-d30a-57af-3a6d-62ddb34c1ad2&t=5d54b24c-372d-5954-02b2-e775bd9d239f&l=12496

From https://github.com/nickbreen/checker-framework
* branch                master     -> FETCH_HEAD
git diff 600920f22049b5d55b8c1ade5fd23402dff016d0...5fede57c1ba8b28c4288ca043200b898f26555aa > /tmp/diff.txt
fatal: 600920f22049b5d55b8c1ade5fd23402dff016d0...5fede57c1ba8b28c4288ca043200b898f26555aa: no merge base
fatal: 600920f22049b5d55b8c1ade5fd23402dff016d0...5fede57c1ba8b28c4288ca043200b898f26555aa: no merge base
* (HEAD detached at origin/5fede57c1ba8b28c4288ca043200b898f26555aa)
  remotes/origin/5fede57c1ba8b28c4288ca043200b898f26555aa
  remotes/origin/master
fatal: 600920f22049b5d55b8c1ade5fd23402dff016d0...5fede57c1ba8b28c4288ca043200b898f26555aa: no merge base

@nickbreen
Copy link
Contributor Author

Yet git diff 600920f22049b5d55b8c1ade5fd23402dff016d0...5fede57c1ba8b28c4288ca043200b898f26555aa is just fine.

@nickbreen
Copy link
Contributor Author

nickbreen commented Aug 14, 2023

Hunch: shallow clones of branches with more than one commit will not have a merge-base. Going to try a branch with a single squash commit.

I suspect that may have been the phantom green build I thought I saw in #6129 (comment)

https://dev.azure.com/nickbreen/checker-framework/_build/results?buildId=21&view=logs&j=03ef1a5a-d30a-57af-3a6d-62ddb34c1ad2&t=06a14f9f-12e3-5481-35b2-b69d36c91440&l=33 shows the --depth=1 argument.

@nickbreen
Copy link
Contributor Author

Nope.

@nickbreen
Copy link
Contributor Author

It seems that almost all the checkout steps have a fetchDepth set. The default apparently being 1.

Setting a conservative fetchDepth: 25 on the checkout steps that were missing the property seems to have avoided the issue.

@nickbreen
Copy link
Contributor Author

Subject: [PATCH] everyone else has a fetchDepth so why can't i?
---
Index: azure-pipelines.yml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
--- a/azure-pipelines.yml	(revision 9bff96328aa6540c2aec94ce2747ecab3bfe2b8f)
+++ b/azure-pipelines.yml	(revision 717f705e0f18fab6c78b6ef35e3cfc767094c503)
@@ -160,6 +160,7 @@
   container: mdernst/cf-ubuntu-jdk11-plus:latest
   steps:
   - checkout: self
+    fetchDepth: 25
   - bash: ./checker/bin-devel/test-misc.sh
     displayName: test-misc.sh
 - job: misc_jdk17
@@ -168,6 +169,7 @@
   container: mdernst/cf-ubuntu-jdk17-plus:latest
   steps:
   - checkout: self
+    fetchDepth: 25
   - bash: ./checker/bin-devel/test-misc.sh
     displayName: test-misc.sh
 - job: misc_jdk20
@@ -179,6 +181,7 @@
   container: mdernst/cf-ubuntu-jdk20-plus:latest
   steps:
   - checkout: self
+    fetchDepth: 25
   - bash: ./checker/bin-devel/test-misc.sh
     displayName: test-misc.sh
 - job: typecheck_jdk11

@nickbreen nickbreen changed the title New CI pipline for fork with no changes fails in misc_jdk17 step New CI pipline for fork with no changes (or any changes) fails in misc_jdk17 step Aug 14, 2023
@mernst mernst closed this as completed in 4d22418 Aug 16, 2023
wmdietl pushed a commit to eisop/checker-framework that referenced this issue Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant