codeintel: ambiguous refname warning in configuration policy matcher
Created by: Strum355
From a customer issue, we've observed errors in the form of t=2022-02-11T18:56:18+0000 lvl=eror msg=codeintel.gitserver.CommitsUniqueToBranch error=“unexpected output from git log (bad date format) \“c88d32fd58c68c98167dfa4212d9586c4e238224:2020-12-22T02:17:01+00:00warning: refname ‘sampletext’ is ambiguous.\“” count=1.000 elapsed=0.069 repositoryID=3 branchName=sampletext isDefaultBranch=false
, which originates in the policy matcher.
This error was causing uploads to not be marked as expired in the upload expirer worker job, as confirmed by the expired column in lsif_uploads
not being set to true
for uploads that should have been deleted. The current suspect cause is that there are both branches and tags with the same name, which was confirmed as a possible cause in an isolated test case, awaiting confirmation from the customer.
A possible mitigation is to use the objhash instead of the branch name when calling gitserverClient.CommitsUniqueToBranch
. This gave the correct output in the isolated test case and we will create a fix and run the code-intel Q/A against the fix to make sure it has no side-effects.