-
Notifications
You must be signed in to change notification settings - Fork 76
Try to expose duplicate key exception in #467 #475
Conversation
Codecov Report
@@ Coverage Diff @@
## master #475 +/- ##
=========================================
Coverage 72.57% 72.57%
Complexity 1006 1006
=========================================
Files 87 87
Lines 3741 3741
Branches 435 435
=========================================
Hits 2715 2715
Misses 878 878
Partials 148 148 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
@uhafner do you have an idea why this test is successful, even if it throws an error in the Jenkins environment? |
Which error? Do you mean the PMD warning?
Maybe I did not set the correct baselines that caused the issue. Unfortunately, the build with the exception trace has been deleted in the meantime.
|
|
Okay I might have expressed it badly. Yes the trace would be helpful, you are right... |
Ah, ok. I thought you were talking about the checks of this PR...
I'm not sure if the other commit This is the original log: But the build 93 has been deleted already. Locally I get: I'm not sure if the result is different if the reference build will be explicitly set. And another difference: in a pull request there is an additional merge commit in the git repository that merges the HEAD of the PR with the latest commit of the master. |
|
I'm not sure if I fully understood |
|
Yes, that causes the exception, I agree. I think I was able to recreate the error just a few minutes ago, Do I have permissions to push the adjusted test case here? I also explained my guess there with comments. |
I gave you write permissions to this repository, so you should have access to the existing branch. (Note that the test case is not ideal as it depends on a forked repository. Before merging it makes sense to create a stable one). |
|
Yes that is true. Nonetheless, I pushed the adjusted test case in order to get your opinion on this - note the comments within the test case. Afterwards, we can adjust this test case if we are sure this is the error. |
Yes, that probably is the actual problem (I think that I also needed to handle that case in
I'm not sure if it is feasible to reproduce such a case without a pull request. |
Good, I will fix that and create a PR for the Git Forensics Plugin.
I agree. And even if it is possible, it takes much effort. The developers which reported the error can test the fix and then we can close this PR without a merge in my opinion. |
|
@uhafner just to be sure, is there a possibility yet to get the merge commit in case of a pull request? |
First of all, I am checking in https://github.com/jenkinsci/git-forensics-plugin/blob/master/plugin/src/main/java/io/jenkins/plugins/forensics/git/reference/GitCheckoutListener.java#L124 for a merge request.
Then I am checking if the head is a merge commit or not. I think not all cases are yet handled correctly, there is an open issue in Jira. The head can be a merge commit because the author merged the PR with master (your example) or if Jenkins created a temporary merge. Then the getLatestCommit should not include the merge. But since I found no way to set up a good integration test, this code still might have bugs. |
|
@uhafner thanks for the explanation. I suggest the following solution:
Could you please review these approaches and we discuss them in the PRs? |
For details see https://github.com/jenkinsci/code-coverage-api-plugin/issues/467